Repository navigation
Block only hci* rfkill switches when turning Bluetooth off - #20378
Conversation
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryBluetooth shutdown now blocks only listed
Reviews (5) · Last reviewed commit: "Block only hci* rfkill switches when tur..." · Reviewed by Greptile |
|
Codex High compared this head with the earlier Bluetooth fixes. Opus 5.5 High and muse-wonder via pi, thinking high also favored carrying the widget fix in #12585; the second review's independence is not guaranteed. That older implementation preserves visibility while rfkill answers and follows switch-removal events while BlueZ already has no adapter. These are competing implementations, so both PRs remain open for the maintainer's choice. I queued this PR's detached-controller CLI status, auto-power-on before scanning or device-name lookup, and CLI regression coverage to be folded into #12585, crediting @dhh. No worker tests were run for this PR because it is being left behind the competing fix; the combined change must be verified in that PR's session. This head's CI checks pass. Waiting on the maintainer. |
Carry the CLI recovery from omacom#20378 into the widget fix. A blocked platform radio can have no BlueZ controller, so status and auto-power operations consult the same soft-block query as the panel. Power up before resolving device names because BlueZ cannot resolve them while the controller is absent. Keep the existing power deadline. Co-Authored-By: David Heinemeier Hansson <david@hey.com> Co-Authored-By: GPT-6 <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com>
6bb9de7 to
255ac57
Compare
|
Codex High compared Opus 5.5 High and muse-wonder via pi, thinking high also favored carrying the fix in #12753; their independence is not guaranteed. They disagreed on whether the fallback differences permit duplicate closure, so both PRs remain open for the maintainer’s choice. #12585 addresses recovery when a controller is already detached and remains complementary. This comparison checked the two diffs, current Bluetooth callers, and the base-branch rules. CI passes on this head. No worker tests or hardware verification were run because this is being left behind the competing fix; that comparison does not establish #12753’s readiness. Waiting on the maintainer. |
What changes
On laptops with a platform ACPI Bluetooth rfkill switch (such as ThinkPad's
tpacpi_bluetooth_sw),rfkill block bluetoothblocks both the controller switch (hci0) and the platform switch. Blocking the platform switch cuts power to the internal USB port mid-shutdown, causing kernel timeout errors (Opcode 0x2039 failed: -110,USB disconnect), droppinghci0from BlueZ so the Bluetooth bar icon disappears completely, and forcing a ~2.8s USB re-enumeration and firmware reload when turning Bluetooth back on.bin/omarchy-bluetooth-power: When turning Bluetooth off, block only thehci*rfkill IDs fromrfkill --raw --noheadings --output ID,DEVICE list bluetooth(falling back torfkill block bluetoothif none are listed). Blockinghci*keeps the controller attached in BlueZ (Powered: no/PowerState: off-blocked), still persists across reboots viasystemd-rfkill, eliminates the USB disconnect errors, and drops turn-on latency from ~2.8s to ~0.25s.power_onstill runsrfkill unblock bluetoothso any already-blocked platform switch gets cleared.test/shell.d/bluetooth-test.sh: Add tests confirmingoffblocks onlyhci*IDs when a platform switch is present, andonstill unblocks all Bluetooth rfkill switches.Verification
bash test/shell.d/bluetooth-test.sh: all checks pass, including the new platform-switch tests.shellcheck -S warning bin/omarchy-bluetooth-power: clean.tpacpi_bluetooth_sw+hci0):omarchy-bluetooth-power offleavestpacpi_bluetooth_swunblocked and soft-blockshci0;omarchy-bluetooth statusreportsPower: offwithController: dhh-tp, the bar widget stays visible with the off glyph,/var/lib/systemd/rfkill/pci-0000:00:14.0-usb-0:10:1.0:bluetoothsaves1, anddmesglogs zero errors.omarchy-bluetooth-power onrestoresPower: onin 0.25s with no USB re-enumeration or firmware reload.