Repository navigation
Conversation
…leep After a deep sleep on J813 every Touch ID capture ended without a frame until the next boot. The sensor came back, its registration and the enclave's match operation succeeded, but it never scanned: the SMC's current on its 3V0 rail (IIDR) stayed at 1 mA during a capture, where it is 3 mA before a sleep and about 20 mA while it images a finger. The calibration (the enclave's module challenge and the per-device blob) runs once, at the attach-time bring-up, and sensor_calibrated then stays set. A deep sleep puts the enclave to sleep, and that calibration does not survive it. Clear sensor_calibrated and sensor_kept when the SEP resumes, so the next bring-up calibrates the sensor again. On a sensor with a nonce session the calibration only takes effect in a session made after it: with the recalibration alone, the first capture after each wake still stayed at 1 mA and the next bring-up's scanned. At boot this never shows, because the attach-time bring-up that calibrates is not used for a capture. After a recalibration that a sleep caused, bring the sensor up once more before the capture. Tested on J813: after deep sleeps the first capture scans (3 mA) and a touch matches. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
|
My J813 doesn't show this, on the same SEP driver. Over four boots and 82 deep sleeps, Touch ID matched 13 times after a wake. The driver never logged "the capture ended without a frame". I can't measure the 3V0 rail, so all I have is the journal. Same driver. All four kernels are #2135's merged head
None of these touch the SEP driver. Nothing there clears Setup:
Matches after a deep sleep. Every sleep here logged
Today's boot, after the 7 h 50 min sleep: Differences from your test that I can see:
I can't tell which of those matters. If it helps, I can run a build with your temporary 🤖 Generated with Claude Code |
|
Thanks. This is a careful comparison, and it shows a gap in my evidence. I went back through my logs. Every 3V0 ( My only failure on the unmodified driver is one boot. The finger was enrolled on that boot. Then came two 8 s alarm sleeps, and a touch during the third fresh bring-up after the wakes wasn't seen. I have no Your 13 first-operation matches without any recalibration point the other way. Next on my side: the unmodified module of the kernel I run, with the And yes, please run Readings: 0 = off, 1 mA = up but not scanning, 3 mA = scanning for a finger, about 20 mA = imaging one. Since your lock opens a match at the wake, a background log across a lid sleep measures exactly your flow: f=$(grep -l "Touch ID 3V0" /sys/class/hwmon/hwmon*/curr*_label | sed 's/_label$/_input/')
while :; do echo "$(date +%T.%N | cut -c1-12) $(cat "$f")"; sleep 0.5; done > iidr.logThe most useful parts are the lock's first operation after a wake, before you touch, and a capture before the sleep for comparison. |
|
Result: on my J813 the unmodified driver scans after a deep sleep too. I used the same kernel and DT as before, plus the
So here too the enclave keeps the calibration across a deep sleep, as on your Mac, and the premise of this PR is wrong. The 1 mA first capture after a wake came from my first candidate: it recalibrated on that bring-up, and a session that carries a calibration doesn't scan. The extra bring-up in the second commit only undid what the first broke. I'm closing this. Thanks for checking it so thoroughly. The one failure on the unmodified driver is still unexplained. After two 8 s sleeps, a touch wasn't seen, on the same boot as the enrolment. If I can reproduce it with |
On hold (draft): gig3m's J813 matches after deep sleeps on the unmodified driver (see the comments). I'm testing the unmodified driver again, with the
IIDRchannel.On J813 (MacBook Air 13" M5, T8142) Touch ID stopped seeing fingers after the first deep sleep, until the next reboot. The sensor came back after the wake: its registration (PLATFORM_IDENTITY, REGISTER_SENSOR, CLEAR_STATE, serial, nonce, SESSION_SHARE/COMMIT) and the enclave's match operation succeeded, and its data-ready line still fired during the bring-up. But every capture ended with "the capture ended without a frame". Before the sleep, the same boot had enrolled a finger and matched it, with a power cycle of the sensor for every verify.
The SMC's current on the sensor's 3V0 rail showed what was different. The key is
IIDR, from the ADT'smonitor-current-3v0, which I added as a temporary hwmon channel. During a capture, before a sleep, the rail goes 0 → 1 mA at the bring-up and to 3 mA while the sensor scans for a finger; it reaches about 20 mA while it images one. After a deep sleep it stayed at 1 mA: the sensor never scanned.Cause
sensor_calibratedthen stays set. A deep sleep puts the enclave to sleep, and the calibration does not survive it.sensor_calibratedcleared on resume, the first capture after each wake still stayed at 1 mA; the next bring-up's capture scanned and matched. On a profile with a nonce session the calibration takes effect only in a session made after it. At boot this never shows, because the bring-up that calibrates is the attach-time one, which no capture uses.Change
pm_wake()calls the newSepData::sensor_after_sleep(). It clearssensor_keptandsensor_calibratedand marks the next calibration as one that a sleep caused.bring_sensor_online(): after such a recalibration, on a profile with a nonce session, it brings the sensor up once more before the capture. That is one extra power cycle and registration, about 0.2 s, once per wake.Tested on J813
The kernel was this repository's consolidated J813 stack (#2135 plus #2142's USB4), the J813 DT part of #1732 and
CONFIG_SPI_APPLE=m. The SEP ran with the driver defaults andxart_guard=1.IIDRreading for the unmodified driver: every reading below was taken with a candidate of this change.This commit is the same patch, cherry-picked onto
integration/aurora0abc2f3. It builds there (Image and modules, LLVM 22), andcheckpatch --strictis clean. Other SoCs were not tested: they now recalibrate once after a system sleep, and only nonce-session profiles take the extra bring-up.cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10