Reacquire USB device on resume - #285
Open
sillymotives wants to merge 1 commit into
Open
sillymotives wants to merge 1 commit into
sillymotives wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reacquire the fingerprint USB device before rebuilding python-validity state during
Resume().On systems where ACPI S4 powers down or resets the USB root hub, the sensor may re-enumerate at a new USB address. The existing
Resume()path resets TLS and callsinit.open_common(), which assumes the old PyUSB device handle is still usable. That leaves the backend registered, but operations fail with:This change:
--devpathselection strict and fails closed rather than drifting to another identical reader.Reproduction
Reproduced on an HP EliteBook x360 1030 G2 with a Validity fingerprint sensor during real ACPI S4 hibernation.
During resume, the USB root hub loses power/reset state and the fingerprint reader re-enumerates. Before the fix, the long-running python-validity process retains the stale pre-hibernate PyUSB handle.
Restarting only
python3-validity.servicerecovered the device, which isolated the failure to USB handle reacquisition rather than open-fprintd itself.Hardware validation
An equivalent implementation based on python-validity 0.14 was tested end-to-end on the affected hardware.
Observed results:
open-fprintd-resume.servicecompleted successfully;The original stale-handle ENODEV failure did not recur.
Forward-port validation
This branch is a clean forward-port onto current 0.15
master.It was additionally validated with focused tests covering:
The modified Python files compile successfully and
git diff --checkpasses.Scope
Only three files are changed:
No packaging changes or device-ID additions are included.