Repository navigation
wifi: mt7932: keep the country package's channel disables - #228
Merged
Merged
Conversation
The channels a country package leaves out of the firmware domain are disabled only in cfg80211's channel flags, once per package pass. cfg80211 rebuilds those flags from the original ones on every regulatory update it applies, and then calls the notifier. The notifier skips an update whose snapshot matches the request already applied, so if an update ever leaves the snapshot unchanged, no pass runs and the disables are gone: the driver again offers channels its firmware domain excludes, where scans and joins fail. Do not depend on every such update producing a new snapshot. Record the channels each package pass disables and apply them again when the notifier finds the package still current. A new request clears the set; its own pass records a new one. 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.
wifi: mt7932: keep the country package's channel disables
From Sashiko review of #204 (the remaining path of its regulatory finding; #205 fixed the other).
The channels a country package leaves out of the firmware domain are disabled only in cfg80211's
channel flags, once per package pass. cfg80211 rebuilds those flags from the original ones on every
regulatory update it applies, and then calls the driver's notifier. The notifier skips an update
whose snapshot matches the request already applied. If an update ever leaves the snapshot unchanged,
no package pass runs and the disables are gone: mt7932 again offers channels its firmware domain
excludes, and scans and joins there fail.
Review suggested a second wireless device hinting the user's country as a trigger. On the Neo,
cfg80211 does not re-apply an unchanged country for such a hint (see Testing), so no trigger has been
reproduced; this change is defensive.
The driver now records the channels each package pass disables and applies them again when the
notifier finds the package still current. A new request clears the set, and its own pass records a
new one. The channel lookup the two loops repeated is now a small helper.
Fixes: 6e3838e91a3b ("wifi: mt7932: honour the channel permissions of the country package")Testing
4f3a64e7baa9with all six review-fix branches merged (J700 configuration, plusMAC80211_HWSIM=mfor one regulatory test). It was compared, with the same scripts, against the Neo's current default kernel (the tip plus the PMC/CLPC series) booted on the same boot chain. The branches were then rebased ontoccedac0c6a30with unchanged diffs, and the Neo test was repeated there (see the re-check below).dcp-qualchecks pass), keyboard/trackpad, Wi-Fi, Bluetooth, Touch ID (3 fingers), audio enumeration (no playback), battery, thermal, cpufreq/cpuidle, camera, GPU (vkcube, glmark2 2277 vs 2241). 0 Oops/WARN/SError; the same 15 error/warning-like dmesg lines on both boots; no DART fault.US to AU round trips apply both packages in order and keep Wi-Fi up (0% loss).
kernel:
mac80211_hwsim) hinting AU while AU was user-set: cfg80211 gives that radioits own copy of the domain but does not re-apply an unchanged country, so mt7932's flags were not
rebuilt and its notifier was not called.
iw reg reloadon the world domain: the reload changed the notifier's snapshot, so it started anew package pass instead of being deduplicated; the world package disables no channel anyway.
[120 124 128]through all of this, as it does on the default kernel.ccedac0c6a30(adds the DART display hand-off fix, iommu: apple-dart: keep live T8140 firmware translations out of TLB invalidates #221), with theNeo default's configuration (including PMC/CLPC), one-shot boot, compared with the default kernel
booted right after it on the same boot chain: identical results. All smoke items pass (glmark2 2234 vs
2205),
dcp-qualboot, brightness and 3 DPMS cycles pass, 0 D452/D454 among about 1005 DCP callbacks,0 DART faults, 0 Oops/WARN. The only extra log line was an intermittent
sn201202x 1-0c: failed to configure Type-C connection: -110, also seen on other kernels' boots and unrelated to this series.This makes the driver independent of cfg80211 always producing a new snapshot, rather than fixing a
failure seen on hardware.
Checks
checkpatch.pl --strict: 0 errors, 0 checks; 1 warning, theAssisted-bytrailer format.ccedac0c6a30(clang 22.1.6, LLVM=1): with the J700 configuration (the Neo default's) every commit buildsImage modules dtbsand passes aW=1build ofdrivers/pmdomain/apple/,drivers/gpu/drm/apple/,drivers/net/wireless/mediatek/mt7932/anddrivers/bluetooth/; with the M1/M2 configuration (Fedora Asahi based) every commit passes the sameW=1build, and the merge of all six review-fix branches builds in full with no warning that a full build of the unpatched tip lacks. No new warnings (the 4 existingW=1kernel-doc lines ondcp_crtc_send_page_flip_eventare unchanged). The same checks passed on4f3a64e7baa9and3fecb279810d.Provenance
Written for this tree; tested on the MacBook Neo (J700).
🤖 Generated with Claude Code