Repository navigation
Fail shutdown when a Thunderbolt RAID enclosure is powered off under linux-omarchy #19000
drachinhaber
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Powering off a Promise Pegasus2-R while
linux-omarchystill owns it deadlocks PCI removal. A later shutdown never finishes. This is stock Linux 7.2.15 behavior, in the kernel Omarchy ships. Filing it as a suggestion because a fix, a workaround at shutdown, or a note in the manual would be yours to choose.What happened
Machine: Omarchy 4.5.0-3, kernel
7.2.15-1-omarchy, Mac Pro 6,1. The enclosure is a Promise Pegasus2-R (Thunderbolt 2) with a PM8010 at PCI105a:8760, driven bystex.On 15 Nov 2026 at 06:36:50 the enclosure was powered off while that driver still owned the controller. The Thunderbolt link went down (
pcieport 0000:15:03.0: Slot Link Down,thunderbolt 0-1: device disconnected). Hotplug removal started, the driver reset the host, and 55 seconds later the firmware handshake failed (stex: firmware not operational).Two kernel threads have been stuck in uninterruptible sleep since then:
irq/38-pciehpis insidestex_remove→sd_sync_cache→blk_execute_rq, waiting for a cache flush to the powered-off controller.irq/27-aerdrvis inpcie_do_recovery→report_normal_detected, blocked on the mutex the hotplug thread holds. The kernel logged that at 06:40:task irq/27-aerdrv is blocked on a mutex likely owned by task irq/38-pciehp.The Promise PCI device stays in the tree and the SCSI host stays in state
cancel. Writingremoveagain blocks on the same lock. A normal shutdown takes that lock too, so power-off stops there. The same pattern, on 13 Nov 2026, left the machine up for about three and a half hours after a shutdown request. The root btrfs filesystem had committed. The hang was after userspace finished, in the kernel power-off path.Cause
blk_execute_rqcallsblk_wait_io(), and this build inlines it.blk_wait_iowaits in slices ofhung_task_timeout_secs * HZ / 2(60 seconds here) so a long command does not trip the hung-task detector:Those wakeups do not fail the I/O and do not resubmit it. The request never completes because the controller is gone and, in this case, the flush was not started (
device_busystayed 0), so the SCSI timeout never armed. The wait does not end.Returning from that wait without ending the request would be a use-after-free: the completion writes into
blk_execute_rq's stack. The same wait is used for other passthrough commands that are supposed to run longer than a minute, so a blanket timeout there is not a safe one-line change.This
blk_wait_iomatches Linux 7.2.15. It is not an Omarchy patch.Why a suggestion
Omarchy builds this kernel. A carried fix could make removal of a dead
stexdevice fail the cache flush instead of waiting forever, or shutdown could refuse to start while that removal is already stuck and tell the user a hard reset is required. Either would stop a powered-off enclosure from taking the machine down with it. A manual note is the smaller version: power the enclosure off only with the host, or hard-reset if the link was dropped whilestexstill owned the card.Filed by Grok 4.7 via Grok Build.
All reactions