Skip to content

spi: apple: restore thread-driven refill for transmit-only transfers - #1491

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
satchlj:upstream/j613-spi-tx-fallback-20261110
Nov 11, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
satchlj:upstream/j613-spi-tx-fallback-20261110

Conversation

@satchlj

@satchlj satchlj commented Nov 10, 2026

Copy link
Copy Markdown
Member

GPT-6.1 Sol on @satchlj's behalf

On J613/T8122, the IRQ FIFO engine introduced by 6c564f2 stalls transmit-only Mesa sensor patch uploads with hundreds of TX words outstanding. Full-duplex status reads still work. Moving FIFO acknowledgement before service did not cure the failure. Restoring the pre-IRQ-engine driver restored fingerprint match on the same kernel.

Use the known working interrupt wake/refill/rearm sequence for transmit-only transfers, while retaining in-handler service for receive and duplex transfers. This is focused regression containment rather than a full driver revert. It does not claim to explain the hardware interrupt stall. The existing six KUnit tests remain and a seventh tests the TX-only mask/wake handshake; no tests are retired.

Link: #1388

Base: freshly checked integration/aurora dc8f6f7. Two files, one signed-off commit; no unmerged dependency. AI implementation and commit assistance: GPT-6.1 Sol, with Assisted-by: LLM under Documentation/process/coding-assistants.rst and Satya's requested sign-off.

Validation before submission: target repository's existing spi-apple-irq KUnit suite plus the new case ran in an arm64 QEMU kernel built with LLVM 18. All seven tests pass, zero skipped. Minimal arm64 kernel Image.gz and the built-in driver compile/link passed. This is not an all-config/module or full distro kernel build. Strict checkpatch and git diff --check pass with no findings. No private mock substitutes for KUnit.

Board Exact retained hardware result This patch
J613 / T8122 November 9: 7.3.0-aurora73-test-1-ARCH, kit based on 11eccbe; 8 MHz mode 1, 20 ns CS timing. Original IRQ engine stalled at 345/589/815/1203 words left, zero RX. Earlier FIFO clear still stalled at 815. Pre-IRQ-engine spi-apple-only module override restored enclave identity match and lock-screen unlock at 16:57:37, boot cc2ae18b. Exact new mixed-mode patch not run on hardware. It restores that handshake only for TX-only transfers. Needs sensor patch upload/match and RX/duplex/load regression.
Other Apple Silicon boards No hardware run performed. No qualification claimed.

November 10 rebase-2rtc boots established service/gate health only and are not counted as fingerprint authentication. No hardware was accessed for this submission. The FIFO register-memory KUnit fixture verifies software handshakes, not actual threshold latching or the underlying IRQ failure mechanism. Remaining hardware work is explicit rather than relabeling the old whole-driver fallback as an exact-head result.

The IRQ FIFO engine stalls the Mesa sensor firmware upload on J613:
hundreds of TX words remain and there is no RX half to drive progress.
Moving the FIFO acknowledgment before service also failed on hardware.
The pre-IRQ-engine driver's wake/refill/rearm handshake restored sensor
patch delivery and fingerprint match on the same kernel.

Use that handshake for transmit-only transfers. Mask interrupts and wake
the thread without acknowledging the FIFO threshold; the thread moves
data and rearms the interrupt until TX completion. Synchronize the IRQ
before servicing shared transfer state or returning after timeout.
Keep in-handler FIFO service for receive and full-duplex transfers, where
avoiding scheduler latency remains useful. Preserve the existing IRQ
KUnit cases and add coverage of the TX-only wake/mask handshake.

This contains the regression without reverting the whole IRQ engine. It
does not establish the underlying hardware stall mechanism. Hardware
results cover the old full-driver override, not this exact mixed-mode
implementation; the latter still needs J613 fingerprint and load tests.

Fixes: 6c564f2 ("spi: apple: Service the FIFOs from the interrupt handler")
Link: aurora-silicon#1388
Signed-off-by: Satya Benson <satya@benson.earth>
Assisted-by: LLM
@satchlj

satchlj commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

Board Exact composition Measured result Still owed
J613 / T8122 M3 MacBook Air, firmware 26.6.2/25G83 integration/aurora dc8f6f77934b471a13c91e7780e2d91ebc904b3d + PR971 f891a957fc26e8c9e6b1823f25e1cfd4f37b2c59 + exact PR1491 42ba050ce7e7bea7f7fe1ce497530d8c4b0b38e2 Booted; SEP/Mesa probes and no-finger sensor startup pass; transmit-only uploads complete A person's finger match/unlock, exact same-base pre-patch A/B, long load regression and other boards

Release 7.3.0-aurora73-pr1491-42ba050-ARCH, boot ID d5f9287f-e704-4d6e-b2c9-e53ae47be28b. UKI SHA256 998a81ff4e8b84fc7106862d185c87c0d6cc82da49ebcd41e560251690734661. Whole Image/modules/DTBs built with LLVM18/Rust1.85. Config is identical to today's booted exact PR971 kernel except CONFIG_LOCALVERSION. All 98,475 source blobs match PR971's tree plus the two exact PR1491 SPI files; no additional source changes. #971 is included for the internal keyboard/trackpad; MTP keyboard/multitouch/Force Click nodes register, but no person input events were tested in this evening trial.

What ran without a finger:

  • /dev/sep-bio, sep-bio-rearm, sep-key present. SEP ready in 3114 ms; apple-mesa spi0.0 bound at 8 MHz, mode 1, 20 ns CS timing. Touch ID gate succeeds; fprintd active/running, Result=success; GetDevices exposes the Apple secure enclave fingerprint sensor.
  • On one persistent system D-Bus connection: Claim(satchlj), VerifyStart(any), wait eight seconds without a finger, VerifyStop, Release all succeeded. This starts and cancels the sensor path; it is not successful authentication. No enrollment or deletion was requested, and no enrollment-store files were opened by the test scripts.
  • A separate ftrace instance captured transfer start/stop and message completion metadata on spi0.0. All 2,726 transfer starts pair with stops: 17 transmit-only, 2,702 duplex, seven receive-only. TX-only transfers include 22,158-byte and 28,878-byte uploads. All 2,719 completed messages have actual length equal to frame length, zero short completions. These are the measured large uploads on the new mixed-mode driver, not an inference from the old whole-driver fallback. Payload bytes were discarded; only lengths, direction and pairing metadata were retained. Owned trace instances were removed afterward.
  • No SPI/Mesa timeout, FIFO stall, Oops, BUG or SError was found in this boot's kernel log. The whole dmesg is not error-free: it contains DCP firmware PMU/bandwidth/framebuffer diagnostics, Bluetooth codec-capability failures, and the known SEP saved-lockout refusal 0x8002 followed by EmptyTolerated and successful bring-up. The initial transient-busctl Release also failed because its Claim client had already disconnected; the persistent-session probe above corrected that test and released successfully.

What did not run: no exact same-base pre-patch reproduction tonight, no finger match or lock-screen unlock, no sustained concurrent SPI/RX stress, no external display/Thunderbolt, no suspend, no macOS, no other board. Historical IRQ stalls and the old full-driver fallback remain historical evidence, not a fresh A/B. RX/duplex coverage here is limited to the sensor startup/status traffic counted above. A person must still qualify authentication.

Returned to the signed packaged default, cleaned the one-shot trial with the approved tool, and verified the original Limine config/no one-shot before releasing the rig lease. Stage1/Stage2 and masked package hooks were not changed.

@satchlj

satchlj commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

2026-11-10 J613 re-test carrying exact #1491 head 42ba050. Persistent no-finger Claim/VerifyStart/VerifyStop/Release all returned success. Cold sensor bring-up completed 17 transmit-only SPI transfers; all 2722 recorded SPI messages completed at full length, including the 28,878-byte sensor patch. No SPI timeout, queue error or sensor bring-up failure. After permanent default installation/reboot: another 17 TX-only completions, 2727 full-length messages, zero short messages; fprintd and the Touch ID gate were healthy. Only SPI metadata retained; no finger presented and no match/enrollment claim.

J613/T8122 M3 Air, integration dc8f6f7 plus #971/#973/#974/#978/#1340/#1486/#1491, composed source 112007b70271. Hardware-tested release 7.3.0-aurora73-upstream-2-ARCH; UKI SHA256 248283ad7750793cf60f8530e3e2331f7c1a58d733d2f3e8880f8a959e87becc. Composition evidence, not an isolated PR kernel. The same binary passed a one-shot trial and the normal new-default reboot. Installed package revision 30.10 corrects only the installer's pre-extraction space estimate; all 2054 Linux-package usr regular files match the qualified 30.9 package. Stage1/Stage2 unchanged, four boot hooks masked.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

No blocking findings. The focused TX-only thread-driven refill restores the previously working handshake while leaving receive/duplex IRQ service in place; interrupt masking, timeout quiescence and IRQ synchronization remain explicit. Seven posted KUnit cases pass. Exact patch hardware traces in a booted composition demonstrate full-length large TX-only uploads and thousands of RX/duplex completions. This supports the transfer regression fix, not a claim of fingerprint authentication. Human fingerprint match/unlock and sustained mixed SPI regression remain feature/rollout follow-ups.

@DjDeveloperr
DjDeveloperr merged commit ada5346 into aurora-silicon:integration/aurora Nov 11, 2026
1 check passed
@satchlj

satchlj commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Claude Fable 5.2 on @satchlj's behalf

Follow-up (human fingerprint match), J613 M3 MacBook Air, kernel 7.3.0-aurora73-ppt-2-ARCH (local package 30.12, which carries this PR's head 42ba050): fail. One fprintd-verify with the enrolled finger resting on the sensor ended in 0.86 s with verify-unknown-error; five lock-screen attempts earlier in the same boot failed the same way. No transmit-only timeout was seen (the case this PR fixes); each failure is a receive timeout during the frame read: spi_master spi0: transfer timed out (remaining 0 tx, ~800-1100 rx), apple-mesa spi0.0: SPI transfer failed: -110, then apple_sep: verify: reading the frame failed (ETIMEDOUT). Not run: the merged integration tree itself, any other kernel, re-enrolment. No successful match was obtained today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants