Skip to content

arm64: dts: apple: t8122-j613-j615: describe the Touch ID data-ready line - #2678

Open
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
airs-touchid/j615-mesa-drdy
Open

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
airs-touchid/j615-mesa-drdy

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem. The J613/J615 (M3 MacBook Air) Touch ID sensor has a data-ready line, but the device tree leaves it out, so the SEP driver polls the sensor's SPI status every 2 ms whenever a capture is armed (enrolment, a login or unlock prompt waiting for a finger). On a J615 that is about 1450 spi2 interrupts a second for as long as the prompt is up.

Change. Describe the line on the shared J613/J615 &mesa node: AP GPIO 199, rising edge. The value comes from the J615 ADT (/arm-io/spi2/mesa, interrupts = <199 3> on gpio0). J713 (199) and J616c (116) carry the same encoding in their ADTs and are described as IRQ_TYPE_EDGE_RISING in our trees, where capture already runs on the interrupt. The T8122 SEP device tree test now checks the line instead of its absence. DT only, no driver change.

Testing. J615, default kernel 7.3.0-aurora-fleet77, the production Stage 2 with only this DTB change, default command line:

  • data-ready IRQ ... configured for interrupt capture, sensor: interrupt-driven capture; an enrolment opens and waits for a finger, and cancels cleanly.
  • spi2 interrupts while an enrolment waits 30 s with no finger: 1453/s polling → 16/s with the line (the 250 ms status backstop). Both go to 0 after the cancel.
  • One s2idle round (PMU RTC wake), then an enrolment again: it opens and the data-ready interrupt still fires.
  • Regression: 0 AVC, 0 failed units, no new kernel errors (the one extra line, a dwc3 genpd_prepare -11, comes from the s2idle and shows on earlier fleet77 s2idle boots too).
  • tools/aurora-sep/tests/test_t8122_sep.py: 4/4. dtc warnings unchanged on j613, j615, j613-25g83 and j615-25g83 (13 each).

Still to run. A fingered enrolment and match on the J615 (needs a person at the machine). No J613 in the lab; it shares this node and ADT value.

Related: #1596 (draft) adds the same J613 line from the J613 ADT, together with a driver change that drops polling. This PR is the DT half on its own, for J613 and J615 both.

Measurements and kit

Per-second spi2 (2a1108000.spi) interrupt deltas from /proc/interrupts, enrolment held 30 s with fprintd-enroll, nobody touching the sensor, same script on both boots:

boot enrolment opens (t=1 s) armed, mean t=2..30 s 10 s after cancel
default DTB (polling) 24.9k 1453/s 0
with the data-ready line 13.0k 16/s 0

The t=1 s burst is the sensor re-registration that opens every enrolment. A 40 s no-finger enrolment on a J713 (data-ready line already described) for comparison: data-ready interrupt 12 times, spi interrupts +2.0k in total.

Test boot: one aura-try one-shot of the J615 production Stage 2 with its embedded DTB swapped for one carrying only the two &mesa properties (interrupt-parent, interrupts); aura and U-Boot bytes identical (cmp). Kernel unchanged (fleet77).

Assisted-by: LLM (Claude:Opus 5.5)

…line

The J613/J615 Mesa sensor raises its data-ready line on AP GPIO 199. The
ADT's /arm-io/spi2/mesa node gives it as interrupts = <199 3> on gpio0,
the same encoding as J713 (199) and J616c (116), whose device trees
describe it as IRQ_TYPE_EDGE_RISING and capture on the interrupt.

Without the line the driver polls the SPI status every 2 ms while a
capture is armed. On a J615 waiting for a finger that is about 1450
spi2 interrupts a second; with the line described it is 16 a second,
the 250 ms status backstop.

Describe the line so the J613/J615 capture is interrupt driven like
the other Mesa sensors, and update the T8122 SEP device tree test.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Looks good; approve once the fingered J615 row is in.

Checked: &mesa at arch/arm64/boot/dts/apple/t8122-j613-j615.dtsi:126-127 points at pinctrl_ap (t8122.dtsi:909, interrupt-controller, #interrupt-cells = <2>, 224 pins, so pin 199 is in range), the encoding matches the J713 node and the binding (apple,mesa-fingerprint.yaml:32, one item), and all four J613/J615 DTBs (plain and -25g83) pick it up through the shared dtsi. The test change at tools/aurora-sep/tests/test_t8122_sep.py:88-91 checks the phandle and both cells rather than just presence, which is the right strength.

HW row: J615, fleet77 + this DTB, default command line: one fingered enrolment and one match (fprintd-verify) with the data-ready IRQ count rising per touch and no fallback-to-polling line, then the same after one s2idle round; 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merge-train adversarial review (MERGETRAIN-LINUX2) at 67b0890: NO BLOCKERS.

Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below.

Full review

#2678 arm64: dts: apple: t8122-j613-j615: describe the Touch ID data-ready line @67b0890b

VERDICT: NO BLOCKERS

What I checked:

  • arch/arm64/boot/dts/apple/t8122-j613-j615.dtsi:126-127: the line is on pinctrl_ap with 199 IRQ_TYPE_EDGE_RISING. pinctrl_ap (t8122.dtsi:909-928) has apple,npins = <224>, #interrupt-cells = <2> and is an interrupt controller, so pin 199 is in range. No other T8122 node uses pin 199 (grep of t8122*).
  • The driver path already exists. drivers/soc/apple/sensor_shim.c:712-716 uses sep_spi->irq when the SPI child has an interrupt. It requests the line IRQF_ONESHOT | IRQF_TRIGGER_RISING (:756), which matches the DT flag, so there is no trigger-type mismatch warning. The data-ready interrupt only completes a completion; the capture loop still confirms state over SPI (:687-691, :813-821). A wrong pin or polarity would therefore degrade to the 250 ms status backstop, not break capture. That keeps the blast radius small.
  • No new gates, params or delays. The pre-existing of_machine_is_compatible("apple,j414s") fallback (sensor_shim.c:717) is untouched and not reached here.

Nits:

  1. tools/aurora-sep/tests/test_t8122_sep.py:88 says "as on J713 and J616s", but the commit message says "J713 (199) and J616c (116)". Both t604x J614/J616 and t6041 J614c/J616c carry 116; pick one wording.
  2. The line is not wake-enabled. Under s2idle the IRQ core masks it and replays a latched edge on resume, so a stale "fired" can wake the capture loop once after resume. This is harmless (the status read gates it), but it is worth knowing when reading a post-resume trace.
  3. The base moved under this PR's measurements. arm64: dts: apple: t8122: SPI2 and SPI4 run from the 24 MHz reference, not 200 MHz #1598 (3f09f2d2, merged 2026-11-22) changed SPI2's input clock from clk_200m to clkref (t8122.dtsi, spi2 node). The real SPI2 clock goes from about 0.96 MHz to 8 MHz. The 1453/s → 16/s numbers and the enrolment-open check were taken on fleet77 with the old clock.

Missing rows:

  • J615, kernel and DTB from integration/aurora plus this PR (that is, with arm64: dts: apple: t8122: SPI2 and SPI4 run from the 24 MHz reference, not 200 MHz #1598's 8 MHz SPI2): enrolment opens, the data-ready IRQ count rises in /proc/interrupts, and polling stays off.
  • J615 fingered enrolment and match. This is the only row that proves the line is the real data-ready and not a pin that happens to toggle.
  • J613: none in the lab. It shares the node and ADT value.
  • 25G83 variants (j613-25g83, j615-25g83) inherit this; there is no boot on either.

@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.

Adversarial review at 67b0890b against pre-pr-checklist.md (§1–§6): 0 code/policy/attribution blockers (and all 8 CI checks are green); holding only for the remaining §5 hardware rows below.

Verification

  • arch/arm64/boot/dts/apple/t8122-j613-j615.dtsi:126-127 wires &mesa data-ready to pinctrl_ap pin 199, IRQ_TYPE_EDGE_RISING. pinctrl_ap (t8122.dtsi:910-922) has apple,npins = <224>, interrupt-controller, #interrupt-cells = <2>, and pin 199 has no conflicts across t8122*.dts*.
  • Matches Documentation/devicetree/bindings/input/apple,mesa-fingerprint.yaml:32-34,125-126 and drivers/soc/apple/sensor_shim.c:712-716,756-758 (IRQF_ONESHOT | IRQF_TRIGGER_RISING, no trigger mismatch).
  • tools/aurora-sep/tests/test_t8122_sep.py:88-91 checks both the pinctrl_ap phandle and <199 1> cells across all four Air DTBs (j613, j615, j613-25g83, j615-25g83).
  • §1–§4, §6: Pass (shared dtsi, default cmdline, ADT-derived GPIO, human-only commit metadata + Signed-off-by:, PR body Assisted-by:, clean naming).
  • Non-blocking nit: tools/aurora-sep/tests/test_t8122_sep.py:88 says "as on J713 and J616s" while the commit message says "J713 (199) and J616c (116)" (both J616s and J616c use 116 IRQ_TYPE_EDGE_RISING).

Remaining §5 HW rows before approval

  1. J615 fingered Touch ID enrolment + verification (fprintd-enroll + fprintd-verify) on current integration/aurora + this PR (which now includes #1598 / 3f09f2d2 switching spi2 from clk_200m to clkref ~8 MHz since the earlier fleet77 no-finger measurement), default command line: confirm the pinctrl_ap pin 199 data-ready IRQ count increments per touch in /proc/interrupts without falling back to polling, and repeat a match after an s2idle round.
  2. Regression counts on that run: 0 AVC denials, 0 failed units, 0 new kernel errors.

(J613 is not in the lab and shares the node/ADT value; -25g83 variants inherit the shared dtsi.)

Assisted-by: LLM (Gemini 4 Neon)

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