MT7902 Bluetooth on Linux

From an out-of-tree workaround to measuring a firmware failure on a MediaTek chip: three kernel patches and a bug report with register-level evidence.

Year
2026
Status
patches in Linux 7.3, wedge reported upstream
Role
Patch author

My laptop has a MediaTek MT7902 combo chip. When I installed Arch in early 2026, its Bluetooth did not work on Linux at all. This project started as a workaround, and turned into months of measuring a firmware failure and a few small kernel patches.

This began as a workaround, retired once Linux 7.1 supported the chip; the full story is in this essay. This page covers what I contributed and why each piece looks the way it does.

The failure that remained

With stock drivers the controller still died. It would work, then disappear from the USB bus while the machine was idle, and rebooting did not bring it back.

MT7902 failure and recovery The firmware asserts while idle and the driver collects a coredump. The driver reset then takes about ten seconds because of two USB timeouts and the chip drops off the bus. Reboot, S5, rfkill, port power cycling, ACPI reset and PCIe resets all fail. Only a full power drain recovers it. Firmware assertidle, no host event Coredumpabout 1 MB Driver reset10.47 s, two timeouts Device leaves the USB busdescriptor read -110, port gone Do not recover itreboot, S5, rfkill, port power cycle, ACPI _RST, WFSYS reset, PCIe FLR and SBR Recovers itAC out, hold power 30 s
Every recovery path I could reach from software failed. Until it is drained, the dead device adds about 66 seconds to each boot.

Between August and October 2026 I logged twelve natural failures and captured ten firmware dumps with a udev rule, since the kernel frees a dump after five minutes. All ten carry the same assert, in sys_log_interface_emi.c line 811. The chip was idle each time and nothing on the host preceded it. On kernel 7.2.11 the failures came 46 minutes, 8.5 hours and 12 hours after a cold boot.

Comparing against a healthy chip

To find out whether MT7902 needed its own reset sequence, I traced the driver's reset on a healthy chip and after natural failures, through the same code path:

Healthy chip After assert
Watchdog register 0x740003a0 0 1
Reset-done bit in 0x70002510 set set
Chip ID read returns times out after 5.1 s
Result back in 121 ms port gone

The generic reset works on a healthy chip, so a missing MT7902 branch is an unlikely cause. The driver's completion check also reads the same in both cases, so it cannot tell a failed reset from a good one. An ftrace run showed that the ten seconds seen on every failure are two USB control timeouts, 5.35 s and 5.1 s, sent to a chip that no longer answers.

Contributions

59c3ee19ca88: a failed reset returned success. btmtk_usb_subsys_reset() reads the chip ID back to verify a reset. If the read returned 0, it logged the failure and returned 0, which callers read as success. It now returns -ENODEV. Natural failures time out on this read instead, so this case comes from reading the code, not from a wedge I observed.

21b50c24843b: a timeout was overwritten. The MTK_BT_RST_DONE poll stored its error in err, and the next line replaced it. This regressed in 3dcb122b3064, found from the file's history. Both fixes are in Linux 7.3 and the 7.2, 6.18 and 6.12 stable trees.

btmtk_usb_isointf_init(): error paths with no observed failure. A failed 0xfd98 write left the ISO RX URB running, and the result of __set_mtk_intr_interface() was ignored. These paths never fired in 245 setups, so I claimed no user impact and tested with a one-shot injected error on the real chip: the transfer stayed anchored without the patch and was stopped with it. Accepted into bluetooth-next.

Bug report: the part I can't fix. The assert, the register comparison and one question for MediaTek: once the watchdog bit is set, is there a sequence that recovers the chip without removing power?

Capture tooling. The kernel frees a coredump after five minutes, and the device's sysfs state disappears about 76 seconds after a crash. A udev rule and script collect the most fragile data first, which is how the ten dumps exist.

What I didn't send. Linux doesn't evaluate ACPI _PRR for MediaTek Bluetooth, and adding it looked like the obvious patch. I ran _RST by hand on a wedged chip first: it executed and the chip stayed dead, so the patch would have added code that can't fix this failure.

These changes make failures visible. They do not fix the wedge, which is inside closed firmware.

A correction

My first series blamed a ROM assert that only appears when a coredump is triggered by hand; I corrected this on the list and in the repository.

Related