Three kernel fixes for a Bluetooth chip they can't save
- Writing
When I installed Arch on this laptop, Bluetooth worked on Windows and not at all on Linux. The kernel asked for BT_RAM_CODE_MT7902_1_1_hdr.bin, and linux-firmware didn't have it. So I mounted the Windows partition, copied the firmware out of System32/drivers, and built patched btusb and btmtk modules from a community repository, mt7902_temp. bluetoothctl show finally listed a controller.
A few days later pacman -Syu moved me from 6.18.4 to 6.18.5 and Bluetooth was dead again, because my modules were still in the old kernel's directory. I wrote a pacman hook that rebuilt them and restored the firmware, and published it as mt7902-bluetooth-arch-fix. That write-up ended by saying the real fix was getting the chip supported upstream, which I called "a longer-term project".
The workaround had bugs of its own. After a reinstall in May, the next kernel update failed with Source directory not found: /root/mt7902_temp/.... Pacman runs hooks as root, so $HOME pointed at the wrong place, and the installer's self-test had passed because it ran in a process where the path was still set. In August I found something worse: linux-firmware now shipped this chip's firmware, the loader prefers a plain .bin over a .bin.zst, and my hook was restoring the old Windows copy over it on every update.
I found that on 3 August, the day the chip first died on me. The machine was idle at 05:57 and my keyboard went with it. The device had vanished from the USB bus, a reboot didn't bring it back, and every boot took about 66 seconds longer because initrd kept retrying it.
Booting Windows once brought it back, so I wrote that down as the cure. It was wrong. When the failure returned twelve days later I tested each step separately, and every reset I could reach from software failed. What worked was unplugging the charger and holding the power button for 30 seconds. Windows had probably only helped because of the shutdown on the way there.
By then I was reading the reset path in the driver. It logged a failure and returned success, so I sent two small fixes to linux-bluetooth. The bot rejected v1 because format-patch pushed my title to 81 characters against a limit of 80. v2 was applied two days later and reached Linux 7.3. My first upstream code was in, and the chip kept dying.
Two things I told the list were weaker than I thought. I blamed an assert in the chip's ROM, from a dump I had triggered by hand. When I compared it in October with the dumps from natural crashes, those carried a different assert, so my trigger had produced its own failure. My commit message also described a scenario I then failed to observe on a real wedge. The code was still correct, but my evidence for that case wasn't there, and I said so in the repository.
Comparing a healthy chip with a crashed one finally pointed away from the driver: the same reset works until the firmware's watchdog has fired. The firmware is a closed binary, so on 25 October I sent MediaTek and linux-bluetooth what I had and asked whether any sequence recovers the chip without removing power. That question is still open, and the repository now serves as the recovery guide I couldn't find when this started.