Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:11 +0200
commita3fc8da4b7dbd0acd454e80dc2edac7e3044c491 (patch)
treeb6a8b00cda91dca08f1ebcc6ebdaca2243decae5
parentbf4b0d2c03b5193993f17af44b08163018fa5b30 (diff)
iwlwifi: mvm: don't send GEO_TX_POWER_LIMIT on version < 41
-rw-r--r--patches.kernel.org/5.2.9-143-iwlwifi-mvm-don-t-send-GEO_TX_POWER_LIMIT-on-ve.patch78
-rw-r--r--series.conf1
2 files changed, 79 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-143-iwlwifi-mvm-don-t-send-GEO_TX_POWER_LIMIT-on-ve.patch b/patches.kernel.org/5.2.9-143-iwlwifi-mvm-don-t-send-GEO_TX_POWER_LIMIT-on-ve.patch
new file mode 100644
index 0000000000..7be3e3ce24
--- /dev/null
+++ b/patches.kernel.org/5.2.9-143-iwlwifi-mvm-don-t-send-GEO_TX_POWER_LIMIT-on-ve.patch
@@ -0,0 +1,78 @@
+From: Luca Coelho <luciano.coelho@intel.com>
+Date: Mon, 24 Jun 2019 22:29:33 +0300
+Subject: [PATCH] iwlwifi: mvm: don't send GEO_TX_POWER_LIMIT on version < 41
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: 39bd984c203e86f3109b49c2a2e20677c4d3ab65
+
+commit 39bd984c203e86f3109b49c2a2e20677c4d3ab65 upstream.
+
+Firmware versions before 41 don't support the GEO_TX_POWER_LIMIT
+command, and sending it to the firmware will cause a firmware crash.
+We allow this via debugfs, so we need to return an error value in case
+it's not supported.
+
+This had already been fixed during init, when we send the command if
+the ACPI WGDS table is present. Fix it also for the other,
+userspace-triggered case.
+
+Cc: stable@vger.kernel.org
+Fixes: 7fe90e0e3d60 ("iwlwifi: mvm: refactor geo init")
+Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 22 ++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+index 1ae6753b005a..47f23b4816a5 100644
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+@@ -874,6 +874,17 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
+ return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd);
+ }
+
++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.
++ */
++ return IWL_UCODE_SERIAL(mvm->fw->ucode_ver) >= 41;
++}
++
+ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
+ {
+ struct iwl_geo_tx_power_profiles_resp *resp;
+@@ -889,6 +900,9 @@ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
+ .data = { &geo_cmd },
+ };
+
++ if (!iwl_mvm_sar_geo_support(mvm))
++ return -EOPNOTSUPP;
++
+ ret = iwl_mvm_send_cmd(mvm, &cmd);
+ if (ret) {
+ IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);
+@@ -914,13 +928,7 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
+ int ret, i, j;
+ u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT);
+
+- /*
+- * This 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.
+- */
+- if (IWL_UCODE_SERIAL(mvm->fw->ucode_ver) < 41)
++ if (!iwl_mvm_sar_geo_support(mvm))
+ return 0;
+
+ ret = iwl_mvm_sar_get_wgds_table(mvm);
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 8d2d7376fc..603a8f0b12 100644
--- a/series.conf
+++ b/series.conf
@@ -1163,6 +1163,7 @@
patches.kernel.org/5.2.9-140-iwlwifi-don-t-unmap-as-page-memory-that-was-map.patch
patches.kernel.org/5.2.9-141-iwlwifi-mvm-fix-an-out-of-bound-access.patch
patches.kernel.org/5.2.9-142-iwlwifi-mvm-fix-a-use-after-free-bug-in-iwl_mvm.patch
+ patches.kernel.org/5.2.9-143-iwlwifi-mvm-don-t-send-GEO_TX_POWER_LIMIT-on-ve.patch
########################################################
# Build fixes that apply to the vanilla kernel too.