]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: Fix firmware version handling
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Nov 2025 22:28:52 +0000 (00:28 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Dec 2025 17:49:43 +0000 (18:49 +0100)
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: stable@vger.kernel.org
Fixes: 5f708cccde9d ("wifi: iwlwifi: add a new FW file numbering scheme")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220805
Link: https://patch.msgid.link/20251113222852.15896-1-ville.syrjala@linux.intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-drv.c

index 3391f07b01de3c19e767acf8ef2343067fd1e37f..f8fc6f30fbe5f929fadeec19734148bafabdd2ee 100644 (file)
@@ -1597,7 +1597,7 @@ static void _iwl_op_mode_stop(struct iwl_drv *drv)
  */
 static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
 {
-       unsigned int min_core, max_core, loaded_core;
+       int min_core, max_core, loaded_core;
        struct iwl_drv *drv = context;
        struct iwl_fw *fw = &drv->fw;
        const struct iwl_ucode_header *ucode;
@@ -1676,7 +1676,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
        if (loaded_core < min_core || loaded_core > max_core) {
                IWL_ERR(drv,
                        "Driver unable to support your firmware API. "
-                       "Driver supports FW core %u..%u, firmware is %u.\n",
+                       "Driver supports FW core %d..%d, firmware is %d.\n",
                        min_core, max_core, loaded_core);
                goto try_again;
        }