Repository navigation
Conversation
Reading a USB device's product string takes the device lock. When fprintd gets stuck mid-ioctl on a reader that never woke from suspend, that lock is held forever, so omarchy-hw-fingerprint blocked every caller, including the post-update hook, which stalled omarchy-update indefinitely. Cap the read at a second and let the vendor check decide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed at 1bac03e, nothing found that needs changing. What ran, on a disposable Omarchy worker: a separate reproduction, independent of the PR's own tests, that points What was only read: the kernel side. In Second opinion: Codex Medium reviewed the same diff. It agreed there are no defects, but its independence from this review isn't guaranteed. It traced the locking in the kernel source on its own and reached the same answer. It also pointed out one related path outside this PR: The change is one line plus two tests, which is the right size for the problem. Nothing is left for the author. It now waits on the maintainer. |
Both sides appended cases to hw-fingerprint-test.sh. The platform-reader cases from omacom#14675 run first and remove their fingerprint-readers file, so the wedged-reader cases still exercise the USB scan alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This stopped merging cleanly after #14675 (platform-named fingerprint readers) landed on What ran, on a disposable Omarchy worker, at 5611e77: the same FIFO reproduction as before, with a fake device whose Second opinion: Codex Medium reviewed the merge and found no defects. Its independence from this review isn't guaranteed. It checked that nothing from either side was lost, and that the FIFO cases still exercise the vendor fallback now that the test runs a copy of the command with a fixture platform root. It also noted that #14675's platform block reads each named file with an unbounded Nothing is left for you. This now waits on the maintainer. |
[Medium impact] The change reaches fingerprint detection and the paths that call it. The PR appears safe to merge, with a non-blocking improvement needed to keep its regression tests from hanging. Findings
SummaryBounds USB product-name reads so a stuck reader can fall back to vendor detection.
Reviews (1) · Last reviewed commit: "Merge quattro into fingerprint-detect-ti..." · Reviewed by Greptile |
| write_usb_devices '27c6:609c' | ||
| hang_product 1-0 | ||
| assert_detects "a reader whose product read hangs is detected by vendor" | ||
|
|
||
| write_usb_devices '1234:5678' | ||
| hang_product 1-0 | ||
| assert_rejects "a non-reader whose product read hangs is rejected" |
There was a problem hiding this comment.
The new FIFO tests rely on the detector’s own timeout to finish. If that timeout is removed or broken, both the test and test/shell wait forever instead of reporting a failure. Give these calls an independent deadline and explicitly fail when it expires; assert_rejects must not count an expired deadline as a successful rejection.
omarchy-updatestalled forever in the post-update hook on my Framework 13. The Goodix reader (27c6:609c) had wedged after a suspend: fprintd was stuck in the kernel mid-ioctl and held the USB device lock. Reading the device'sproductstring in sysfs needs that lock, soomarchy-hw-fingerprintblocked forever, and with itsetup-fingerprint.hookand the whole update. The shell's own call to the detector had been stuck for days too.Now the product read gives up after a second (
timeout --kill-after=1s 1s cat, same idiom asomarchy-hw-hybrid-gpu), and the existing vendor-ID check decides. A wedged Goodix reader is still detected, because fprintd's claim goes through usbfs, which the driver check already treats as userspace.Verified
test/shell.d/hw-fingerprint-test.sh: two new cases use a FIFO as theproductfile to model a read that never returns. Without the fix the test hangs; with it, everything passes in about 2s. The fingerprint-package and fingerprint-invitation tests still pass.The underlying fprintd/kernel wedge needs a reboot to clear. This change only stops it from taking the update down with it.
Made by Claude Opus 5.5 via Claude Code