diff mbox series

[16/16] iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support

Message ID 20190720102545.5952-17-luca@coelho.fi (mailing list archive)
State Accepted
Delegated to: Luca Coelho
Headers show
Series iwlwifi: fixes intended for 5.3 2019-07-20 | expand

Commit Message

Luca Coelho July 20, 2019, 10:25 a.m. UTC
From: Luca Coelho <luciano.coelho@intel.com>

We erroneously added a check for FW API version 41 before sending
GEO_TX_POWER_LIMIT, but this was already implemented in version 38.
Additionally, it was cherry-picked to older versions, namely 17, 26
and 29, so check for those as well.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Jonas Hahnfeld Aug. 1, 2019, 2:07 p.m. UTC | #1
Am Samstag, den 20.07.2019, 13:25 +0300 schrieb Luca Coelho:
> From: Luca Coelho <
> luciano.coelho@intel.com
> >
> 
> We erroneously added a check for FW API version 41 before sending
> GEO_TX_POWER_LIMIT, but this was already implemented in version 38.
> Additionally, it was cherry-picked to older versions, namely 17, 26
> and 29, so check for those as well.
> 
> Signed-off-by: Luca Coelho <
> luciano.coelho@intel.com
> >
> ---
>  drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> index a837cf40afde..00c89bcfdf6a 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> @@ -886,9 +886,14 @@ static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm)
>  	 * The GEO_TX_POWER_LIMIT command is not supported on earlier
>  	 * firmware versions.  Unfortunately, we don't have a TLV API
>  	 * flag to rely on, so rely on the major version which is in
> -	 * the first byte of ucode_ver.
> +	 * the first byte of ucode_ver.  This was implemented
> +	 * initially on version 38 and then backported to 36, 29 and
> +	 * 17.
>  	 */
> -	return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 41;
> +	return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 ||
> +	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 36 ||
> +	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 ||
> +	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17;
>  }
>  
>  int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)

After pulling iwlwifi-fixes-for-kvalo-2019-07-30, I still get firmware
crashes on my "Intel(R) Dual Band Wireless AC 8260" which uses firmware
version 36. I tried the latest ucode in linux-firmware (36.77d01142.0),
but it seems GEO_TX_POWER_LIMIT is not yet implemented there.

Could you let me know which firmware version I need for Linux 5.3? Can
there be a check in iwl_mvm_sar_geo_support() that the backported
support is indeed available?

Thanks,
Jonas
Luca Coelho Aug. 22, 2019, 6:44 a.m. UTC | #2
On Thu, 2019-08-01 at 16:07 +0200, Jonas Hahnfeld wrote:
> Am Samstag, den 20.07.2019, 13:25 +0300 schrieb Luca Coelho:
> > From: Luca Coelho <
> > luciano.coelho@intel.com
> > 
> > We erroneously added a check for FW API version 41 before sending
> > GEO_TX_POWER_LIMIT, but this was already implemented in version 38.
> > Additionally, it was cherry-picked to older versions, namely 17, 26
> > and 29, so check for those as well.
> > 
> > Signed-off-by: Luca Coelho <
> > luciano.coelho@intel.com
> > ---
> >  drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> > index a837cf40afde..00c89bcfdf6a 100644
> > --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> > +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
> > @@ -886,9 +886,14 @@ static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm)
> >  	 * The GEO_TX_POWER_LIMIT command is not supported on earlier
> >  	 * firmware versions.  Unfortunately, we don't have a TLV API
> >  	 * flag to rely on, so rely on the major version which is in
> > -	 * the first byte of ucode_ver.
> > +	 * the first byte of ucode_ver.  This was implemented
> > +	 * initially on version 38 and then backported to 36, 29 and
> > +	 * 17.
> >  	 */
> > -	return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 41;
> > +	return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 ||
> > +	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 36 ||
> > +	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 ||
> > +	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17;
> >  }
> >  
> >  int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
> 
> After pulling iwlwifi-fixes-for-kvalo-2019-07-30, I still get firmware
> crashes on my "Intel(R) Dual Band Wireless AC 8260" which uses firmware
> version 36. I tried the latest ucode in linux-firmware (36.77d01142.0),
> but it seems GEO_TX_POWER_LIMIT is not yet implemented there.
> 
> Could you let me know which firmware version I need for Linux 5.3? Can
> there be a check in iwl_mvm_sar_geo_support() that the backported
> support is indeed available?

We have some issues detecting whether the FW supports this command or
not.  There is already a bugzilla[1] for this (and a bunch of
duplicates), so let's track it there.

https://bugzilla.kernel.org/show_bug.cgi?id=204151


--
Cheers,
Luca.
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index a837cf40afde..00c89bcfdf6a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -886,9 +886,14 @@  static bool iwl_mvm_sar_geo_support(struct iwl_mvm *mvm)
 	 * The GEO_TX_POWER_LIMIT command is not supported on earlier
 	 * firmware versions.  Unfortunately, we don't have a TLV API
 	 * flag to rely on, so rely on the major version which is in
-	 * the first byte of ucode_ver.
+	 * the first byte of ucode_ver.  This was implemented
+	 * initially on version 38 and then backported to 36, 29 and
+	 * 17.
 	 */
-	return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 41;
+	return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 38 ||
+	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 36 ||
+	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 29 ||
+	       IWL_UCODE_SERIAL(mvm->fw->ucode_ver) == 17;
 }
 
 int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)