linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command
@ 2022-01-13  8:42 Luca Coelho
  2022-01-13 10:47 ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Coelho @ 2022-01-13  8:42 UTC (permalink / raw)
  To: kvalo; +Cc: luca, linux-wireless, lenb, johannes

From: Luca Coelho <luciano.coelho@intel.com>

Older hardware, for instance 3160, do not support SAR GEO offsets.  We
used to check for support before sending the command, but when moving
the command to the init phase, we lost the check.  This causes a
failure when initializing HW that do not support this command.

Fix that by adding a check before sending the command.  Additionally,
fix the caller so that it checks for the return value of the
iwl_mvm_sar_geo_init() function, which it was ignoring.

Fixes: db700bc35703 ("iwlwifi: mvm: check if SAR GEO is supported before sending command")
Cc: stable@vger.kernel.org # 5.15+
Reported-by: Len Brown <lenb@kernel.org>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 6f4690e56a46..6528a6253336 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -882,6 +882,10 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
 		     offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, ops) !=
 		     offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, ops));
 
+	/* not supporting GEO is not a failure, so return 0 */
+	if (!iwl_sar_geo_support(&mvm->fwrt))
+		return 0;
+
 	/* the ops field is at the same spot for all versions, so set in v1 */
 	cmd.v1.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES);
 
@@ -1741,7 +1745,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
 	ret = iwl_mvm_sar_init(mvm);
 	if (ret == 0)
 		ret = iwl_mvm_sar_geo_init(mvm);
-	else if (ret < 0)
+	if (ret < 0)
 		goto error;
 
 	ret = iwl_mvm_sgom_init(mvm);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command
  2022-01-13  8:42 [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command Luca Coelho
@ 2022-01-13 10:47 ` Kalle Valo
  2022-01-13 12:09   ` Luca Coelho
  0 siblings, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2022-01-13 10:47 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, lenb, johannes

Luca Coelho <luca@coelho.fi> writes:

> From: Luca Coelho <luciano.coelho@intel.com>
>
> Older hardware, for instance 3160, do not support SAR GEO offsets.  We
> used to check for support before sending the command, but when moving
> the command to the init phase, we lost the check.  This causes a
> failure when initializing HW that do not support this command.
>
> Fix that by adding a check before sending the command.  Additionally,
> fix the caller so that it checks for the return value of the
> iwl_mvm_sar_geo_init() function, which it was ignoring.
>
> Fixes: db700bc35703 ("iwlwifi: mvm: check if SAR GEO is supported before sending command")

$ git show db700bc35703
fatal: ambiguous argument 'db700bc35703': unknown revision or path not in the working tree.

No need to resend because of this, if you can provide the commit id I
can fix the tag.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command
  2022-01-13 10:47 ` Kalle Valo
@ 2022-01-13 12:09   ` Luca Coelho
  2022-01-27 18:29     ` Luca Coelho
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Coelho @ 2022-01-13 12:09 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, lenb, johannes

On Thu, 2022-01-13 at 12:47 +0200, Kalle Valo wrote:
> Luca Coelho <luca@coelho.fi> writes:
> 
> > From: Luca Coelho <luciano.coelho@intel.com>
> > 
> > Older hardware, for instance 3160, do not support SAR GEO offsets.  We
> > used to check for support before sending the command, but when moving
> > the command to the init phase, we lost the check.  This causes a
> > failure when initializing HW that do not support this command.
> > 
> > Fix that by adding a check before sending the command.  Additionally,
> > fix the caller so that it checks for the return value of the
> > iwl_mvm_sar_geo_init() function, which it was ignoring.
> > 
> > Fixes: db700bc35703 ("iwlwifi: mvm: check if SAR GEO is supported before sending command")
> 
> $ git show db700bc35703
> fatal: ambiguous argument 'db700bc35703': unknown revision or path not in the working tree.
> 
> No need to resend because of this, if you can provide the commit id I
> can fix the tag.

Oops, sorry, I added the tag to my own commit...

This is the correct one:

Fixes: 78a19d5285d9 ("iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage")

--
Luca.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command
  2022-01-13 12:09   ` Luca Coelho
@ 2022-01-27 18:29     ` Luca Coelho
  0 siblings, 0 replies; 4+ messages in thread
From: Luca Coelho @ 2022-01-27 18:29 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, lenb, johannes

On Thu, 2022-01-13 at 14:09 +0200, Luca Coelho wrote:
> On Thu, 2022-01-13 at 12:47 +0200, Kalle Valo wrote:
> > Luca Coelho <luca@coelho.fi> writes:
> > 
> > > From: Luca Coelho <luciano.coelho@intel.com>
> > > 
> > > Older hardware, for instance 3160, do not support SAR GEO offsets.  We
> > > used to check for support before sending the command, but when moving
> > > the command to the init phase, we lost the check.  This causes a
> > > failure when initializing HW that do not support this command.
> > > 
> > > Fix that by adding a check before sending the command.  Additionally,
> > > fix the caller so that it checks for the return value of the
> > > iwl_mvm_sar_geo_init() function, which it was ignoring.
> > > 
> > > Fixes: db700bc35703 ("iwlwifi: mvm: check if SAR GEO is supported before sending command")
> > 
> > $ git show db700bc35703
> > fatal: ambiguous argument 'db700bc35703': unknown revision or path not in the working tree.
> > 
> > No need to resend because of this, if you can provide the commit id I
> > can fix the tag.
> 
> Oops, sorry, I added the tag to my own commit...
> 
> This is the correct one:
> 
> Fixes: 78a19d5285d9 ("iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage")

As we discussed on IRC, this is not the right fix.  I have now finally
had the time to fix it properly, so let's drop this patch.  I'll send a
new one soon.

--
Cheers,
Luca.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-27 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13  8:42 [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command Luca Coelho
2022-01-13 10:47 ` Kalle Valo
2022-01-13 12:09   ` Luca Coelho
2022-01-27 18:29     ` Luca Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).