* [PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset
@ 2026-05-16 14:49 David Bauer
2026-05-27 13:56 ` Felix Fietkau
0 siblings, 1 reply; 4+ messages in thread
From: David Bauer @ 2026-05-16 14:49 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
When performing a full system recovery of the MCU on a dual-phy
platform, band 0 (usually 2.4GHz) stops reading correct noise floor
data.
This is due to noise floor reporting only being configured correctly
for the second device PHY.
Configure the respective registers correctly after restarting the MCU
firmware to fix reported noise-floor values.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
drivers/net/wireless/mediatek/mt76/mt7915/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index e1d83052aa6dd..b42c26d0d09a4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -25,11 +25,13 @@ int mt7915_run(struct ieee80211_hw *hw)
struct mt7915_dev *dev = mt7915_hw_dev(hw);
struct mt7915_phy *phy = mt7915_hw_phy(hw);
bool running;
+ bool reset;
int ret;
running = mt7915_dev_running(dev);
+ reset = test_bit(MT76_RESET, &phy->mt76->state);
- if (!running) {
+ if (!running || (reset && phy == &dev->phy)) {
ret = mt76_connac_mcu_set_pm(&dev->mt76,
dev->phy.mt76->band_idx, 0);
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset
2026-05-16 14:49 [PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset David Bauer
@ 2026-05-27 13:56 ` Felix Fietkau
2026-05-27 17:05 ` David Bauer
0 siblings, 1 reply; 4+ messages in thread
From: Felix Fietkau @ 2026-05-27 13:56 UTC (permalink / raw)
To: David Bauer, Lorenzo Bianconi, Ryder Lee, Shayne Chen, Sean Wang,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
On 16.05.26 16:49, David Bauer wrote:
> When performing a full system recovery of the MCU on a dual-phy
> platform, band 0 (usually 2.4GHz) stops reading correct noise floor
> data.
>
> This is due to noise floor reporting only being configured correctly
> for the second device PHY.
>
> Configure the respective registers correctly after restarting the MCU
> firmware to fix reported noise-floor values.
>
> Signed-off-by: David Bauer <mail@david-bauer.net>
Have you considered clearing MT76_STATE_RUNNING in mt7915_mac_restart
instead?
- Felix
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset
2026-05-27 13:56 ` Felix Fietkau
@ 2026-05-27 17:05 ` David Bauer
2026-06-01 12:09 ` Felix Fietkau
0 siblings, 1 reply; 4+ messages in thread
From: David Bauer @ 2026-05-27 17:05 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
Hi Felix,
On 5/27/26 15:56, Felix Fietkau wrote:
> On 16.05.26 16:49, David Bauer wrote:
>> When performing a full system recovery of the MCU on a dual-phy
>> platform, band 0 (usually 2.4GHz) stops reading correct noise floor
>> data.
>>
>> This is due to noise floor reporting only being configured correctly
>> for the second device PHY.
>>
>> Configure the respective registers correctly after restarting the MCU
>> firmware to fix reported noise-floor values.
>>
>> Signed-off-by: David Bauer <mail@david-bauer.net>
> Have you considered clearing MT76_STATE_RUNNING in mt7915_mac_restart instead?
The call to mt7915_run is guarded by MT76_STATE_RUNNING being set per-phy.
I think this is to not start the second PHY in case it was never started due to
it not being present. We could in theory remove this check for the primary PHY
and clear the flag prior calling mt7915_run.
This seems a bit more hacky to me. Alternatively I can also refactor the entire
mechanism to make it easier to understand and resolve this indirection in the
process.
What do you think?
Best
David
>
> - Felix
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset
2026-05-27 17:05 ` David Bauer
@ 2026-06-01 12:09 ` Felix Fietkau
0 siblings, 0 replies; 4+ messages in thread
From: Felix Fietkau @ 2026-06-01 12:09 UTC (permalink / raw)
To: David Bauer, Lorenzo Bianconi, Ryder Lee, Shayne Chen, Sean Wang,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
On 27.05.26 19:05, David Bauer wrote:
> Hi Felix,
>
> On 5/27/26 15:56, Felix Fietkau wrote:
>> On 16.05.26 16:49, David Bauer wrote:
>>> When performing a full system recovery of the MCU on a dual-phy
>>> platform, band 0 (usually 2.4GHz) stops reading correct noise floor
>>> data.
>>>
>>> This is due to noise floor reporting only being configured correctly
>>> for the second device PHY.
>>>
>>> Configure the respective registers correctly after restarting the MCU
>>> firmware to fix reported noise-floor values.
>>>
>>> Signed-off-by: David Bauer <mail@david-bauer.net>
>> Have you considered clearing MT76_STATE_RUNNING in mt7915_mac_restart instead?
>
> The call to mt7915_run is guarded by MT76_STATE_RUNNING being set per-phy.
>
> I think this is to not start the second PHY in case it was never started due to
> it not being present. We could in theory remove this check for the primary PHY
> and clear the flag prior calling mt7915_run.
>
> This seems a bit more hacky to me. Alternatively I can also refactor the entire
> mechanism to make it easier to understand and resolve this indirection in the
> process.
My suggestion would be to do this:
start_main = test_and_clear_bit(MT76_STATE_RUNNING, &dev->mphy.state);
start_ext = ext_phy &&
test_and_clear_bit(MT76_STATE_RUNNING, &ext_phy->state);
Then using those as conditions for calling mt7915_run in
mt7915_mac_restart.
That way the special case in mt7915_run disappears and the behavior
becomes easier to follow.
- Felix
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-01 12:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-16 14:49 [PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset David Bauer
2026-05-27 13:56 ` Felix Fietkau
2026-05-27 17:05 ` David Bauer
2026-06-01 12:09 ` Felix Fietkau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox