From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
Luca Coelho <luciano.coelho@intel.com>,
stable@vger.kernel.org
Subject: [PATCH 01/16] iwlwifi: mvm: don't send GEO_TX_POWER_LIMIT on version < 41
Date: Sat, 20 Jul 2019 13:25:30 +0300 [thread overview]
Message-ID: <20190720102545.5952-2-luca@coelho.fi> (raw)
In-Reply-To: <20190720102545.5952-1-luca@coelho.fi>
From: Luca Coelho <luciano.coelho@intel.com>
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
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
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 1d608e9e9101..a837cf40afde 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -880,6 +880,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;
@@ -909,6 +920,9 @@ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
.data = { data },
};
+ 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);
@@ -934,13 +948,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.20.1
next prev parent reply other threads:[~2019-07-20 10:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-20 10:25 [PATCH 00/16] iwlwifi: fixes intended for 5.3 2019-07-20 Luca Coelho
2019-07-20 10:25 ` Luca Coelho [this message]
[not found] ` <20190720122332.E229E2186A@mail.kernel.org>
2019-08-05 9:45 ` [PATCH 01/16] iwlwifi: mvm: don't send GEO_TX_POWER_LIMIT on version < 41 Luca Coelho
2019-07-20 10:25 ` [PATCH 02/16] iwlwifi: mvm: prepare the ground for more RSS notifications Luca Coelho
2019-07-20 10:25 ` [PATCH 03/16] iwlwifi: mvm: add a new RSS sync notification for NSSN sync Luca Coelho
2019-07-20 10:25 ` [PATCH 04/16] iwlwiif: mvm: refactor iwl_mvm_notify_rx_queue Luca Coelho
2019-07-20 10:25 ` [PATCH 05/16] iwlwifi: mvm: add a loose synchronization of the NSSN across Rx queues Luca Coelho
2019-07-20 10:25 ` [PATCH 06/16] iwlwifi: mvm: add a wrapper around rs_tx_status to handle locks Luca Coelho
2019-07-20 10:25 ` [PATCH 07/16] iwlwifi: dbg_ini: move iwl_dbg_tlv_load_bin out of debug override ifdef Luca Coelho
2019-07-20 10:25 ` [PATCH 08/16] iwlwifi: dbg_ini: move iwl_dbg_tlv_free outside of debugfs ifdef Luca Coelho
2019-07-20 10:25 ` [PATCH 09/16] iwlwifi: fix locking in delayed GTK setting Luca Coelho
2019-07-20 10:25 ` [PATCH 10/16] iwlwifi: mvm: fix comparison of u32 variable with less than zero Luca Coelho
2019-07-20 10:25 ` [PATCH 11/16] iwlwifi: mvm: send LQ command always ASYNC Luca Coelho
2019-07-20 10:25 ` [PATCH 12/16] iwlwifi: mvm: replace RS mutex with a spin_lock Luca Coelho
2019-07-20 10:25 ` [PATCH 13/16] iwlwifi: mvm: fix frame drop from the reordering buffer Luca Coelho
2019-07-20 10:25 ` [PATCH 14/16] iwlwifi: mvm: fix possible out-of-bounds read when accessing lq_info Luca Coelho
2019-07-20 10:25 ` [PATCH 15/16] iwlwifi: add 3 new IDs for the 9000 series (iwl9260_2ac_160_cfg) Luca Coelho
2019-07-20 10:25 ` [PATCH 16/16] iwlwifi: mvm: fix version check for GEO_TX_POWER_LIMIT support Luca Coelho
2019-08-01 14:07 ` Jonas Hahnfeld
2019-08-22 6:44 ` Luca Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190720102545.5952-2-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox