All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v2 09/12] iwlwifi: mvm: assign SAR table revision to the command later
Date: Wed, 10 Feb 2021 13:56:34 +0200	[thread overview]
Message-ID: <iwlwifi.20210210135352.cef55ef3a065.If96c60f08d24c2262c287168a6f0dbd7cf0f8f5c@changeid> (raw)
In-Reply-To: <20210210115637.276676-1-luca@coelho.fi>

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

The call to iwl_sar_geo_init() was moved to the end of the
iwl_mvm_sar_geo_init() function, after the table revision is assigned
to the FW command.  But the revision is only known after
iwl_sar_geo_init() is called, so we were always assigning zero to it.

Fix that by moving the assignment code after the iwl_sar_geo_init()
function is called.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Fixes: 45acebf8d6a6 ("iwlwifi: fix sar geo table initialization")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 8675a78ff9e9..76c460852398 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -862,12 +862,10 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
 	if (cmd_ver == 3) {
 		len = sizeof(cmd.v3);
 		n_bands = ARRAY_SIZE(cmd.v3.table[0]);
-		cmd.v3.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
 	} else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
 			      IWL_UCODE_TLV_API_SAR_TABLE_VER)) {
 		len = sizeof(cmd.v2);
 		n_bands = ARRAY_SIZE(cmd.v2.table[0]);
-		cmd.v2.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
 	} else {
 		len = sizeof(cmd.v1);
 		n_bands = ARRAY_SIZE(cmd.v1.table[0]);
@@ -887,6 +885,16 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm)
 	if (ret)
 		return 0;
 
+	/*
+	 * Set the revision on versions that contain it.
+	 * This must be done after calling iwl_sar_geo_init().
+	 */
+	if (cmd_ver == 3)
+		cmd.v3.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
+	else if (fw_has_api(&mvm->fwrt.fw->ucode_capa,
+			    IWL_UCODE_TLV_API_SAR_TABLE_VER))
+		cmd.v2.table_revision = cpu_to_le32(mvm->fwrt.geo_rev);
+
 	return iwl_mvm_send_cmd_pdu(mvm,
 				    WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT),
 				    0, len, &cmd);
-- 
2.30.0


  parent reply	other threads:[~2021-02-10 12:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 11:56 [PATCH v2 00/12] iwlwifi: updates intended for v5.12 2021-02-07 Luca Coelho
2021-02-10 11:56 ` [PATCH v2 01/12] iwlwifi: pcie: add a few missing entries for So with Hr Luca Coelho
2021-02-10 12:38   ` Luca Coelho
2021-02-10 11:56 ` [PATCH v2 02/12] iwlwifi: pcie: don't disable interrupts for reg_lock Luca Coelho
2021-02-10 11:56 ` [PATCH v2 03/12] iwlwifi: acpi: fix PPAG table sizes Luca Coelho
2021-02-10 11:56 ` [PATCH v2 04/12] iwlwifi: mvm: fix the type we use in the PPAG table validity checks Luca Coelho
2021-02-10 11:56 ` [PATCH v2 05/12] iwlwifi: mvm: store PPAG enabled/disabled flag properly Luca Coelho
2021-09-07 11:30   ` Kai-Heng Feng
2021-09-07 12:07     ` Luca Coelho
2021-02-10 11:56 ` [PATCH v2 06/12] iwlwifi: mvm: send stored PPAG command instead of local Luca Coelho
2021-02-10 11:56 ` [PATCH v2 07/12] iwlwifi: mvm: enhance a print in CSA flows Luca Coelho
2021-02-10 11:56 ` [PATCH v2 08/12] iwlwifi: mvm: remove useless iwl_mvm_resume_d3() function Luca Coelho
2021-02-10 11:56 ` Luca Coelho [this message]
2021-02-10 11:56 ` [PATCH v2 10/12] iwlwifi: pcie: NULLify pointers after free Luca Coelho
2021-02-10 11:56 ` [PATCH v2 11/12] iwlwifi: when HW has rate offload don't look at control field Luca Coelho
2021-02-10 11:56 ` [PATCH v2 12/12] iwlwifi: pcie: Change Ma device ID 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=iwlwifi.20210210135352.cef55ef3a065.If96c60f08d24c2262c287168a6f0dbd7cf0f8f5c@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.