Repository navigation
Conversation
Enrolling a second finger can fail with EBUSY if the enrolment is prepared before the verify worker exits. When fprintd checks for a duplicate before an enrolment, it identifies the finger against the enrolled prints first. On a no-match the driver reports the result first and the verify worker then saves the lockout record and collects the background result, which takes a few hundred milliseconds. fprintd starts the enrolment as soon as it has the result, and SEP_BIO_PREPARE_ENROL refuses it with EBUSY because the session is not idle yet. ENROL_START and VERIFY_START already wait for the worker with wait_for_worker_exit(); PREPARE_ENROL does not. The first finger is not affected: with an empty gallery libfprint answers the duplicate check itself, without arming the sensor. Wait for the worker in PREPARE_ENROL as well, and keep the EBUSY for a session that is still busy afterwards. Tested on a MacBook Pro 14" M4 Pro (J614s) with the patch on top of the 7.3.0-5 release (same code at this spot): the second finger enrols on the first attempt; before, two attempts in a row ended with EBUSY. Signed-off-by: E.FU <719935+e-fu@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
🟢 Approval recommended
No actionable issues were found in the reviewed changes.
No open issues 🎉
What changed in this PR
This PR addresses second-finger enrolment failures by making the Apple SEP biometric driver wait for the verify worker before preparing enrolment.
Changes:
- Waits for worker completion in
bio_prepare_enrol(), matching the existing enrolment-start behavior. - Preserves the
EBUSYresponse if the session remains busy afterward.
| File | Description |
|---|---|
drivers/soc/apple/sbio.rs |
Adds the worker-exit wait before the enrolment preparation idle check. |
Review effort: Balanced
DjDeveloperr
left a comment
There was a problem hiding this comment.
Read against main 13dc5a79c0ec. This is the same wait ENROL_START already does, and it sits in the right place:
waiting_on_worker(session, false)is only true while the opener's own finished verify still has its worker running, so a second opener or a live capture still getsEBUSY.- The condition variable drops the session lock while it waits, so the worker can finish. A signal or shutdown ends the wait as in
ENROL_START, and a timeout falls through to the oldEBUSY. - After the wait, the idle check runs under the same lock hold.
Approved at 72df143cd3ae. Your J614s result covers the fix. The missing part is a boot of main plus this commit: if you get there first, a line with the head SHA is enough. Otherwise we add it to our next T8140 or T6050 trial kernel (start an enrolment while idle, then cancel it).
|
On The author's J614s result exercises the patch in a downstream kernel. The pending hardware result is Touch ID enrolment after booting upstream |
What:
SEP_BIO_PREPARE_ENROLwaits for the verify worker before its idle check, asENROL_STARTandVERIFY_STARTalready do. Without the wait, enrolling a second finger can fail withEBUSYwhen fprintd starts the enrolment right after its duplicate check.Tested: J614s (14-inch MacBook Pro, M4 Pro, T6040) passed with the code change from 72df143 on downstream
7.3.0-5-1.3-ARCHwith #2800, #3619 and #2371. The second finger enrolled on the first try, andsudoauthenticated with either finger. A third finger then enrolled as well; after deleting it withfprintd-delete -f,sudostill matched the other two and refused the deleted one. Upstreammainwas not booted.Risk: two-way door · Macs with Touch ID under the SEP biometric driver; tested on T6040 only
Not yet: An enrolment check after booting upstream
mainwith72df143cd3ae. Also untested on J614s is enrolment after suspend.Details
When fprintd checks for a duplicate before an enrolment, it identifies the finger against the enrolled prints first. On a no-match the driver reports the result first, and the verify worker then saves the lockout record and collects the background result. fprintd starts the enrolment as soon as it has the result, and
bio_prepare_enrol()returnsEBUSYbecause the session is not idle yet.bio_prepare_enrol()now waits for the worker withwait_for_worker_exit(&mut session, false)before the idle check. A session that is still busy after the wait still getsEBUSY.The first finger is not affected: with an empty gallery libfprint answers the duplicate check itself, without arming the sensor.
Evidence
fprintd 1.94.5, one finger already enrolled. Without the patchfprintd-enroll(and the Omarchy fingerprint setup that calls it) fails right after the first touch; fprintd logsDevice reported an error during enroll: ioctl failed: Device or resource busy. The journal only names a generic ioctl error; the call order in libfprint and the idle check in the driver point toSEP_BIO_PREPARE_ENROL. The post-result work finished 295 ms and 331 ms after the touch in the two failures.EBUSYfailures captured in the journal, each after the first touchsudomatches with either fingerKernel log with the patch:
After that,
fprintd-listshows both fingers.