Skip to contentSkip to conversation

iwlwifi: mvm: Avoid use of GEO_TX_POWER_LIMIT when not supported

PATCH In review Jonathan McDowell 2 participants 2 messages Mar 15, 2020 – Mar 17, 2020 Intel wireless wifi link (iwlwifi)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iwlwifi: mvm: Avoid use of GEO_TX_POWER_LIMIT when not supported

Commit 39c1a9728f93 refactored the SAR table support and inadvertently added a call to GEO_TX_POWER_LIMIT without checking that the firmware supported it. This caused a regression for device + firmware combinations lacking the support. Add a check in iwl_mvm_sar_init to prevent this.

Fixes 39c1a9728f93 (iwlwifi: refactor the SAR tables from mvm to acpi)

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

drivers/net/wireless/intel/iwlwifi/mvm/fw.c +7 -0
index 54c094e88474..4a8a4cb2c553 100644
@@ -1007,6 +1007,13 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm)
 	if (ret == -ENOENT)
 		return 1;
 
+	/*
+	 * If our firmware doesn't support GEO_TX_POWER_LIMIT then skip trying
+	 * to use it.
+	 */
+	if (!iwl_sar_geo_support(&mvm->fwrt))
+		return 1;
+
 	return ret;
 }
 
Signature · 1 line
... Don't do it!
#1 lore raw
Quoted 18 lines · Jonathan McDowell

Commit 39c1a9728f93 refactored the SAR table support and inadvertently added a call to GEO_TX_POWER_LIMIT without checking that the firmware supported it. This caused a regression for device + firmware combinations lacking the support. Add a check in iwl_mvm_sar_init to prevent this.

Fixes 39c1a9728f93 (iwlwifi: refactor the SAR tables from mvm to acpi)

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

drivers/net/wireless/intel/iwlwifi/mvm/fw.c +0 -0
index 54c094e88474..4a8a4cb2c553 100644
@@ -1007,6 +1007,13 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm)
 	if (ret == -ENOENT)
 		return 1;

drivers/net/wireless/intel/iwlwifi/mvm/fw.c static int iwl_mvm_sar_init(struct iwl_mvm *mvm) · line 1018

Quoted 10 lines
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +7 -0
 
+	/*
+	 * If our firmware doesn't support GEO_TX_POWER_LIMIT then skip trying
+	 * to use it.
+	 */
+	if (!iwl_sar_geo_support(&mvm->fwrt))
+		return 1;
+
 	return ret;
 }

Thanks, Jonathan! We already have an internal patch that fixes this (also fixes another symptom of the same bug). I'll send it out now.

--
Cheers,
Luca.