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 06/12] iwlwifi: mvm: send stored PPAG command instead of local
Date: Wed, 10 Feb 2021 13:56:31 +0200	[thread overview]
Message-ID: <iwlwifi.20210210135352.d090e0301023.I7d57f4d7da9a3297734c51cf988199323c76916d@changeid> (raw)
In-Reply-To: <20210210115637.276676-1-luca@coelho.fi>

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

Some change conflicts apparently cause a confusion between a local
variable being used to send the PPAG command and the introduction of a
union for this command.  Most parts of the local command were never
copied from the stored data, so the FW was getting garbage in the
tables instead of getting valid values.

Fix this by completely removing the local and using only the union
that we have stored in fwrt.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Fixes: f2134f66f40e ("iwlwifi: acpi: support ppag table command v2")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 57471ab2f5ef..8675a78ff9e9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -993,7 +993,6 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 {
 	u8 cmd_ver;
 	int i, j, ret, num_sub_bands, cmd_size;
-	union iwl_ppag_table_cmd ppag_table;
 	s8 *gain;
 
 	if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_PPAG)) {
@@ -1006,15 +1005,13 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 		return 0;
 	}
 
-	ppag_table.v1.enabled = mvm->fwrt.ppag_table.v1.enabled;
-
 	cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, PHY_OPS_GROUP,
 					PER_PLATFORM_ANT_GAIN_CMD,
 					IWL_FW_CMD_VER_UNKNOWN);
 	if (cmd_ver == 1) {
 		num_sub_bands = IWL_NUM_SUB_BANDS;
 		gain = mvm->fwrt.ppag_table.v1.gain[0];
-		cmd_size = sizeof(ppag_table.v1);
+		cmd_size = sizeof(mvm->fwrt.ppag_table.v1);
 		if (mvm->fwrt.ppag_ver == 2) {
 			IWL_DEBUG_RADIO(mvm,
 					"PPAG table is v2 but FW supports v1, sending truncated table\n");
@@ -1022,7 +1019,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 	} else if (cmd_ver == 2) {
 		num_sub_bands = IWL_NUM_SUB_BANDS_V2;
 		gain = mvm->fwrt.ppag_table.v2.gain[0];
-		cmd_size = sizeof(ppag_table.v2);
+		cmd_size = sizeof(mvm->fwrt.ppag_table.v2);
 		if (mvm->fwrt.ppag_ver == 1) {
 			IWL_DEBUG_RADIO(mvm,
 					"PPAG table is v1 but FW supports v2, sending padded table\n");
@@ -1042,7 +1039,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
 	IWL_DEBUG_RADIO(mvm, "Sending PER_PLATFORM_ANT_GAIN_CMD\n");
 	ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,
 						PER_PLATFORM_ANT_GAIN_CMD),
-				   0, cmd_size, &ppag_table);
+				   0, cmd_size, &mvm->fwrt.ppag_table);
 	if (ret < 0)
 		IWL_ERR(mvm, "failed to send PER_PLATFORM_ANT_GAIN_CMD (%d)\n",
 			ret);
-- 
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 ` Luca Coelho [this message]
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 ` [PATCH v2 09/12] iwlwifi: mvm: assign SAR table revision to the command later Luca Coelho
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.d090e0301023.I7d57f4d7da9a3297734c51cf988199323c76916d@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.