[PATCH mt76] wifi: mt76: mt7915: configure noise floor reporting on reset
Felix Fietkau
nbd at nbd.name
Mon Jun 1 05:09:12 PDT 2026
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 at 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
More information about the linux-arm-kernel
mailing list