diff mbox series

[v2] iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices

Message ID 20200324235545.20233-1-sultan.alsawaf@canonical.com
State New
Headers show
Series [v2] iwlwifi: mvm: Do not require PHY_SKU NVM section for 3168 devices | expand

Commit Message

Sultan Alsawaf March 24, 2020, 11:55 p.m. UTC
From: Dan Moulding <dmoulding@me.com>

BugLink: https://bugs.launchpad.net/bugs/1868442

The logic for checking required NVM sections was recently fixed in
commit b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168
devices"). However, with that fixed the else is now taken for 3168
devices and within the else clause there is a mandatory check for the
PHY_SKU section. This causes the parsing to fail for 3168 devices.

The PHY_SKU section is really only mandatory for the IWL_NVM_EXT
layout (the phy_sku parameter of iwl_parse_nvm_data is only used when
the NVM type is IWL_NVM_EXT). So this changes the PHY_SKU section
check so that it's only mandatory for IWL_NVM_EXT.

Fixes: b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168 devices")
Signed-off-by: Dan Moulding <dmoulding@me.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
(cherry picked from commit a9149d243f259ad8f02b1e23dfe8ba06128f15e1)
Signed-off-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kamal Mostafa March 25, 2020, 12:05 a.m. UTC | #1
LGTM.

Acked-by: Kamal Mostafa <kamal@canonical.com>

 -Kamal

On Tue, Mar 24, 2020 at 04:55:45PM -0700, Sultan Alsawaf wrote:
> From: Dan Moulding <dmoulding@me.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1868442
> 
> The logic for checking required NVM sections was recently fixed in
> commit b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168
> devices"). However, with that fixed the else is now taken for 3168
> devices and within the else clause there is a mandatory check for the
> PHY_SKU section. This causes the parsing to fail for 3168 devices.
> 
> The PHY_SKU section is really only mandatory for the IWL_NVM_EXT
> layout (the phy_sku parameter of iwl_parse_nvm_data is only used when
> the NVM type is IWL_NVM_EXT). So this changes the PHY_SKU section
> check so that it's only mandatory for IWL_NVM_EXT.
> 
> Fixes: b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168 devices")
> Signed-off-by: Dan Moulding <dmoulding@me.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> (cherry picked from commit a9149d243f259ad8f02b1e23dfe8ba06128f15e1)
> Signed-off-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> index 70b29bf16bb9..60296a754af2 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> @@ -308,7 +308,8 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
>  		}
>  
>  		/* PHY_SKU section is mandatory in B0 */
> -		if (!mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
> +		if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT &&
> +		    !mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
>  			IWL_ERR(mvm,
>  				"Can't parse phy_sku in B0, empty sections\n");
>  			return NULL;
> -- 
> 2.20.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Khaled Elmously March 25, 2020, 2:23 a.m. UTC | #2
On 2020-03-24 16:55:45 , Sultan Alsawaf wrote:
> From: Dan Moulding <dmoulding@me.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1868442
> 
> The logic for checking required NVM sections was recently fixed in
> commit b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168
> devices"). However, with that fixed the else is now taken for 3168
> devices and within the else clause there is a mandatory check for the
> PHY_SKU section. This causes the parsing to fail for 3168 devices.
> 
> The PHY_SKU section is really only mandatory for the IWL_NVM_EXT
> layout (the phy_sku parameter of iwl_parse_nvm_data is only used when
> the NVM type is IWL_NVM_EXT). So this changes the PHY_SKU section
> check so that it's only mandatory for IWL_NVM_EXT.
> 
> Fixes: b3f20e098293 ("iwlwifi: mvm: fix NVM check for 3168 devices")
> Signed-off-by: Dan Moulding <dmoulding@me.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
> (cherry picked from commit a9149d243f259ad8f02b1e23dfe8ba06128f15e1)
> Signed-off-by: Sultan Alsawaf <sultan.alsawaf@canonical.com>
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> index 70b29bf16bb9..60296a754af2 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
> @@ -308,7 +308,8 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
>  		}
>  
>  		/* PHY_SKU section is mandatory in B0 */
> -		if (!mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
> +		if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT &&
> +		    !mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
>  			IWL_ERR(mvm,
>  				"Can't parse phy_sku in B0, empty sections\n");
>  			return NULL;

Thanks Sultan

Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
index 70b29bf16bb9..60296a754af2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
@@ -308,7 +308,8 @@  iwl_parse_nvm_sections(struct iwl_mvm *mvm)
 		}
 
 		/* PHY_SKU section is mandatory in B0 */
-		if (!mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
+		if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT &&
+		    !mvm->nvm_sections[NVM_SECTION_TYPE_PHY_SKU].data) {
 			IWL_ERR(mvm,
 				"Can't parse phy_sku in B0, empty sections\n");
 			return NULL;