Linux wireless drivers development
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH mt76-next 08/18] wifi: mt76: mt7996: wait for the answer of each state command
Date: Wed, 25 Nov 2026 18:36:06 +0100	[thread overview]
Message-ID: <20261125173616.3776951-8-nbd@nbd.name> (raw)
In-Reply-To: <20261125173616.3776951-1-nbd@nbd.name>

An L1 SER can drop a state command that sits in the MCU ring without a
wait. The firmware sends no answer then, so the driver keeps a state
that the firmware does not have. The driver does not send the command
again. These commands are sent without a wait:

  - the stop of the background chain.
  - the thermal duty levels and protection.
  - the SKU power limit and the Beacon rate entry.

Wait for the answer of these commands. A lost answer then requests a
full reset, as for any other state command. The firmware answers each
of them.

A firmware error status now reaches the callers:

  - mt7996_run() disables the radio, as for its other commands.
  - the radar background op returns it before it records the chain.
  - the hwmon and cooling device writes keep their old state.
  - the rate table callers ignore it.

The firmware refuses a field out of range, which the driver does not
send, and an enable of a thermal protection that is already enabled.
The driver disables the protection before it enables it, under
dev->mt76.mutex.

Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Fixes: 21f290884bc1 ("wifi: mt76: connac: add thermal protection support for mt7996")
Fixes: 254ab81f3b82 ("wifi: mt76: connac: add beacon duplicate TX mode support for mt7996")
Fixes: 267424ac63aa ("wifi: mt76: mt7996: enable the SKU power limit table")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 671bbb741a46..c3a41935967e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -4367,7 +4367,7 @@ mt7996_mcu_background_chain_ctrl(struct mt7996_phy *phy,
 	req.band = chandef ? chandef->chan->band == NL80211_BAND_5GHZ : 1;
 
 	return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(OFFCH_SCAN_CTRL),
-				 &req, sizeof(req), false);
+				 &req, sizeof(req), true);
 }
 
 int mt7996_mcu_rdd_background_enable(struct mt7996_phy *phy,
@@ -5073,7 +5073,7 @@ int mt7996_mcu_set_thermal_throttling(struct mt7996_phy *phy, u8 state)
 		state /= 2;
 
 		ret = mt76_mcu_send_msg(&phy->dev->mt76, MCU_WM_UNI_CMD(THERMAL),
-					&req, sizeof(req), false);
+					&req, sizeof(req), true);
 		if (ret)
 			return ret;
 	}
@@ -5105,7 +5105,7 @@ int mt7996_mcu_set_thermal_protect(struct mt7996_phy *phy, bool enable)
 	req.tag = cpu_to_le16(UNI_CMD_THERMAL_PROTECT_DISABLE);
 
 	ret = mt76_mcu_send_msg(&phy->dev->mt76, MCU_WM_UNI_CMD(THERMAL),
-				&req, sizeof(req) - sizeof(req.enable), false);
+				&req, sizeof(req) - sizeof(req.enable), true);
 	if (ret || !enable)
 		return ret;
 
@@ -5118,7 +5118,7 @@ int mt7996_mcu_set_thermal_protect(struct mt7996_phy *phy, bool enable)
 	req.len = cpu_to_le16(sizeof(req) - 4);
 
 	return mt76_mcu_send_msg(&phy->dev->mt76, MCU_WM_UNI_CMD(THERMAL),
-				 &req, sizeof(req), false);
+				 &req, sizeof(req), true);
 }
 
 int mt7996_mcu_set_ser(struct mt7996_dev *dev, u8 action, u8 val, u8 band)
@@ -5683,7 +5683,7 @@ int mt7996_mcu_set_fixed_rate_table(struct mt7996_phy *phy, u8 table_idx,
 	}
 
 	return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(FIXED_RATE_TABLE),
-				 &req, sizeof(req), false);
+				 &req, sizeof(req), true);
 }
 
 int mt7996_mcu_rf_regval(struct mt7996_dev *dev, u32 regidx, u32 *val, bool set)
@@ -5892,7 +5892,7 @@ int mt7996_mcu_set_tx_power_ctrl(struct mt7996_phy *phy, u8 power_ctrl_id, u8 da
 	}
 
 	return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(TXPOWER),
-				 &req, sizeof(req), false);
+				 &req, sizeof(req), true);
 }
 
 int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy)
-- 
2.47.3


  parent reply	other threads:[~2026-11-25 17:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 17:35 [PATCH mt76-next 01/18] wifi: mt76: mt7925: keep the RX PN state of a station across a rekey Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 02/18] wifi: mt76: mt7915: hold the rate update of a station in power save Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 03/18] wifi: mt76: mt7996: take the phy of a fixed rate from the station link Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 04/18] wifi: mt76: mt7915: keep the BF column count within the row count Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 05/18] wifi: mt76: mt7996: report the tx power of the requested link Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 06/18] wifi: mt76: mt7996: refuse an RF register offset above 12 bits Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 07/18] wifi: mt76: mt7996: hold the mutex across the thermal protection store Felix Fietkau
2026-11-25 17:36 ` Felix Fietkau [this message]
2026-11-25 17:36 ` [PATCH mt76-next 09/18] wifi: mt76: mt7915: wait for the answer of the background chain control Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 10/18] wifi: mt76: mt7996: bound the in-band discovery frame by its buffer Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 11/18] wifi: mt76: mt7915: reset on an MCU timeout only once the hw is registered Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 12/18] wifi: mt76: mt7996: " Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 13/18] wifi: mt76: mt7915: mask the LDPC bits of STA_REC_HT and STA_REC_VHT Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 14/18] wifi: mt76: mt7996: mask the LDPC bits of STA_REC_HT, _VHT and _HE_V2 Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 15/18] wifi: mt76: mt7996: send HE_BASIC for each HE link of an MLD Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 16/18] wifi: mt76: restore the operating channel after a failed ROC start Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 17/18] wifi: mt76: mt7996: set the duplicate WTBL range again after a reset Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 18/18] wifi: mt76: mt7996: keep station wcids out of the duplicate WTBL range Felix Fietkau

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=20261125173616.3776951-8-nbd@nbd.name \
    --to=nbd@nbd.name \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox