omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy restart bluetooth does not recover a wedged Intel adapter (reload btusb)

Open codeface-io opened this issue 2 months ago • 9 comments

System details

  • Omarchy: 4.0.4-1
  • Kernel: linux-omarchy 7.2.5-3
  • Machine: Beelink SER9 (AZW SER9), AMD Ryzen 7 255
  • Bluetooth: Intel AX200NGW, USB 8087:0029 on usb 1-5 (btusb). Wi-Fi on the same card (iwlwifi at 02:00.0) stayed up.

What's wrong?

In one sentence: when the Intel USB Bluetooth adapter fails firmware init, the Bluetooth panel is empty and Update → Hardware → Bluetooth (omarchy restart bluetooth) does nothing useful — it only unblocks rfkill. Reloading btusb brings the adapter back in about a second.

This looks like “Bluetooth is gone.” It is not switched off, and it is not missing hardware.

What actually happened

After a cold boot, BlueZ reported No default controller available. bluetooth.service was running, rfkill showed hci0 unblocked, /sys/class/bluetooth/hci0 existed, lsusb still showed 8087:0029. Wi-Fi worked.

The kernel had already given up:

Bluetooth: hci0: Reading Intel version command failed (-110)

-110 is a command timeout. The AX200 Bluetooth side is a USB device that must upload firmware after a real power-off. That handshake timed out, leaving a zombie hci0 that BlueZ will not use.

What Omarchy does today

bin/omarchy-restart-bluetooth is:

rfkill unblock bluetooth
rfkill list bluetooth

That is the right fix for “I turned Bluetooth off.” It cannot unstick firmware. I ran it twice; no change. Then:

sudo rmmod btusb
sudo modprobe btusb

Firmware intel/ibt-20-1-3.sfi loaded in ~1.4s, BlueZ had Controller … [default], Powered: yes. No reboot.

Suggested change

After the existing rfkill unblock, if bluetoothctl list still has no Controller:

  1. modprobe -r btusb && modprobe btusb (needs root; the menu path already runs in a privileged terminal).
  2. Wait a few seconds for firmware.
  3. If a controller appears, done. If the same -110 is back, the current “still broken” state is honest.

Who benefits

Anyone with Intel USB Bluetooth (AX200 / AX201 / AX210 and similar, 8087:00xx) after a cold boot or hard power-off — laptops and mini PCs, not only this Beelink. People whose adapter is merely rfkill-blocked still get the current unblock first and never hit the reload.

Scope (small, Omarchy-owned)

  • bin/omarchy-restart-bluetooth only.

Optional follow-up, not required to close this: pin power/control=on for Intel BT USB IDs. That overlaps #12095 (omarchy-usb-autosuspend.conf is a no-op; Intel controllers still autosuspend). On this machine usbcore.autosuspend is still 2 and 8087:0029 is control=auto. A udev pin may reduce how often firmware init loses the race; it does not replace a restart path that can recover a zombie hci0.

Out of scope: CMOS reset when Wi-Fi is also dead (iwlwifi CSR_RESET / probe -110). That is board power / BIOS, a different failure. If Wi-Fi still works, do not send people to CLR CMOS.

Steps to reproduce (when the adapter is already wedged)

bluetoothctl list          # empty / no Controller
lsusb | grep 8087          # device still there
journalctl -b | grep -F 'Reading Intel version command failed'

omarchy restart bluetooth  # still no controller

sudo rmmod btusb && sudo modprobe btusb
sleep 3
bluetoothctl list          # Controller is back

Related (different bugs)

  • #11365 — panel shows “No adapter” after you intentionally rfkill-off; UI hole, not firmware timeout.
  • #12095 — shipped USB autosuspend setting never applies; BLE HID reconnect. Same Intel USB family, different symptom.

Happy to test a patched omarchy-restart-bluetooth on this AX200.

codeface-io avatar Sep 19 '26 13:09 codeface-io

Hey, I opened #13085 for this. It restarts bluetooth.service and, if no controller shows up, falls back to the btusb reload you described.

I don't have an adapter that actually gets stuck like yours, so that part has only been tested with stubs. If yours wedges again, could you give it a try?

curl -fsSL https://raw.githubusercontent.com/pedrohfp/omarchy/restart-bluetooth-recovery/bin/omarchy-restart-bluetooth -o /tmp/restart-bluetooth
bash /tmp/restart-bluetooth

pedrohfp avatar Oct 06 '26 02:10 pedrohfp

Checked against quattro: bin/omarchy-restart-bluetooth there still only runs rfkill unblock bluetooth and rfkill list bluetooth, so the menu's Bluetooth restart cannot recover an adapter whose Intel firmware handshake timed out (Reading Intel version command failed (-110)). The bug is real and still present.

#13085 is the open pull request that fixes it, and it already says it closes this issue. After the rfkill unblock and a bluetooth.service restart, if no controller shows up within 5 seconds and btusb is loaded, it unloads and reloads btusb and waits up to 15 seconds for the firmware upload. That is the same recovery you found. Two other open pull requests, #13668 and #13101, only restart bluetooth.service. That fixes #13078, a bluetoothd that lost track of the adapter, but not this case: a controller stuck in kernel setup after a firmware timeout stays hidden from bluetoothd until the driver is reloaded.

Claude Opus 5.5 checked this by reading the issue, the script on quattro and the three pull requests. Codex Medium reviewed it separately and came to the same conclusions on all three points. Nothing was run: a VM cannot put a real AX200 into this firmware state, so the fix can only be confirmed on affected hardware. @codeface-io, if your adapter wedges again, the test @pedrohfp described on #13085 is the confirmation that pull request is waiting on. This issue now waits on the maintainer's decision on #13085.

omarchybot avatar Oct 12 '26 07:10 omarchybot

Agreed — stock omarchy restart bluetooth is still only rfkill. #13085 already restarts bluetoothd and falls back to reloading btusb. I'd track the fix there.

jandrusk avatar Oct 12 '26 18:10 jandrusk

Different (harder) wedge mode on Intel BE201 — btusb reload would not have recovered it; xHCI reset did

HP OmniBook 14 fr0xxx, Intel BE201 (Meteor Lake), linux-omarchy 7.2.8-9, linux-firmware 20260916-1, bluez 5.87.

On 2026-10-23 the firmware download failed mid-transfer at boot:

Bluetooth: hci0: Found device firmware: intel/ibt-0093-0291.sfi
Bluetooth: hci0: Failed to send firmware data (-38)
Bluetooth: hci0: Intel reset sent to retry FW download
Bluetooth: hci0: Failed to read MSFT supported features (-110)

The chip then wedged at the USB level, not just in HCI_SETUP: it re-enumerated on its port as a broken low-speed device in a loop all morning (usb 3-10: new low-speed USB device number N), btusb stayed loaded but bound to nothing, /sys/class/bluetooth was empty and rfkill listed no Bluetooth device.

Consequence for #13085: in this state a btusb reload has nothing to bind to — the device isn't enumerating as a Bluetooth device at all. I did not run the PR script during the wedge (inference from bus state, not a test), but it almost certainly would have exited 1 at the final "no controller" step.

What did recover it, verified live without a reboot:

pkexec sh -c 'echo 0000:00:14.0 > /sys/bus/pci/drivers/xhci_hcd/unbind; sleep 4; echo 0000:00:14.0 > /sys/bus/pci/drivers/xhci_hcd/bind'

The xHCI controller owning the BT port re-enumerated the chip healthy, firmware downloaded cleanly (Device booted in 51129 usecs), and the controller registered immediately. Only the camera shares that controller here, so the reset cost nothing.

Suggestion: consider a final fallback in omarchy-restart-bluetooth after the btusb reload fails — unbind/rebind the xHCI PCI driver owning the adapter's USB port (caveat: briefly disconnects other devices on that controller). Happy to test a revised script here; next time the wedge hits I'll run the PR script first and report, then the xHCI reset.

The firmware-download failure itself looks upstream (btusb/btintel vs linux-firmware 20260916; same kernel+firmware booted clean Oct 19–22, and clean on 7.2.5-3 + 20260810 for weeks), so I'm not filing that as a separate Omarchy issue.

ThermedWolf avatar Oct 23 '26 13:10 ThermedWolf

@ThermedWolf, thanks for the BE201 report. It is a different failure from the one this issue is about, and it does not change what #13085 fixes. On the AX200 here the adapter stayed on the bus with btusb bound and a half-initialised hci0, so reloading the driver re-runs the firmware upload. On your BE201 the chip stopped enumerating as a Bluetooth device at all, so there is nothing for btusb to bind to.

Walking #13085's script (head 0971ad0) through the state you describe: /sys/class/bluetooth exists while the Bluetooth core module is loaded, even when it is empty, so bluetooth.service restarts and bluetoothd runs. No controller appears within 5 seconds, btusb is loaded, so it unloads and reloads it, waits up to 15 seconds, then prints "No Bluetooth controller is available", points at journalctl -b -k, and exits 1. So it would have failed and said so, as you expected, without hanging or claiming a recovery. This is from reading the script, not running it; a VM cannot put a real BE201 in this state.

The xHCI unbind and rebind is not something a menu action should do on its own. It drops every device on that controller. On your laptop that is only the camera, but on many machines it includes the USB keyboard and mouse, a dock, or a drive part way through a write. With the chip not enumerating, there is also no Bluetooth device in sysfs to trace back to the right controller. #16141 shows the same shared failure domain: a btusb reset there took down an AMD controller along with the keyboard and mouse on it. Whether Omarchy should offer controller recovery, and in what form, is for the maintainer to decide. If you can catch the full kernel log and lsusb -t from the next wedge, that is worth a separate report, since it looks like a btintel/btusb or firmware regression rather than something this script can fix.

Claude Opus 5.5 read the new report, #13085's current script, and #16141. Codex Medium reviewed the same questions separately and agreed on all three points. It also pointed out that systemctl and modprobe in the script have no timeout of their own, so the 20-second figure is the expected path, not a guaranteed limit. This issue still waits on the maintainer's decision on #13085, and on a run of it from an affected AX200 if anyone's wedges again.

omarchybot avatar Oct 23 '26 13:10 omarchybot

Additional hardware evidence from a Beelink SER9 Pro HX370 / Intel AX200 system, including a USB-enumeration-level failure rather than just an HCI setup failure.

System: Omarchy 4.5.0-3, linux-omarchy 7.2.15-1, BIOS SER9T401 (2025-04-03). Wi-Fi is Intel AX200 (8086:2723).

On the affected boot, internal USB port 3-5 on xHCI 0000:c7:00.0 retried for ~86 seconds and never enumerated:

[    2.642555] usb 3-5: new full-speed USB device number 3 using xhci_hcd
[   18.071717] usb 3-5: device descriptor read/64, error -110
[   33.943922] usb 3-5: device descriptor read/64, error -110
[   49.815709] usb 3-5: device descriptor read/64, error -110
[   65.687745] usb 3-5: device descriptor read/64, error -110
[   65.791827] usb usb3-port5: attempt power cycle
[   71.207741] xhci_hcd 0000:c7:00.0: Timeout while waiting for setup device command
[   88.311660] usb 3-5: device not accepting address 6, error -62
[   88.311875] usb usb3-port5: unable to enumerate USB device

systemd-analyze: 28.308s firmware + 1.949s loader + 95.136s kernel/early boot + 6.409s userspace = 131.803s. The previous boot on 7.2.8-9 also contained the same enumeration errors.

Recovery: a hard power-off fixed the USB enumeration stall. After the hard power-off, the next boot recovered on the same 7.2.15-1-omarchy kernel, without a BIOS upgrade or kernel switch. The machine owner has explicitly confirmed the hard power-off was performed and fixed this occurrence:

usb 3-5: New USB device found, idVendor=8087, idProduct=0029

There was an initial firmware-upload failure (-19), a disconnect/re-enumeration, then successful loading of intel/ibt-20-1-3.sfi and ibt-20-1-3.ddc:

Bluetooth: hci0: Firmware loaded in 1321983 usecs
Bluetooth: hci0: Device booted in 16605 usecs
Bluetooth: hci0: Applying Intel DDC parameters completed

The recovered hci0 sysfs path is .../0000:c7:00.0/usb3/3-5/3-5:1.0, confirming that the previously unidentified failing port is the Intel Bluetooth device.

Recovered boot: 12.505s firmware + 1.893s loader + 11.763s kernel/early boot + 3.006s userspace = 29.169s. No failed system units.

The hard power-off and successful next boot are confirmed by the machine owner and the before/after logs. This establishes recovery for this occurrence; long-term recurrence has not yet been tested. I have not tested #13085 or btusb reload while the device was wedged, so this is additional failure/recovery evidence, not confirmation of that PR. Once USB enumeration fails this early, a userspace Bluetooth restart cannot remove the boot delay already incurred.

ZhangHang avatar Nov 05 '26 07:11 ZhangHang

Another data point for this: same failure on an Intel adapter (USB 8087:0029, firmware intel/ibt-20-1-3.sfi), linux-omarchy 7.2.15-1, bluez 5.87.

At boot the first probe times out and no controller registers, so a paired Magic Trackpad can't connect:

Bluetooth: hci0: Reading Intel version command failed (-110)
  • Same state as the AX200 case above: /sys/class/bluetooth/hci0 is still there and btusb is still bound, but bluetoothctl reports "No default controller available".
  • It's intermittent. In my journal about 12% of roughly 155 boots are affected, across 7+ kernel versions including stock Arch kernels, so it doesn't look like an Omarchy or kernel-update regression.
  • It skews towards cold boots after a long time off: 16 of 108 boots after 8h+ off, against 2 of 47 after shorter gaps. This latest one followed about 37 hours powered off. That fits a power-up race, but I haven't proven it.
  • USB autosuspend is not the cause here; I ruled it out.
  • The workaround on my earlier occurrences was sudo modprobe -r btusb && sudo modprobe btusb.

I've written a small boot-time oneshot that reloads btusb when /sys/class/bluetooth is empty, as a stopgap until something like #13085 lands. I'm happy to test #13085's omarchy-restart-bluetooth the next time this happens.

maksika avatar Nov 08 '26 09:11 maksika

The two new reports describe different points of failure. @ZhangHang's logs show the USB device failing to enumerate before Bluetooth could initialise; recovery after a hard power-off on the same kernel does not test #13085. @maksika's remaining hci0, empty BlueZ controller list and previous recovery with a btusb reload match the original report, but #13085 itself still has not been tested during a wedge. A stopgap that checks only for an empty /sys/class/bluetooth would miss that remaining-hci0 state.

@codeface-io, if the original failure returns, please test #13085 at full commit 0971ad020e5c88b773d7c57ca058dad6c27821be before a manual driver reload or reboot. This downloads and runs just its restart script without replacing the installed version. It asks for sudo and briefly disconnects Bluetooth devices:

restart_script=$(mktemp /tmp/omarchy-restart-bluetooth.XXXXXX)
if curl -fsSL https://raw.githubusercontent.com/pedrohfp/omarchy/0971ad020e5c88b773d7c57ca058dad6c27821be/bin/omarchy-restart-bluetooth -o "$restart_script"; then
  bash "$restart_script"
  printf 'restart exit status: %s\n' "$?"
fi
rm -f "$restart_script"

Please include the script's output and exit status, whether hci0 exists and what timeout 2s bluetoothctl list returns before and after, plus the relevant Bluetooth and USB messages from journalctl -b -k. If a boot recovery service is installed, please note whether it ran before the test.

Codex High read the reports, current quattro script and related PRs. Opus 5.5 High and muse-wonder (via pi, thinking high) reviewed the same material and agreed on this outcome; independence is not guaranteed. No hardware reproduction or worker tests were run.

#13085 already links this issue. It remains the maintainer's decision, with affected-hardware confirmation still outstanding.

omarchybot avatar Nov 18 '26 04:11 omarchybot

The new cross-reference shows the same Intel version-command timeout after a kernel crash in the PCIe driver btintel_pcie. Here the AX200 stayed visible on USB and recovered after a manual btusb reload. The draft kernel backport targets the PCIe crash. #21166 · Kernel backport

The USB recovery PR remains open for maintainer review and still needs a run on the affected AX200 during a wedge. The November 18 comment has test instructions for the current commit. #13085 · AX200 test instructions

Codex High compared both reports and the restart diff. Opus 5.5 High and muse-wonder via pi, thinking high, reviewed the same material and agreed. Reviewer independence is unverified.

omarchybot avatar Dec 02 '26 12:12 omarchybot