From: Luca Coelho <luca-XPOmlcxoEMv1KXRcyAk9cg@public.gmane.org> Subject: [PATCH] iwlwifi: mvm: check if SAR GEO is supported before sending command Date: Thu, 13 Jan 2022 10:42:40 +0200 From: Luca Coelho <luciano.coelho-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org # 5.15+ Reported-by: Len Brown <lenb-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Signed-off-by: Luca Coelho <luciano.coelho-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> [ rebased on top of 5.15.14 / tmb ] Signed-of-by: Thomas Backlund <tmb@mageia.org> --- 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 @@ -835,6 +835,10 @@ static int iwl_mvm_sar_geo_init(struct i 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);