Repository navigation
wifi: mt7932: skip a country-package pass that a newer request superseded - #205
Merged
Merged
Conversation
…eded The startup work applies the country package to cfg80211's channel list before it checks whether the request it is serving is still current. If the country changes again while the work is loading the first package, cfg80211 has already recomputed the channel flags for the second country, and the stale pass then disables the first country's forbidden channels on top of them. The next pass adds the second country's own disables, so the union of both stays in place until the following regulatory change. The result is only ever more restrictive than intended, and the boot sequence cannot hit it because the world package forbids nothing, but a user who changes country twice in quick succession loses channels that the final country permits. The regulatory notifier runs under RTNL and starts a new generation there, after cfg80211 has recomputed the flags. Check the generation under RTNL in mt_policy_disable() and leave the channel list alone when it has moved on; the newer generation runs its own pass. Fixes: 6e3838e ("wifi: mt7932: honour the channel permissions of the country package") Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A follow-up to #204 from its post-merge review. One commit.
What
mt_policy_disable()now checks, under RTNL, that the regulatory generation it was started for is still current. If a newer request has arrived, it leaves cfg80211's channel list alone and lets the newer pass apply its own country package.Why
The startup work applied the country package's channel disables before it checked whether its request was still current:
The result is only ever more restrictive than intended, so it is not a compliance problem. The boot sequence (world, then the configured country) cannot hit it, because the world package forbids nothing. But a user who changes country twice in quick succession loses channels the final country permits.
The regulatory notifier runs under RTNL, after cfg80211's recompute, and starts the new generation there, so a check under RTNL is stable against it. The generation also advances when a retired scan completes while a regulatory update is pending. That case re-runs the same request, so skipping only moves the same disables to the next pass, which applies them before anything is published.
Not changed: the notifier's no-change early return still compares the snapshot taken before the package filter. The review found no path on the J700 that reaches it; it is left for a separate change.
Fixes: 6e3838e91a3b ("wifi: mt7932: honour the channel permissions of the country package")Testing
Hardware-tested on the MacBook Neo (J700), kernel
7.1.12-aurora-j700-fu1+(all seven follow-ups merged ontoaurora-wip35c7d87), compared item for item with the default kernel built from that base: a country change AU→US→AU applied the US then the AU country package in order, the 5 GHz link to the access point held throughout, and 20/20 gateway pings followed; no driver warnings. The superseded-request race itself (two country changes in quick succession) is covered by review only. No effect on the M1/M2 configuration (the driver is not built there).arch/arm64/configs/j700-radio.config;defconfig+asahi.configwith every Apple Silicon driver as a module (16K pages, Rust).aurora-wip(35c7d87921c0).Assisted-by: LLMtrailer-format warning.aurora-wipand with the other follow-up branches.Provenance
Written for this PR from the public driver source and the review finding.
🤖 Generated with Claude Code