omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy-usb-autosuspend.conf is a no-op; Intel Bluetooth controllers still autosuspend (BLE HID reconnect timeouts)

Open jordanglean opened this issue 2 months ago • 9 comments

/etc/modprobe.d/omarchy-usb-autosuspend.conf is a no-op, and the USB autosuspend behaviour it targets still applies

Summary

omarchy-settings (since 4.0.4) ships /etc/modprobe.d/omarchy-usb-autosuspend.conf:

options usbcore autosuspend=-1

usbcore is built into the kernel (modinfo usbcore → (builtin)), so a modprobe.d option can never apply to it. /sys/module/usbcore/parameters/autosuspend stays at its default 2, and per-device autosuspend is not changed at all.

Worse, even setting the parameter where it can be set (the kernel command line) would not achieve the intent, because per-device autosuspend on this platform is driven by the udev/hwdb layer and btusb, not by usbcore.autosuspend.

The user-visible symptom this file was presumably meant to address is Bluetooth LE HID devices (mice/keyboards) failing to reconnect: the Intel controller is runtime-suspended, so the BLE link never completes and Omarchy's Bluetooth panel reports a connection timeout until the device is forgotten and paired again.

Impact

Any Omarchy machine whose Bluetooth controller is runtime-suspended benefits from a fix that isn't there. On Intel Bluetooth controllers the practical result is BLE HID reconnect timeouts (Logitech MX Master 3S and ERGO K860 here, but the mechanism is generic).

Root cause

Chain, on this machine (Intel AX201, 8087:0026):

  1. systemd hwdb marks the controller autosuspend-eligible. /usr/lib/udev/hwdb.d/60-autosuspend-chromiumos.hwdb:112 lists usb:v8087p0026* inside a block whose value is ID_AUTOSUSPEND=1 (line 143). This is the Chromium OS autosuspend allowlist, but it matches on every system.

  2. udev applies it. /usr/lib/udev/rules.d/60-autosuspend.rules:11:

    ENV{ID_AUTOSUSPEND}=="1", TEST=="power/control", ATTR{power/control}="auto"
    

    so the USB device gets power/control=auto and power/autosuspend_delay_ms=2000.

  3. The Arch kernel is built with CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y, so btusb participates in runtime PM. The controller suspends ~2s after going idle (observed runtime_status=suspended after ~7s from cold, i.e. 2s after the firmware/HCI setup settles).

  4. When a bonded BLE HID device reconnects, the controller is asleep and the LE connection does not complete; the panel's 20s timer (omarchy-bluetooth-device runs timeout 20s bluetoothctl connect) expires.

Why the shipped file cannot work

Verified directly on the affected machine.

usbcore is builtin:

$ modinfo usbcore | head -2
name:           usbcore
filename:       (builtin)

The parameter is untouched at boot:

$ cat /sys/module/usbcore/parameters/autosuspend
2

And even when the parameter is forced to -1 at runtime (the value the cmdline would set, which is honoured for a builtin module) and btusb is reloaded, the controller still autosuspends:

$ echo -1 > /sys/module/usbcore/parameters/autosuspend   # now reads -1
$ modprobe -r btusb && modprobe btusb
t=01s control=auto delay=2000 status=active
...
t=07s control=auto delay=2000 status=suspended

options btusb enable_autosuspend=n does not help either, because power/control=auto is already set per-device by the udev rule above.

Steps to reproduce

  1. Install Omarchy 4.0.4 on a machine with an Intel Bluetooth controller (or any device listed in 60-autosuspend-chromiumos.hwdb).
  2. cat /sys/module/usbcore/parameters/autosuspend → 2 (the shipped file did nothing).
  3. Pair a BLE HID device, let the controller go idle, then try to reconnect it.
  4. Observe the controller suspended (cat /sys/bus/usb/devices/*/power/runtime_status) and the connection timing out.

System details

  • Omarchy: 4.0.4-1 (omarchy, omarchy-settings 4.0.4-1)
  • Hardware: Razer Blade 15 Base (Early 2021), Intel Core i7-10750H + RTX 3060 Mobile
  • Bluetooth: Intel AX201, usb 8087:0026, HCI version 11
  • Kernel: 7.2.3-arch1-3 (also linux-omarchy 7.2.5-3 installed)
  • BlueZ: 5.87-2
  • systemd: 261.2-1
  • CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y, usbcore builtin

Working fix (local)

A udev rule that runs after 60-autosuspend.rules and pins the controller on. This is what is actually needed; the kernel cmdline and the btusb module parameter do not override the udev/hwdb result.

/etc/udev/rules.d/61-bluetooth-intel-no-autosuspend.rules:

ACTION=="add|bind|change", SUBSYSTEM=="usb", ATTR{idVendor}=="8087", ATTR{idProduct}=="0026", ATTR{power/control}="on"

udevadm test /sys/bus/usb/devices/<bt-device> confirms the ordering:

60-autosuspend.rules:11     ATTR{power/control}="auto"
61-bluetooth-intel-no-autosuspend.rules:11  ATTR{power/control}="on"
  power/control : on

After this, control=on and runtime_status=active hold, and both BLE HID devices connect and stay connected.

Suggested upstream fix

  • Remove /etc/modprobe.d/omarchy-usb-autosuspend.conf (it cannot do anything), and
  • ship a udev rule (in omarchy-settings) that pins power/control=on for the Intel Bluetooth controllers the chromiumos hwdb wrongly marks (8087:0025, 8087:0026, 8087:0029, 8087:0032, 8087:0033, 8087:0036), since that hwdb allowlist is intended for Chromebooks, not a desktop distro.

Diagnostics

omarchy debug does not exist in 4.0.4 (Unknown Omarchy command), so the relevant outputs are included above. Happy to re-run any specific command or capture a btmon trace on request.

jordanglean avatar Sep 16 '26 11:09 jordanglean

Additional confirmed affected Intel controller: 8087:0a2a (Intel Wireless 3165 Bluetooth, Dell Inspiron 13-5378). This ID is also matched by 60-autosuspend-chromiumos.hwdb, but is missing from the controller list in the suggested udev fix.

On Omarchy/omarchy-settings 4.0.4-1:

udevadm info: ID_AUTOSUSPEND=1
/sys/bus/usb/devices/1-6/power/control=auto
/sys/bus/usb/devices/1-6/power/runtime_status=suspended
/sys/bus/usb/devices/1-6/power/autosuspend_delay_ms=2000
/sys/module/usbcore/parameters/autosuspend=2

So /etc/modprobe.d/omarchy-usb-autosuspend.conf is ineffective here as described in this issue. The failure is more severe than a normal reconnect timeout: on both completed linux-omarchy 7.2.5-3 boots, reconnecting BLE HID devices after S3 resume caused an HCI timeout followed by a permanently blocked USB reset worker.

Bluetooth: hci0: command 0x2013 tx timeout
Bluetooth: hci0: Resetting usb device.
INFO: task kworker/... blocked for more than 122 seconds.
Workqueue: events __usb_queue_reset_device
 hci_cmd_sync_clear [bluetooth]
 hci_unregister_dev [bluetooth]
 btusb_disconnect [btusb]
 usb_reset_device

First affected boot: resumed at 05:44, timed out at 06:11, then the worker remained blocked through 737 seconds. A second HCI timeout occurred at 07:11. Second affected boot: resumed at 17:39, timed out at 17:43, and the worker remained blocked through 860 seconds until reboot. The BLE devices involved were a Logitech MX Master 3S and TH108 PRO-1 keyboard.

The immediately preceding linux 7.1.9-arch1-2 boot also resumed from S3 but had no timeout/reset failure, and there are no matching 0x2013 timeout entries in the retained 2026 journals before the update. linux-firmware 20260810-2 and BlueZ 5.87-2 were unchanged during the Omarchy 4.0.4 update. Both the installed stock 7.2.3 kernel and linux-omarchy have CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y; I have not yet booted stock 7.2.3, so this evidence does not establish whether the deadlock is specific to the Omarchy kernel.

This confirms that a real udev override should also cover 8087:0a2a, and shows that leaving this controller runtime-suspended can trigger a kernel workqueue deadlock in addition to BLE reconnect failures.

Domingocs avatar Sep 17 '26 23:09 Domingocs

Independent confirmation on a second machine, plus a layer the analysis above doesn't cover yet: TLP.

ThinkPad X390, Intel 9460 (8087:0aaa), MX Master 3 over BLE, Omarchy on the quattro line:

  • /etc/modprobe.d/omarchy-usb-autosuspend.conf present, CONFIG_USB=y, live /sys/module/usbcore/parameters/autosuspend = 2 — the file is inert, exactly as described.
  • The machine also runs TLP (installed by the user; not an Omarchy package). With the controller runtime-suspended, the mouse's reconnect advertisements never surfaced in clean scans — the radio was deaf to everything, not just the mouse — and the device only came back through remove + re-pair. Writing on to power/control reconnected it instantly with the existing bond, keys intact.
  • TLP re-applies power/control=auto and autosuspend_delay_ms=2000 through its udev hook (RUN+=, which runs after rule processing, so ordinary udev rules cannot outrank it on add events), and it writes the delay explicitly, so even a usbcore.autosuspend=-1 kernel parameter does not protect TLP users.
  • What holds here: a /etc/tlp.d drop-in with USB_DENYLIST covering the Intel combo PIDs. Note USB_EXCLUDE_BLUETOOTH no longer exists in TLP 1.10, so the IDs have to be explicit.

#12950 packages that drop-in for TLP users; it complements the command-line approach in #10140 rather than replacing it.

s-gato avatar Sep 22 '26 21:09 s-gato

Thanks for the detailed chain. The first half is confirmed, and #8097 reported it earlier: omarchy-usb-autosuspend.conf never applies because usbcore is built in. The second half, that the kernel command line cannot fix Bluetooth, does not hold up. If that is right, #10140 fixes this issue as well. Only your hardware can confirm it, so below is a test to run.

What was checked. On a disposable VM running stock Omarchy 4.0.4 (linux-omarchy 7.2.5-3, omarchy-settings 4.0.4-1), modinfo usbcore reports (builtin), the parameter reads 2 with the file installed, and USB devices sit at control=auto delay=2000 status=suspended.

Why the command line should cover the Bluetooth case. usb_alloc_dev() in drivers/usb/core/usb.c copies usbcore.autosuspend into each device's autosuspend delay at the moment the device is created. Writing the sysfs parameter later changes only the default for devices created afterwards. modprobe -r btusb && modprobe btusb rebinds the driver but keeps the same USB device, so that experiment kept the 2000 ms delay from boot and never tested what the kernel parameter does. With a negative delay, the runtime-PM core (update_autosuspend() in drivers/base/power/runtime.c) holds a usage reference and refuses runtime suspend. That holds even with power/control=auto, which is all that 60-autosuspend.rules and btusb's usb_enable_autosuspend() set. The chromiumos hwdb gives these Intel IDs no ID_AUTOSUSPEND_DELAY_MS, so nothing on a stock install puts a positive delay back. The same VM showed this directly. Writing -1 without re-creating the devices left every delay at 2000. After re-creating them by rebinding the xHCI controller, every delay was -1000 and every device stayed active with control=auto forced on.

If that holds, the command line is a better fix than an ID-list udev rule, because it covers every controller. The proposed list (0025 0026 0029 0032 0033 0036) matches systemd 262's chromiumos hwdb on only 0025 and 0026, and misses 07DC, 0A2A (the 3165 in @Domingocs's report) and 0AAA (the 9460 in @s-gato's report). It also leaves out controllers that btusb puts on autosuspend itself. TLP writes the delay itself, so the kernel parameter does not protect TLP users. #12950 handles that case.

What would settle it: add usbcore.autosuspend=-1 to KERNEL_CMDLINE[default] in /etc/default/limine, remove your 61-bluetooth-intel-no-autosuspend.rules, run sudo limine-mkinitcpio, and reboot. Then post the controller's power/autosuspend_delay_ms and power/runtime_status, and whether the MX Master and K860 reconnect after idle and after resume. If they reconnect, #10140 fixes this. If they still fail with the delay at -1000 and the status active, there is a second cause, and this stays a separate bug.

This was reviewed by Claude Opus 5.5. Codex Medium reviewed it independently. It reached the same kernel mechanism from source and added the hwdb ID comparison above. It had my VM results in front of it, so its agreement on the mechanism is not fully independent. Asked separately whether this issue and #8097 are the same item, it said they are not, so this stays open. It is waiting on that test.

omarchybot avatar Oct 12 '26 03:10 omarchybot

Confirmed duplicate of #8097 / #12294 (builtin usbcore ignores modprobe.d). Sibling BLE note in #14803 says it's not always this path.

Fix PRs already open: #9815, #10140, #10111 (kernel cmdline). Suggest closing this in favor of #8097 once one of those lands.

jandrusk avatar Oct 13 '26 16:10 jandrusk

Independent confirmation on a fourth controller ID (8087:0033), plus a data point suggesting the post-resume symptom has a second layer that the runtime-PM fix may not cover.

System: Omarchy 4.0.5-1 (omarchy-settings 4.0.5-1), kernel 7.2.11-arch1-1, BlueZ 5.87, systemd 262, Intel Bluetooth 8087:0033 at /sys/bus/usb/devices/3-10. Devices: MX Master 3S (BLE HID), Keychron K3 (BR/EDR HID).

No-op confirmed: with both /etc/modprobe.d/omarchy-usb-autosuspend.conf and /etc/modprobe.d/disable-usb-autosuspend.conf installed, the controller reports:

power/control: auto
power/autosuspend_delay_ms: 2000

The daemon-state layer: after a suspend cycle, powering the mouse on produced no reconnection at all. Manual connect attempts from the panel hung past ~25s with no D-Bus reply, and there were no log lines for the mouse anywhere during the failed window — bluetoothd produced nothing for its address across its entire lifetime (it logs nothing for this device even on successful connects), and the kernel's only HID lines for the mouse arrive at the one successful connection hours later. The BR/EDR keyboard reconnects normally in the same conditions (device-initiated, no auto-connect allowlist involved).

Two controlled results with runtime PM untouched (power/control still auto, delay 2000ms):

  • Passive test on a fresh daemon: bluetoothctl disconnect the mouse, no discovery session (Discovering: no), no retries — it reconnected on its own within the ~20s observation window.
  • Full systemctl restart bluetooth.service: both devices reconnected on their own ~20s later.

So on this machine, restarting bluetoothd is sufficient to restore BLE HID auto-reconnect after suspend, regardless of the controller's runtime-PM state — consistent with the daemon's LE auto-connect state going stale across suspend, not (only) the radio being asleep. I couldn't inspect the mgmt allowlist without root, so I can't fully separate the two layers from this data alone.

I'm running this locally as a resume hook (mirrors the fprintd-resume pattern in default/systemd/system-sleep/):

[Unit]
Description=Restart Bluetooth after resume to restore LE auto-connect
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart bluetooth.service

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

Happy to run the kernel-cmdline test from the previous comment (usbcore.autosuspend=-1 via /etc/default/limine) and report autosuspend_delay_ms/runtime_status plus the idle/resume reconnect matrix — that would tell whether the cmdline fix alone also covers the resume case, or whether the resume-restart hook is needed regardless. I can also PR that system-sleep script if maintainers want the daemon-state layer covered either way.

pedrosatin avatar Oct 19 '26 17:10 pedrosatin

Different controller from most of the reports here — Intel 7260 8087:0a2a (same ID as @Domingocs's 3165), ET-M400 BLE mouse on uhid, Omarchy 4.0.6-1, linux-omarchy 7.2.8-9, systemd 262. Adding it because the udev-ordering fixes discussed above cannot win on this path, and there is a driver-level option that does — with a cross-reboot verification the thread does not have yet.

Why no udev rule can win this. 60-autosuspend.rules and btusb's probe both write power/control, and the second is not a udev rule at all: btusb is built with CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y and calls usb_enable_autosuspend() from its probe, so it writes auto from inside the kernel after the udev add event. A 99- rule, an hwdb override of the chromiumos entry, and ID_AUTOSUSPEND="" all merely run earlier. On this machine the 99- rule and the hwdb override both verified clean under udevadm test and systemd-hwdb query, and the controller still came up control=auto on every boot; writing on by hand held only until the next reboot.

Driver-side fix. /etc/modprobe.d/btusb-no-autosuspend.conf:

options btusb enable_autosuspend=N

plus the companion /etc/udev/hwdb.d/99-intel-bt-no-autosuspend.hwdb clearing ID_AUTOSUSPEND for usb:v8087p0A2A* and the 99- rule setting power/control=on. Note the hwdb filename prefix is ordering, not a label: it must sort after /usr/lib/udev/hwdb.d/60-* — a 10- prefix does not override (systemd-hwdb query still returns ID_AUTOSUSPEND=1), 99- does. No kernel command line change, nothing to race.

After reboot, with no manual intervention:

power/control: on
power/autosuspend_delay_ms: 2000
power/runtime_status: active
/sys/module/btusb/parameters/enable_autosuspend: N
systemd-hwdb query 'usb:v8087p0A2A*' → ID_AUTOSUSPEND= (empty)

Effect. Before: 11 hid-generic 0005:25A7 re-registrations in the first 17 min of a boot, every ~40 s while the mouse was actually moving, each accompanied by profiles/input/hog-lib.c output_written_cb() Write output report failed: Internal application error: I/O, and a 1–2 s freeze on move. After: 1 registration (the initial connect) and no further write failures across 4+ min of continuous real use. One or two write failures at connect time still appear and look benign.

Limits, so this is not oversold. enable_autosuspend is module-wide: it covers every btusb controller on the machine, not only this ID. It does not help TLP users — TLP's RUN+= hook writes power/control=auto and the delay itself, and this option only stops the driver from doing the same, so @s-gato's #12950 is still needed there. And this covers the BLE HID reconnect/churn symptom only; I have no S3 data for the tx timeout + blocked __usb_queue_reset_device deadlock @Domingocs described.

If #10140's usbcore.autosuspend=-1 test lands, that remains the better general fix since it also covers non-Bluetooth devices. enable_autosuspend=N is the narrower lever for machines where only the Bluetooth controller is the problem.

Filed by DeepSeek V4.1 Flash via OpenCode.

jiri-cermak avatar Oct 21 '26 15:10 jiri-cermak

An update to my earlier comment, covering the three reports since. The command-line fix to test is now #9815, not #10140. #9815 is the oldest of the open command-line PRs. It removes omarchy-usb-autosuspend.conf, appends usbcore.autosuspend=-1 to the Limine defaults, and includes a migration that rebuilds the boot entries. It has been run on a worker and is waiting on the maintainer. Whether it fixes the Bluetooth symptom here is still unconfirmed, because that needs your hardware.

On @jiri-cermak's point that btusb re-enables autosuspend from its probe. That is true, and it means a udev rule that sets power/control=on on the device's add event can lose to the probe. It does not undo the command-line value. In current kernel source:

  • usb_alloc_dev() (drivers/usb/core/usb.c:744) gives each device a delay of -1000 when the device is created.
  • usb_new_device() (hub.c:2675) then turns on autosuspend handling, and update_autosuspend() (drivers/base/power/runtime.c:1767) holds a usage reference for as long as the delay is negative.
  • btusb's usb_enable_autosuspend() (btusb.c:4552) is only pm_runtime_allow(). That call releases the separate forbid reference once and leaves the negative-delay reference in place.

btusb never sets the delay itself. On a stock install the controller therefore stays active even with power/control=auto. TLP is the exception, because it writes the delay; #12950 covers that.

On @pedrosatin's report that restarting bluetoothd restores reconnects after suspend. That may be a second layer, but nothing yet shows it is separate from runtime PM. It is also not #14803. That report is on a Realtek controller that stays active, and there restarting Bluetooth does not help.

On closing this as a duplicate of #8097. The no-op file is the same defect. This issue also claims that the command-line fix cannot cure Intel Bluetooth, and #8097 makes no such claim. So it stays open until someone tests that.

What would settle it (@jordanglean, or @pedrosatin as you offered):

  1. Add usbcore.autosuspend=-1 to KERNEL_CMDLINE[default] in /etc/default/limine. This has the same effect as #9815.
  2. Remove any local workaround: the 61- or 99- rules, btusb enable_autosuspend=N, the hwdb override and the resume restart hook.
  3. Run sudo limine-mkinitcpio and reboot.
  4. Post /proc/cmdline, then the controller's power/autosuspend_delay_ms (expect -1000) and power/runtime_status.
  5. Report whether the mouse reconnects after idle and after suspend and resume.

If it reconnects, #9815 fixes this. If it still fails while the controller reads active at -1000, there is a second cause and this remains its own bug.

This re-check was done by Claude Opus 5.5, and Codex Medium reviewed it as a second opinion. Codex reached the same kernel mechanism with the same line references. It had my question framing in front of it, so its agreement there is not fully independent. It also pointed out, on its own, that #14803 is Realtek hardware where a Bluetooth restart does not help, which is why the resume report above is not treated as that bug. Nothing was run on a worker this time: the question is about Intel Bluetooth hardware, and a VM has none.

omarchybot avatar Oct 21 '26 16:10 omarchybot

One hardware data point for 8087:07dc, the Intel 7260 Bluetooth controller mentioned above. On Omarchy 4.5.0-3 with kernel 7.2.15-1-omarchy and BlueZ 5.88-1, I read power/control=auto even though a local udev rule for this exact USB ID was already installed to set power/control=on on add. A later read showed on. I did not trace what changed the value.

On this machine, btusb.enable_autosuspend reads Y, usbcore.autosuspend reads 2, and the device’s power/autosuspend_delay_ms reads 2000. Neither TLP nor PowerTOP is installed.

While investigating slow headphone reconnects on this same adapter earlier, the kernel log showed a USB reset and HCI command timeouts (0x2005, -110). The boot-parameter change in #9815 and BLE HID resume behavior still need testing on this adapter.

arrow255 avatar Nov 19 '26 14:11 arrow255

@arrow255, your 8087:07dc report adds a current hardware observation, but it still has usbcore.autosuspend=2 and a device delay of 2000. It therefore leaves the boot-parameter test outstanding. The later change from auto to on was not traced, and the USB reset/HCI timeouts alone do not establish the cause of the reconnect problem.

#9815 remains open at a94978c9bc179a79fc206eaecc0d67d2a6360679. @jordanglean, please test its boot-parameter change on the original affected hardware; @arrow255 can also supply results for the 7260. To apply that setting for this diagnostic test, append KERNEL_CMDLINE[default]+=" usbcore.autosuspend=-1" to /etc/default/limine, run sudo limine-mkinitcpio, and reboot, with local Bluetooth power rules and other PM/resume workarounds temporarily disabled. This tests the proposed boot setting, rather than installing the entire PR.

Please post /proc/cmdline, /sys/module/usbcore/parameters/autosuspend, and the controller's power/control, power/autosuspend_delay_ms and power/runtime_status after reboot and during a failed reconnect, if one occurs. Include separate idle/reconnect and suspend/resume results, and identify the controller path. The test needs a device delay of -1000; a failure with that delay while the controller stays active would leave another cause to investigate.

GPT-6 High in Codex reviewed the new report, the current default configuration and #9815's diff. No hardware test ran: the disposable VM has no affected Intel Bluetooth controller. This pass used only that review; no second opinion was requested while waiting for the hardware results. This remains waiting on the reporter's test.

omarchybot avatar Nov 19 '26 14:11 omarchybot