All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 01/14] wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU
Date: Wed, 31 Jan 2024 10:24:34 +0200	[thread overview]
Message-ID: <20240131091413.3625cf1223d3.Ieffda5f506713b1c979388dd7a0e1c1a0145cfca@changeid> (raw)
In-Reply-To: <20240131082447.1372353-1-miriam.rachel.korenblit@intel.com>

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: b99e32cbfdf6 ("wifi: iwlwifi: Take loading and setting of pnvm image out of parsing part")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 30 ++++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
index d467ec0e3552..053174f00e49 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
@@ -268,21 +268,27 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)
 	struct pnvm_sku_package *package;
 	u8 *image = NULL;
 
-	/* First attempt to get the PNVM from BIOS */
-	package = iwl_uefi_get_pnvm(trans_p, len);
-	if (!IS_ERR_OR_NULL(package)) {
-		if (*len >= sizeof(*package)) {
-			/* we need only the data */
-			*len -= sizeof(*package);
-			image = kmemdup(package->data, *len, GFP_KERNEL);
+	/* Get PNVM from BIOS for non-Intel SKU */
+	if (trans_p->sku_id[2]) {
+		package = iwl_uefi_get_pnvm(trans_p, len);
+		if (!IS_ERR_OR_NULL(package)) {
+			if (*len >= sizeof(*package)) {
+				/* we need only the data */
+				*len -= sizeof(*package);
+				image = kmemdup(package->data,
+						*len, GFP_KERNEL);
+			}
+			/*
+			 * free package regardless of whether kmemdup
+			 * succeeded
+			 */
+			kfree(package);
+			if (image)
+				return image;
 		}
-		/* free package regardless of whether kmemdup succeeded */
-		kfree(package);
-		if (image)
-			return image;
 	}
 
-	/* If it's not available, try from the filesystem */
+	/* If it's not available, or for Intel SKU, try from the filesystem */
 	if (iwl_pnvm_get_from_fs(trans_p, &image, len))
 		return NULL;
 	return image;
-- 
2.34.1


  reply	other threads:[~2024-01-31  8:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31  8:24 [PATCH 00/14] wifi: iwlwifi: updates - 2024-01-31 Miri Korenblit
2024-01-31  8:24 ` Miri Korenblit [this message]
2024-01-31  8:24 ` [PATCH 02/14] wifi: iwlwifi: mvm: d3: implement suspend with MLO Miri Korenblit
2024-01-31  8:24 ` [PATCH 03/14] wifi: iwlwifi: mvm: check AP supports EMLSR Miri Korenblit
2024-01-31  8:24 ` [PATCH 04/14] wifi: iwlwifi: prepare for reading SAR tables from UEFI Miri Korenblit
2024-01-31  8:24 ` [PATCH 05/14] wifi: iwlwifi: cleanup sending PER_CHAIN_LIMIT_OFFSET_CMD Miri Korenblit
2024-01-31  8:24 ` [PATCH 06/14] wifi: iwlwifi: read SAR tables from UEFI Miri Korenblit
2024-01-31  8:24 ` [PATCH 07/14] wifi: iwlwifi: small cleanups in PPAG table flows Miri Korenblit
2024-01-31  8:24 ` [PATCH 08/14] wifi: iwlwifi: prepare for reading PPAG table from UEFI Miri Korenblit
2024-01-31  8:24 ` [PATCH 09/14] wifi: iwlwifi: validate PPAG table when sent to FW Miri Korenblit
2024-01-31  8:24 ` [PATCH 10/14] wifi: iwlwifi: read PPAG table from UEFI Miri Korenblit
2024-01-31  8:24 ` [PATCH 11/14] wifi: iwlwifi: don't check TAS block list size twice Miri Korenblit
2024-01-31  8:24 ` [PATCH 12/14] wifi: iwlwifi: prepare for reading TAS table from UEFI Miri Korenblit
2024-01-31  8:24 ` [PATCH 13/14] wifi: iwlwifi: separate TAS 'read-from-BIOS' and 'send-to-FW' flows Miri Korenblit
2024-01-31  8:24 ` [PATCH 14/14] wifi: iwlwifi: read WTAS table from UEFI Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240131091413.3625cf1223d3.Ieffda5f506713b1c979388dd7a0e1c1a0145cfca@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.