Skip to content

wifi: mt7932: keep the country package's channel disables - #228

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
j700/sashiko-mt7932-policy-reapply
Oct 9, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
j700/sashiko-mt7932-policy-reapply

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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

  • MacBook Neo (J700), one-shot boot of the public tip 4f3a64e7baa9 with all six review-fix branches merged (J700 configuration, plus MAC80211_HWSIM=m for 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 onto ccedac0c6a30 with unchanged diffs, and the Neo test was repeated there (see the re-check below).
    • General smoke identical to the default: display (DCP boot, eDP 2408x1506, brightness 2-525 nits, 3 DPMS cycles, all dcp-qual checks 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.
    • With country AU, channels 120, 124 and 128 are disabled by the package on both kernels, and AU to
      US to AU round trips apply both packages in order and keep Wi-Fi up (0% loss).
    • Trigger not reproduced. Neither candidate trigger reached the deduplicated update on this
      kernel:
      • A second radio (mac80211_hwsim) hinting AU while AU was user-set: cfg80211 gives that radio
        its 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 reload on the world domain: the reload changed the notifier's snapshot, so it started a
        new package pass instead of being deduplicated; the world package disables no channel anyway.
    • The disabled set stayed [120 124 128] through all of this, as it does on the default kernel.
  • MacBook Neo re-check on ccedac0c6a30 (adds the DART display hand-off fix, iommu: apple-dart: keep live T8140 firmware translations out of TLB invalidates #221), with the
    Neo 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-qual boot, 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, the Assisted-by trailer format.
  • Builds on the final base ccedac0c6a30 (clang 22.1.6, LLVM=1): with the J700 configuration (the Neo default's) every commit builds Image modules dtbs and passes a W=1 build of drivers/pmdomain/apple/, drivers/gpu/drm/apple/, drivers/net/wireless/mediatek/mt7932/ and drivers/bluetooth/; with the M1/M2 configuration (Fedora Asahi based) every commit passes the same W=1 build, 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 existing W=1 kernel-doc lines on dcp_crtc_send_page_flip_event are unchanged). The same checks passed on 4f3a64e7baa9 and 3fecb279810d.

Provenance

Written for this tree; tested on the MacBook Neo (J700).

🤖 Generated with Claude Code

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]>
@RyanTheTide
RyanTheTide merged commit 90c6f8c into aurora-wip Oct 9, 2026
@DjDeveloperr
DjDeveloperr deleted the j700/sashiko-mt7932-policy-reapply branch October 12, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant