[PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"

Bartosz Golaszewski posted 1 patch 2 months, 2 weeks ago
.../net/wireless/intel/iwlwifi/fw/api/power.h | 48 +++++++++++++++++++
drivers/net/wireless/intel/iwlwifi/mvm/fw.c   | 14 ++++--
.../net/wireless/intel/iwlwifi/mvm/mac80211.c |  4 ++
3 files changed, 62 insertions(+), 4 deletions(-)
[PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Bartosz Golaszewski 2 months, 2 weeks ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

This reverts commit e3fd06d1d8869747e02a022e3c9045a3187f3aa5 as it broke
wifi on my Thinkpad P1 (Intel AX210) in v6.17. I don't have a better idea
than reverting as - contrary to what the commit message claims - this
chip seems to still be using the commands removed by this commit.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 .../net/wireless/intel/iwlwifi/fw/api/power.h | 48 +++++++++++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c   | 14 ++++--
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c |  4 ++
 3 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
index 535864e22626..d2db59615fc6 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
@@ -328,6 +328,50 @@ struct iwl_dev_tx_power_cmd_v5 {
 	__le32 timer_period;
 } __packed; /* TX_REDUCED_POWER_API_S_VER_5 */
 
+/**
+ * struct iwl_dev_tx_power_cmd_v6 - TX power reduction command version 6
+ * @per_chain: per chain restrictions
+ * @enable_ack_reduction: enable or disable close range ack TX power
+ *	reduction.
+ * @per_chain_restriction_changed: is per_chain_restriction has changed
+ *	from last command. used if set_mode is
+ *	IWL_TX_POWER_MODE_SET_SAR_TIMER.
+ *	note: if not changed, the command is used for keep alive only.
+ * @reserved: reserved (padding)
+ * @timer_period: timer in milliseconds. if expires FW will change to default
+ *	BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER
+ */
+struct iwl_dev_tx_power_cmd_v6 {
+	__le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];
+	u8 enable_ack_reduction;
+	u8 per_chain_restriction_changed;
+	u8 reserved[2];
+	__le32 timer_period;
+} __packed; /* TX_REDUCED_POWER_API_S_VER_6 */
+
+/**
+ * struct iwl_dev_tx_power_cmd_v7 - TX power reduction command version 7
+ * @per_chain: per chain restrictions
+ * @enable_ack_reduction: enable or disable close range ack TX power
+ *	reduction.
+ * @per_chain_restriction_changed: is per_chain_restriction has changed
+ *	from last command. used if set_mode is
+ *	IWL_TX_POWER_MODE_SET_SAR_TIMER.
+ *	note: if not changed, the command is used for keep alive only.
+ * @reserved: reserved (padding)
+ * @timer_period: timer in milliseconds. if expires FW will change to default
+ *	BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER
+ * @flags: reduce power flags.
+ */
+struct iwl_dev_tx_power_cmd_v7 {
+	__le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];
+	u8 enable_ack_reduction;
+	u8 per_chain_restriction_changed;
+	u8 reserved[2];
+	__le32 timer_period;
+	__le32 flags;
+} __packed; /* TX_REDUCED_POWER_API_S_VER_7 */
+
 /**
  * struct iwl_dev_tx_power_cmd_v8 - TX power reduction command version 8
  * @per_chain: per chain restrictions
@@ -372,6 +416,8 @@ struct iwl_dev_tx_power_cmd_per_band {
  * @v3: version 3 part of the command
  * @v4: version 4 part of the command
  * @v5: version 5 part of the command
+ * @v6: version 6 part of the command
+ * @v7: version 7 part of the command
  * @v8: version 8 part of the command
  */
 struct iwl_dev_tx_power_cmd_v3_v8 {
@@ -381,6 +427,8 @@ struct iwl_dev_tx_power_cmd_v3_v8 {
 		struct iwl_dev_tx_power_cmd_v3 v3;
 		struct iwl_dev_tx_power_cmd_v4 v4;
 		struct iwl_dev_tx_power_cmd_v5 v5;
+		struct iwl_dev_tx_power_cmd_v6 v6;
+		struct iwl_dev_tx_power_cmd_v7 v7;
 		struct iwl_dev_tx_power_cmd_v8 v8;
 	};
 };
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 6b76ce35443d..c64c599b1d78 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -870,11 +870,17 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
 		len = sizeof(cmd_v9_v10.v9);
 		n_subbands = IWL_NUM_SUB_BANDS_V1;
 		per_chain = &cmd_v9_v10.v9.per_chain[0][0];
-	} else if (cmd_ver == 8) {
-		len = sizeof(cmd.v8);
+	} else if (cmd_ver >= 7) {
+		len = sizeof(cmd.v7);
 		n_subbands = IWL_NUM_SUB_BANDS_V2;
-		per_chain = cmd.v8.per_chain[0][0];
-		cmd.v8.flags = cpu_to_le32(mvm->fwrt.reduced_power_flags);
+		per_chain = cmd.v7.per_chain[0][0];
+		cmd.v7.flags = cpu_to_le32(mvm->fwrt.reduced_power_flags);
+		if (cmd_ver == 8)
+			len = sizeof(cmd.v8);
+	} else if (cmd_ver == 6) {
+		len = sizeof(cmd.v6);
+		n_subbands = IWL_NUM_SUB_BANDS_V2;
+		per_chain = cmd.v6.per_chain[0][0];
 	} else if (fw_has_api(&mvm->fw->ucode_capa,
 			      IWL_UCODE_TLV_API_REDUCE_TX_POWER)) {
 		len = sizeof(cmd.v5);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 44029ceb8f77..8274437b78be 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1517,6 +1517,10 @@ int iwl_mvm_set_tx_power(struct iwl_mvm *mvm,
 		len = sizeof(cmd_v9_v10.v9);
 	else if (cmd_ver == 8)
 		len = sizeof(cmd.v8);
+	else if (cmd_ver == 7)
+		len = sizeof(cmd.v7);
+	else if (cmd_ver == 6)
+		len = sizeof(cmd.v6);
 	else if (fw_has_api(&mvm->fw->ucode_capa,
 			    IWL_UCODE_TLV_API_REDUCE_TX_POWER))
 		len = sizeof(cmd.v5);
-- 
2.48.1
Re: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Bartosz Golaszewski 2 months, 2 weeks ago
On Sat, Oct 4, 2025 at 4:15 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> This reverts commit e3fd06d1d8869747e02a022e3c9045a3187f3aa5 as it broke
> wifi on my Thinkpad P1 (Intel AX210) in v6.17. I don't have a better idea
> than reverting as - contrary to what the commit message claims - this
> chip seems to still be using the commands removed by this commit.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---

And here's the kernel log: https://pastebin.com/zrTPbE0j

Bartosz
RE: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Korenblit, Miriam Rachel 2 months, 1 week ago

> -----Original Message-----
> From: Bartosz Golaszewski <brgl@bgdev.pl>
> Sent: Saturday, October 4, 2025 5:19 PM
> To: Korenblit, Miriam Rachel <miriam.rachel.korenblit@intel.com>; Berg,
> Johannes <johannes.berg@intel.com>; Anjaneyulu, Pagadala Yesu
> <pagadala.yesu.anjaneyulu@intel.com>; Grumbach, Emmanuel
> <emmanuel.grumbach@intel.com>; Bhaskar Chowdhury
> <unixbhaskar@gmail.com>; Bartosz Golaszewski
> <bartosz.golaszewski@linaro.org>; Peer, Ilan <ilan.peer@intel.com>; Gabay,
> Daniel <daniel.gabay@intel.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for
> REDUCE_TX_POWER_CMD ver 6 and 7"
> 
> On Sat, Oct 4, 2025 at 4:15 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > This reverts commit e3fd06d1d8869747e02a022e3c9045a3187f3aa5 as it
> > broke wifi on my Thinkpad P1 (Intel AX210) in v6.17. I don't have a
> > better idea than reverting as - contrary to what the commit message
> > claims - this chip seems to still be using the commands removed by this
> commit.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> 
> And here's the kernel log: https://pastebin.com/zrTPbE0j
> 
> Bartosz

Hi

I think you reverted the wrong commit?
Didn’t you mean
e3fd06d1d886 ("wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7")
?

Anyway, for fixing this issue, can I ask you to upgrade your FW? Then you should not see this error anymore.

Miri
Re: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Bartosz Golaszewski 2 months, 1 week ago
On Sat, Oct 4, 2025 at 11:00 PM Korenblit, Miriam Rachel
<miriam.rachel.korenblit@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Bartosz Golaszewski <brgl@bgdev.pl>
> > Sent: Saturday, October 4, 2025 5:19 PM
> > To: Korenblit, Miriam Rachel <miriam.rachel.korenblit@intel.com>; Berg,
> > Johannes <johannes.berg@intel.com>; Anjaneyulu, Pagadala Yesu
> > <pagadala.yesu.anjaneyulu@intel.com>; Grumbach, Emmanuel
> > <emmanuel.grumbach@intel.com>; Bhaskar Chowdhury
> > <unixbhaskar@gmail.com>; Bartosz Golaszewski
> > <bartosz.golaszewski@linaro.org>; Peer, Ilan <ilan.peer@intel.com>; Gabay,
> > Daniel <daniel.gabay@intel.com>
> > Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for
> > REDUCE_TX_POWER_CMD ver 6 and 7"
> >
> > On Sat, Oct 4, 2025 at 4:15 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > >
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > This reverts commit e3fd06d1d8869747e02a022e3c9045a3187f3aa5 as it
> > > broke wifi on my Thinkpad P1 (Intel AX210) in v6.17. I don't have a
> > > better idea than reverting as - contrary to what the commit message
> > > claims - this chip seems to still be using the commands removed by this
> > commit.
> > >
> > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > ---
> >
> > And here's the kernel log: https://pastebin.com/zrTPbE0j
> >
> > Bartosz
>
> Hi
>
> I think you reverted the wrong commit?
> Didn’t you mean
> e3fd06d1d886 ("wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7")
> ?
>

This is the same commit though, right? Am I missing something?

> Anyway, for fixing this issue, can I ask you to upgrade your FW? Then you should not see this error anymore.
>

To what? I'm already at iwlwifi-ty-a0-gf-a0-89 which seems to be the
most recent firmware for this card.

Bartosz
RE: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Korenblit, Miriam Rachel 2 months, 1 week ago
> 
> To what? I'm already at iwlwifi-ty-a0-gf-a0-89 which seems to be the most recent
> firmware for this card.
> 
See https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=70fce2e71a3cbbf50cc57694b94dcb27eb9111f5
This is the latest update of the FW of your chip.

Miri

Re: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Bartosz Golaszewski 2 months, 1 week ago
On Sun, 5 Oct 2025 12:04:51 +0200, "Korenblit, Miriam Rachel"
<miriam.rachel.korenblit@intel.com> said:
>>
>> To what? I'm already at iwlwifi-ty-a0-gf-a0-89 which seems to be the most recent
>> firmware for this card.
>>
> See https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=70fce2e71a3cbbf50cc57694b94dcb27eb9111f5
> This is the latest update of the FW of your chip.
>
> Miri
>
>

$ md5sum /lib/firmware/iwlwifi-ty-a0-gf-a0-89.ucode
dd86d097615ee98b64d1b78b73697a6a  /lib/firmware/iwlwifi-ty-a0-gf-a0-89.ucode
$ md5sum linux-firmware/intel/iwlwifi/iwlwifi-ty-a0-gf-a0-89.ucode
ae03ce5298a2280e3a22db16fbffb5db
linux-firmware/intel/iwlwifi/iwlwifi-ty-a0-gf-a0-89.ucode

So the 89 at the end of the filename is not the version of the firmware?
No the full version anyway? I wasn't aware of this. Where is the version
information encoded other than the linux-firmware git log?

Bart
RE: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Korenblit, Miriam Rachel 2 months, 1 week ago
> So the 89 at the end of the filename is not the version of the firmware?
It is. But not for "frozen devices" - like yours.
In such devices, the API number (89 in your case) doesn't increase anymore,
but we still update the FW from time to time.

> No the full version anyway? I wasn't aware of this. Where is the version
> information encoded other than the linux-firmware git log?

You can see the SHA-1 of the FW in the dmesg. For example, in the log you sent:
Loaded firmware version: 89.e9cec78e.0 ty-a0-gf-a0-89.ucode
The SHA-1 is e9cec78e.

Miri

Re: [PATCH] Revert "wifi: iwlwifi: mvm: remove support for REDUCE_TX_POWER_CMD ver 6 and 7"
Posted by Bartosz Golaszewski 2 months, 1 week ago
On Sun, Oct 5, 2025 at 3:36 PM Korenblit, Miriam Rachel
<miriam.rachel.korenblit@intel.com> wrote:
>
> > So the 89 at the end of the filename is not the version of the firmware?
> It is. But not for "frozen devices" - like yours.
> In such devices, the API number (89 in your case) doesn't increase anymore,
> but we still update the FW from time to time.
>
> > No the full version anyway? I wasn't aware of this. Where is the version
> > information encoded other than the linux-firmware git log?
>
> You can see the SHA-1 of the FW in the dmesg. For example, in the log you sent:
> Loaded firmware version: 89.e9cec78e.0 ty-a0-gf-a0-89.ucode
> The SHA-1 is e9cec78e.
>

Ok, got it. Will keep it in mind in the future.

Bart