Skip to content

mt7932: start Bluetooth only after the Wi-Fi function initialized - #227

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
j700/sashiko-mt7932-bt-wifi-ready
Oct 9, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
j700/sashiko-mt7932-bt-wifi-ready

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

mt7932: start Bluetooth only after the Wi-Fi function initialized

Found by Sashiko review of #204.

The Bluetooth transport on function 1 waits until function 0 is bound to mt7932-fullmac, so that
its firmware starts after the Wi-Fi firmware, as in the tested sequence. Being bound does not mean
the Wi-Fi firmware is running: when Wi-Fi initialization fails and its DMA cannot be stopped,
mt7932-fullmac keeps the binding to retain that DMA. Bluetooth then probed anyway and started its
firmware on the shared radio next to a failed Wi-Fi function.

  1. wifi: mt7932: report whether the Wi-Fi function initialized
    • The probe records when it has finished initialization.
    • New mt7932_fullmac_ready() (in include/linux/mt7932.h) reports it for a function bound to
      this driver.
  2. Bluetooth: mt7932: start only after the Wi-Fi function initialized
    • Once function 0 is bound, the Bluetooth probe also requires mt7932_fullmac_ready().
    • The Wi-Fi probe finishes initialization before it returns, so a bound function that is not
      ready has failed. The Bluetooth probe then fails with -ENODEV and logs why.
    • The transport now calls into the Wi-Fi module, so it depends on MT7932_FULLMAC plainly.
      Building it in while the Wi-Fi driver is a module is no longer possible (mt7932: name the forbidden-channel marker; make Bluetooth depend on the Wi-Fi driver #207 had allowed it
      on purpose; it would now fail to link).
    • Fixes: 920e89a2e3df ("Bluetooth: mt7932: wait for the Wi-Fi function before starting")

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.
    • mt7932_bt_pcie now depends on mt7932-fullmac in modinfo, and mt7932_fullmac_ready is
      exported.
    • Normal admission is unchanged: Wi-Fi FIRMWARE_READY at 7.50 s, Bluetooth enabled at 7.70 s,
      BT_HCI_SETUP_OK, hci0 powered, 22 devices in a 10 s scan (default kernel: 7.38 s / 7.57 s, 25
      devices).
    • The failed-and-retained Wi-Fi state needs an initialization failure whose DMA cannot then be stopped;
      it cannot be forced safely, so the refusal path was not exercised on hardware.
  • 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.

Checks

  • checkpatch.pl --strict: 0 errors, 0 checks; 1 warning per commit, the Assisted-by trailer
    format.
  • Kconfig matrix (MT7932_FULLMAC y/m/n x BT_MTK7932_PCIE y/m, olddefconfig): the only change is
    Wi-Fi m with Bluetooth y, which now resolves Bluetooth to m (it was y). No Kconfig warnings.
  • 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

When initialization fails and the DMA of function 0 cannot be stopped,
mt7932-fullmac keeps the binding to retain that DMA. Whether the Wi-Fi
firmware is running therefore cannot be told from the binding, which is
what the Bluetooth transport on function 1 waits for before it starts
its own firmware on the shared radio.

Record when the probe has finished initialization and export
mt7932_fullmac_ready() to report it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The Bluetooth transport waits until function 0 is bound to
mt7932-fullmac, so that its firmware starts after the Wi-Fi firmware as
in the tested sequence. Being bound does not mean the Wi-Fi firmware is
running: when the Wi-Fi initialization fails and its DMA cannot be
stopped, mt7932-fullmac keeps the binding to retain that DMA. Bluetooth
then probes anyway and starts its firmware on the shared radio next to a
failed Wi-Fi function.

Once function 0 is bound, also require mt7932_fullmac_ready(). The Wi-Fi
probe finishes initialization before it returns, so a bound function
that is not ready has failed, and the Bluetooth probe fails with
-ENODEV.

The transport now calls into the Wi-Fi module, so it depends on
MT7932_FULLMAC plainly: it can no longer be built in while the Wi-Fi
driver is a module.

Fixes: 920e89a ("Bluetooth: mt7932: wait for the Wi-Fi function before starting")
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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