Skip to content

Commit 75ecfbc

Browse files
vsyrjalaheftig
authored andcommitted
wifi: iwlwifi: Fix firmware version handling
On my system the arithmetic done on the firmware numbers results in a negative number, but since the types are unsigned it gets interpreted as a large positive number. The end result is that the firmware gets rejected and wifi is defunct. Switch to signed types to handle this case correctly. iwlwifi 0000:0c:00.0: Driver unable to support your firmware API. Driver supports FW core 4294967294..2, firmware is 2. iwlwifi 0000:0c:00.0: Direct firmware load for iwlwifi-5000-4.ucode failed with error -2 iwlwifi 0000:0c:00.0: Direct firmware load for iwlwifi-5000-3.ucode failed with error -2 iwlwifi 0000:0c:00.0: Direct firmware load for iwlwifi-5000-2.ucode failed with error -2 iwlwifi 0000:0c:00.0: Direct firmware load for iwlwifi-5000-1.ucode failed with error -2 iwlwifi 0000:0c:00.0: no suitable firmware found! iwlwifi 0000:0c:00.0: minimum version required: iwlwifi-5000-1 iwlwifi 0000:0c:00.0: maximum version supported: iwlwifi-5000-5 iwlwifi 0000:0c:00.0: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git Cc: linux-wireless@vger.kernel.org Cc: Johannes Berg <johannes.berg@intel.com> Cc: Miri Korenblit <miriam.rachel.korenblit@intel.com> Fixes: 5f708cc ("wifi: iwlwifi: add a new FW file numbering scheme") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cherry-picked-for: https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/issues/171
1 parent 30484f0 commit 75ecfbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/wireless/intel/iwlwifi/iwl-drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ static void _iwl_op_mode_stop(struct iwl_drv *drv)
15991599
*/
16001600
static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
16011601
{
1602-
unsigned int min_core, max_core, loaded_core;
1602+
int min_core, max_core, loaded_core;
16031603
struct iwl_drv *drv = context;
16041604
struct iwl_fw *fw = &drv->fw;
16051605
const struct iwl_ucode_header *ucode;
@@ -1678,7 +1678,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
16781678
if (loaded_core < min_core || loaded_core > max_core) {
16791679
IWL_ERR(drv,
16801680
"Driver unable to support your firmware API. "
1681-
"Driver supports FW core %u..%u, firmware is %u.\n",
1681+
"Driver supports FW core %d..%d, firmware is %d.\n",
16821682
min_core, max_core, loaded_core);
16831683
goto try_again;
16841684
}

0 commit comments

Comments
 (0)