Repository navigation
soc: apple: sep: notify sysfs on diag/keystore and diag/touchid transitions - #3168
Conversation
DjDeveloperr
left a comment
There was a problem hiding this comment.
Audited full diff at ca59f54: caching diag/keystore and diag/touchid kernfs_node references in sep_diag_register() with a devm_add_action_or_reset() cleanup registered after devm_device_add_group() (so LIFO unwind puts references before group removal), guarding pointer access under sep_diag_kn_lock, and firing kernfs_notify() only on actual atomic_xchg/atomic_cmpxchg state transitions is race-free and safe from atomic context. Verified checkpatch clean and J616s live POLLPRI/POLLERR results.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
The source CI job (tools/aurora-sep/tests/test_diag_sensor.py) fails to compile drivers/soc/apple/diag_shim.c in both test_diag_goes_bound_attached_ready_and_back and test_matching_follows_the_guard:
drivers/soc/apple/diag_shim.c:22:10: fatal error: linux/kernfs.h: No such file or directory
Please add the linux/kernfs.h stub (and matching kobj.sd / kernfs_* stubs) to tools/aurora-sep/tests/test_diag_sensor.py so the host test compiles and passes cleanly (and once green, this shared SEP path will also need a second hardware generation test row before merge).
…itions Userspace helpers (aurora-sep-load, aurora-sep-ready) currently poll diag/keystore in a 100 ms sleep loop while waiting for SEP bring-up to finish (#2313). Cache kernfs_node references for diag/keystore and diag/touchid at sep_diag_register() time (released via devm_add_action_or_reset() before the attribute group is removed) and call kernfs_notify() on state transitions so userspace can wait via poll(POLLPRI | POLLERR) with zero polling delay. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
ca59f54 to
c72e93d
Compare
|
Amended at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verified the added linux/kernfs.h, linux/spinlock.h, kobj.sd, and devm_add_action_or_reset() stubs plus touchid_kn.notifies assertion in tools/aurora-sep/tests/test_diag_sensor.py. Holding merge until CI completes green and a second Mac generation row is posted.
|
|
What
Userspace helpers (
aurora-sep-load,aurora-sep-ready) currently polldiag/keystorein a 100 ms sleep loop while waiting for SEP bring-up to finish.Cache the
kernfs_nodereferences fordiag/keystoreanddiag/touchidduringsep_diag_register()(releasing them viadevm_add_action_or_reset()before the attribute group is removed) and callkernfs_notify()on state transitions so userspace can wait withpoll(POLLPRI | POLLERR)and zero polling delay.Also add matching
linux/kernfs.h,linux/spinlock.h,kobj.sd, anddevm_add_action_or_reset()stubs intools/aurora-sep/tests/test_diag_sensor.pyand verifykernfs_notify()counts during the host test.Closes #2313.
Tested: J616s (MacBook Pro 16-inch M4 Pro, T6040) at c72e93d on 7.3.0-m4.190:
scripts/checkpatch.pl --strict0 errors / 0 warnings;python3 -m unittest tools/aurora-sep/tests/test_diag_policy.py tools/aurora-sep/tests/test_diag_sensor.py -v(and-O) pass; booted live on J616s, verifieddiag/keystoreanddiag/touchidsysfs nodes register cleanly and deliverPOLLPRI | POLLERRnotifications on state transition, 0 failed units, Touch ID and SEP healthy.Not yet: hardware test row from a second Mac generation (shared
apple-seppath).Risk: two-way · all Macs with Apple SEP (
apple-sep)