Skip to content

Commit c868a18

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU
The driver is supposed to read the PNVM from BIOS only for non-Intel SKUs. For Intel SKUs the OEM ID will be 0. Read BIOS PNVM only when a non-Intel SKU is indicated. Fixes: b99e32c ("wifi: iwlwifi: Take loading and setting of pnvm image out of parsing part") Signed-off-by: Miri Korenblit <[email protected]> Reviewed-by: Gregory Greenman <[email protected]> Link: https://msgid.link/20240131091413.3625cf1223d3.Ieffda5f506713b1c979388dd7a0e1c1a0145cfca@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent cfbb2ad commit c868a18

File tree

1 file changed

+18
-12
lines changed
  • drivers/net/wireless/intel/iwlwifi/fw

1 file changed

+18
-12
lines changed

drivers/net/wireless/intel/iwlwifi/fw/pnvm.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,21 +268,27 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)
268268
struct pnvm_sku_package *package;
269269
u8 *image = NULL;
270270

271-
/* First attempt to get the PNVM from BIOS */
272-
package = iwl_uefi_get_pnvm(trans_p, len);
273-
if (!IS_ERR_OR_NULL(package)) {
274-
if (*len >= sizeof(*package)) {
275-
/* we need only the data */
276-
*len -= sizeof(*package);
277-
image = kmemdup(package->data, *len, GFP_KERNEL);
271+
/* Get PNVM from BIOS for non-Intel SKU */
272+
if (trans_p->sku_id[2]) {
273+
package = iwl_uefi_get_pnvm(trans_p, len);
274+
if (!IS_ERR_OR_NULL(package)) {
275+
if (*len >= sizeof(*package)) {
276+
/* we need only the data */
277+
*len -= sizeof(*package);
278+
image = kmemdup(package->data,
279+
*len, GFP_KERNEL);
280+
}
281+
/*
282+
* free package regardless of whether kmemdup
283+
* succeeded
284+
*/
285+
kfree(package);
286+
if (image)
287+
return image;
278288
}
279-
/* free package regardless of whether kmemdup succeeded */
280-
kfree(package);
281-
if (image)
282-
return image;
283289
}
284290

285-
/* If it's not available, try from the filesystem */
291+
/* If it's not available, or for Intel SKU, try from the filesystem */
286292
if (iwl_pnvm_get_from_fs(trans_p, &image, len))
287293
return NULL;
288294
return image;

0 commit comments

Comments
 (0)