Skip to content

arm64: dts: apple: t6050-j716c: wire HPM SPMI interrupts and SMC power sensors - #3291

Merged
RyanTheTide merged 5 commits into
mainfrom
feat/j716c-dts-idle-power
Dec 1, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
feat/j716c-dts-idle-power

Conversation

@erikwb

@erikwb erikwb commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Wire T6050 nub_spmi_a0 and nub_spmi_a1 fault-queue windows, interrupt-controller properties, and AIC 761/763 interrupts in the shared T6050 DT files, key sn201202x select-polled handling and the 3-interrupt (irq/sleep/wake) DT binding on the absence of the select interrupt instead of "apple,t8132-sn201202x" (propagating lookup errors when "select" is declared in interrupt-names and preserving register 0x1f payload-length reads for legacy fully polled "apple,t8132-sn201202x" DTs), wire per-port irq/sleep/wake interrupts on J716c hpm0/1/2/5, and expose PSTR/PHPC/PDTR/SBAV SMC hwmon sensors on J716c.
Tested: Host and live hardware at c7b2476fe420 (full details, hashes, and earlier e0bd1a6d676a/3bb25a5e6550 runs in Evidence):

  • Host checks: W=1 ARCH=arm64 LLVM=1 (defconfig + asahi.config, CONFIG_RUST=n) 0 errors / 0 warnings in spmi.c, tps6598x.h, spmi-apple-controller.c (2 pre-existing in tipd/{core,i2c}.c); sn201202x-transport.py 7/7; sn201202x-pm arm64 KUnit 37/37; dt_binding_check (apple,sn201202x.yaml) and checkpatch.pl --strict --git 3bb25a5e6550..HEAD 0/0/0.
  • J716c (M5 Max, T6050, fw 27.2): batched 3545ebecb76f (5/10 blob-identical, 5/10 hunks-present, default cmdline): 4 sn201202x controllers ready, 12 apple_spmi Edge IRQs (78 -> 94 -> 110 across 2× pm_test=platform), macsmc_hwmon PSTR/PHPC/PDTR/SBAV live, 4× pm_test=devices clean, 0 new tipd/spmi errors, 6-item smoke pass (aurora-peripherals.service warm-reboot baseline failure also on default/control).
  • J713 (M4 Air, T8132, fw 27.2): batched 76649338a1bc (3/8 runtime blob-identical, 5 t6050-*.dts(i) hunks-present, default cmdline + panic=10): 1-08/1-0a/1-0c bound, 9 apple_spmi Edge IRQs (15 -> 17 -> 19 -> 21 across 3× s2idle), 0 tipd/spmi errors, 8-item smoke pass (0 failed units, 0 AppArmor denials).
    Risk: one-way door · expands apple,sn201202x.yaml DT binding (3-IRQ layout when select is absent); T6050 boards (shared nub_spmi_a0/nub_spmi_a1 IRQ and fault-queue properties) and sn201202x select-polled / legacy fully polled payload-length read paths (J713/T8132/T8152/T6050); port IRQs and SMC hwmon keys on J716c.
    Revert: git revert restores polled T6050 SPMI/HPM defaults, removes the J716c SMC hwmon sensor nodes, and restores apple,sn201202x.yaml and spmi.c with no persistent on-disk or firmware state (any external DTs relying on the generic 3-IRQ layout without "apple,t8132-sn201202x" revert to failing probe until updated).
    Not yet:
  • Manual-wake s2idle/deep S2R and Type-C partner/dock persistence at c7b2476fe420 on J716c (apple-pmu-rtc cannot wake J716c, and no dock/USB-C partner was attached on the 2026-11-28 pass; earlier e0bd1a6d676a verified Type-C port0 partner + AC charger persistence across pm_test=devices on J716c, and 3bb25a5e6550 passed docked with a CalDigit TS5 across 2× s2idle + 2× deep S2R) and J713 Type-C partner/dock persistence across s2idle at c7b2476fe420 (no dock/partner was attached on the 2026-11-28 J713 pass; earlier e0bd1a6d676a verified CalDigit TS5 dock persistence across 3× s2idle on J713).
  • deep S2R on J713 (M4 MacBook Air, T8132) once main's pre-existing J713 deep-sleep reset is fixed.
  • Live hardware with a legacy fully polled apple,t8132-sn201202x DT (none in lab DTs; covered by sn201202x-transport.py) and other T6050 boards (J716s/J714s) not in this lab.
Details
  • Moves nub_spmi_a0 and nub_spmi_a1 fault-queue register windows (0x28a184000, 0x28a1a4000), interrupt-controller, #interrupt-cells, interrupt-parent, and AIC interrupts (761 on nub_spmi_a0, 763 on nub_spmi_a1) into t6050-die0.dtsi, t6050-max.dtsi, t6050-peripherals.dtsi, and t6050-j716s.dts so all T6050 boards inherit interrupt-driven SPMI.
  • Keys apple,sn201202x.yaml 3-interrupt (irq, sleep, wake) vs 4-interrupt (irq, select, sleep, wake) validation on the presence of the "select" interrupt name, and keys sn201202x_probe() select_polled on "select" being absent from interrupt-names rather than "apple,t8132-sn201202x".
  • Checks interrupt-names presence separately in sn201202x_select_irq_get() via of_property_match_string(), so lookup errors (-EINVAL, -EOVERFLOW, -EPROBE_DEFER, etc.) propagate whenever "select" is declared instead of silently falling back to select_polled, with KUnit coverage (sn201202x_select_irq_test) in sn201202x-pm.
  • In __regmap_sn201202x_read(), keys register 0x1f payload-length validation on sn->select_polled || (sn->polled && of_device_is_compatible(sdev->dev.of_node, "apple,t8132-sn201202x")), keeping IRQ-backed (!sn->polled) select admission strictly resource-driven while preserving register 0x1f payload-length checks for legacy fully polled T8132/T8152 DTs that omit interrupt resources.
  • Drops "apple,t8132-sn201202x" from hpm0, hpm1, hpm2, and hpm5 in t6050-j716c.dts, keeping the board-specific irq/sleep/wake interrupts and apple,sleep-ssps-rules, and exposes PSTR, PHPC, PDTR, and SBAV under smc_hwmon.
Evidence

Host checks at c7b2476fe420

  • make O=_build ARCH=arm64 LLVM=1 W=1 drivers/usb/typec/tipd/ drivers/spmi/spmi-apple-controller.o (defconfig + asahi.config, CONFIG_RUST=n): passed (0 errors; 0 warnings in spmi.c, tps6598x.h, and spmi-apple-controller.c; 2 pre-existing warnings in unrelated tipd/core.c and tipd/i2c.c).
  • python3 -I tools/testing/selftests/drivers/apple/sn201202x-transport.py: 7/7 passed (1..7, including ok 5 - older SN201202x and IRQ-backed select transport behavior preserved, ok 6 - legacy fully polled T8132 payload-length check preserved, and ok 7 - busy, missing-length, polled-T8132, IRQ-compat and oversize negative controls rejected).
  • python3 -I tools/asahi/run-host-tests.py --only sn201202x: 1/1 passed (ok apple/sn201202x-transport).
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=/tmp/sn201202x-3291.kunitconfig 'sn201202x-pm' (CONFIG_OF_OVERLAY=y, CONFIG_DEBUG_FS=y): 37/37 passed (0 skipped, 0 failed, including sn201202x_select_irq_test).
  • make O=_build_dt ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/apple,sn201202x.yaml: passed (0 errors).
  • ./scripts/checkpatch.pl --strict --git 3bb25a5e6550..c7b2476fe420: 0 errors, 0 warnings, 0 checks across b3e5081e5ba9, e3b8967905e3, e0bd1a6d676a, and c7b2476fe420.

Earlier-head checks and live hardware at e0bd1a6d676a (default command line; DT/YAML files byte-identical at c7b2476fe420)

  • scripts/dtc/apple-dt-check.sh 8c6992db4b9f e0bd1a6d676a /tmp/dtcheck-3291: base: make rc=0, 1192 warning lines, 139 DTBs, head: make rc=0, 1192 warning lines, 139 DTBs, new warnings: 0, removed: 0, binding ok: Documentation/devicetree/bindings/usb/apple,sn201202x.yaml.
  • make O=_build ARCH=arm64 LLVM=1 W=1 drivers/usb/typec/tipd/ drivers/spmi/spmi-apple-controller.o: passed (0 errors; 0 warnings in spmi.c, sn201202x-pm-test.c, tps6598x.h, and spmi-apple-controller.c; 2 pre-existing warnings in unrelated tipd/core.c and tipd/i2c.c).
  • python3 -I tools/testing/selftests/drivers/apple/sn201202x-transport.py: passed (6/6).
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=/tmp/sn201202x.kunitconfig 'sn201202x-pm': passed (37/37, including sn201202x_select_irq_test).
  • ./scripts/checkpatch.pl --strict --git 3bb25a5e6550..e0bd1a6d676a: 0 errors, 0 warnings, 0 checks across all three commits.
  • J716c (M5 Max 16" MacBook Pro, T6050): all 4 sn201202x controllers (1-08, 1-0a, 1-0c, 2-0c) bound (port controller ready), 12 apple_spmi Edge IRQs (3 each); across 2× pm_test=devices cycles (mem/freeze), IRQ counts advanced +2/cycle matching baseline; Type-C port0 partner and AC charger (tps6598x-source-psy-1-08) persisted (no dock attached); 0 post-boot tipd/spmi errors.
  • J713 (M4 MacBook Air, T8132): 1-08, 1-0a, 1-0c bound to sn201202x, 3 apple_spmi Edge IRQs each; across 3× s2idle cycles, per-device IRQ counts advanced cleanly (+2/cycle: 1 -> 3 -> 5 -> 7); Type-C partner and CalDigit TS5 dock stayed authorized; 0 tipd/spmi errors.

Earlier-head J716c hardware run at 3bb25a5e6550 (before moving SPMI properties to shared dtsis and dropping "apple,t8132-sn201202x")

  • dmesg: sn201202x 1-08/1-0a/1-0c/2-0c: port controller ready (no polled fallback).
  • /proc/interrupts: apple_spmi Edge IRQs registered and firing for 1-08 (63/69/71), 1-0c (11/17/19), 1-0a (37/43/45), 2-0c (11/17/19).
  • macsmc_hwmon: Total System Power, Heatpipe Power, AC Input Power, Battery Voltage live.
  • 2× s2idle + 2× deep S2R resumed cleanly, 0 kernel errors; docked with CalDigit TS5 (40G USB4 + igc Ethernet + dual 4K@240 displays).

J716c (M5 Max, T6050, firmware 27.2) at c7b2476fe420 (2026-11-28)

  • Candidate: batched kernel 3545ebecb76f (origin/main b897ccb4e71c + 18 PRs, CONFIG_ARM_APPLE_SOC_CPUFREQ=m, AC power, default command line). Parity: c7b2476fe420 is an ancestor; 5/10 changed files are blob-identical and 5/10 (five t6050-*.dts(i) files) carry all PR hunks (0 not provable).
  • Hashes: Image.gz SHA-256 d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, t6050-j716c.dtb SHA-256 d2f0db7a5026ae9cc4e1cff61dca38b4d1b363d47e5bad696ef65c7d715517e0, modules SHA-256 9d5782bcf02ea60a225278c9319431f902b495f6beb485d79d127c0fb2fccc92, one-shot aura-try Stage 2 SHA-256 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d (default Stage 2 21edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170, default kernel bf2582ab357573db64031f39e7bc9d617eb574c6b221364ff417810bbddf4c87, default DTB ffe7604c98ad23849b2aff19eb161bec712f8b367a9bc87339fabb6d7dc1276c unchanged).
  • sn201202x / SPMI: all 4 controllers (1-08, 1-0a, 1-0c, 2-0c) logged port controller ready; 12 apple_spmi Edge IRQs registered in /proc/interrupts (105..107, 134..136, 168..170, 171..173); summed IRQ counts 78 -> 94 -> 110 across 2× pm_test=platform; pm_test=devices 2× freeze + 2× mem all rc=0, fail=0; 6 apple-spmi ... fault 0x6a100f0x lines at 0.256 s also appear on the default boot (0 new tipd/spmi errors). No dock or USB-C partner attached (DP-1..DP-6 disconnected), and real s2idle/deep was not run (apple-pmu-rtc cannot wake J716c).
  • macsmc_hwmon: Total System Power (PSTR, 5.36 W), Heatpipe Power (PHPC, 1.28 W), AC Input Power (PDTR, 5.64 W), Battery Voltage (SBAV, 12,928 mV) live.
  • Smoke: eDP-1 3456x2234@120 enabled, 4 input devices, wlan0 0% loss, AppleJ716 + AppleJ716HPAI enumerated (speakerguardd-v2 active), Borealis Apple M5 Max (G17C B1) + vkcube --c 180 OK, 0 failed user units, 0 LSM denials, 0 Oops/BUG/fault; 1 warm-reboot baseline failed unit (aurora-peripherals.service, also fails on control and restored default); 40 err+ lines all pre-existing vs 55-line default boot except PM: suspend debug and 3 DPMS IOAVVideoInterface open failed syslog lines.

J713 (M4 Air, T8132) at c7b2476fe420 (2026-11-28)

…r sensors

Add the SPMI controller interrupt lines (AIC 761/763) and fault-queue
windows on nub_spmi_a0 and nub_spmi_a1, wire event/sleep/wake interrupts
on hpm0/1/2/5 so sn201202x uses interrupt-driven handling and idle sleep
instead of 500 ms polling, and expose PSTR/PHPC/PDTR/SBAV SMC hwmon
sensors.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb
erikwb requested review from a team as code owners November 26, 2026 18:17
@erikwb
erikwb requested review from LiamRay11 and maralcbr November 26, 2026 18:17
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at c7b2476f: ready to merge

Check Detail
CI at head ok 4 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok in the PR body at c7b2476f
Conflicts ok none
PR text ok Risk: one-way · expands apple,sn201202x.yaml DT binding (3-IRQ layout when select is absent); T6050 boards (shared nubspmia0/nubspmia1 IRQ and fault-queue properties) and sn201202x select-polled / legacy fully polled payload-length read paths (J713/T8132/T8152/T6050); port IRQs and SMC hwmon keys on J716c. Revert: git revert restores polled T6050 SPMI/HPM defaults, removes the J716c SMC hwmon sensor nodes, and restores apple,sn201202x.yaml and spmi.c with no persistent on-disk or firmware state (any external DTs relying on the generic 3-IRQ layout without "apple,t8132-sn201202x" revert to failing probe until updated).

Areas: area:bringup, area:usb
Merge: gh pr merge 3291 --merge (Owners and Core through the bypass: add --admin).

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: Code approved at 3bb25a5e6550.

Checked: Built the J716c DTB from this head and checked the Apple SPMI and SN201202x schemas with zero diagnostics. The compiled tree has both controller paths and all four USB-PD children enabled, including hpm5 despite the earlier disabled declaration. The supplied J716c row reports firing IRQs on all four ports, sensor reads and dock/suspend coverage on the batched build.

Before merge: Resolve the cancelled readiness check if required and retain the tested DTB identity with the integrated result.

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

Verdict at 3bb25a5e: two changes, then merge.

1. SoC data belongs in the shared dtsi. The nub_spmi_a0/nub_spmi_a1 fault-queue windows (0x28a184000, 0x28a1a4000), interrupt-controller and AIC 761/763 describe the T6050's SPMI controllers, not the J716c. The J714s, J716s, J775c and other T6050 boards have the same controllers. Please put them on the nodes in the T6050 SoC dtsi (where nub_spmi_a0/a1 are defined), so every T6050 board gets interrupt-driven SPMI. Keep only the board's port wiring (hpm0/1/2/5 interrupts) and the SMC hwmon keys in t6050-j716c.dts. Our no-single-board-fix rule asks for this when a shared dtsi applies.

2. The "apple,t8132-sn201202x" fallback on a T6050 board. If the driver needs a block compatible to enable the IRQ/sleep handling, that should be a generic apple,sn201202x behaviour selected by the presence of the irq/sleep/wake interrupts, not a T8132 SoC string on a T6050 machine. Please say why the T8132 string is needed, or drop it and key the driver on the interrupts.

The row is good: 4 controllers bound with edge IRQs, 2x s2idle + 2x deep S2R, docked TS5. The hwmon keys (PSTR/PHPC/PDTR/SBAV) are fine.

…Q is absent

Key the three-interrupt layout (irq, sleep, wake) in apple,sn201202x.yaml
on the absence of the "select" interrupt name instead of requiring the
apple,t8132-sn201202x compatible string, so generic apple,sn201202x nodes
that omit the register-selection interrupt validate cleanly.

Keep apple,t8132-sn201202x and apple,t8152-sn201202x valid in compatible
for existing device trees.

Signed-off-by: Erik Bourget <[email protected]>
When "irq", "sleep", and "wake" interrupts are present without a "select"
entry in "interrupt-names", enable select_polled directly instead of
gating it on "apple,t8132-sn201202x", and key the register 0x1f
payload-length check in __regmap_sn201202x_read() on sn->select_polled.

Check "interrupt-names" presence separately via
of_property_match_string() in sn201202x_select_irq_get() so lookup
errors (-EINVAL, -EOVERFLOW, -EPROBE_DEFER, etc.) propagate whenever
"select" is declared instead of silently falling back to polling.

Update sn201202x-transport.py and add sn201202x-pm KUnit coverage for
absent vs declared-but-invalid/deferred "select" IRQ handling.

Signed-off-by: Erik Bourget <[email protected]>
…allback

Move the T6050 nub_spmi_a0/nub_spmi_a1 fault-queue windows,
interrupt-controller properties, and AIC 761/763 interrupts from
t6050-j716c.dts into the shared T6050 SoC dtsis (t6050-die0.dtsi,
t6050-max.dtsi, t6050-peripherals.dtsi) and t6050-j716s.dts so all T6050
boards inherit interrupt-driven SPMI.

Drop the "apple,t8132-sn201202x" fallback from hpm0/1/2/5 in
t6050-j716c.dts now that the driver and binding key select-polled handling
on the absence of the "select" interrupt.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both review points in b3e5081e5ba9..e0bd1a6d676a (fast-forwarded over 3bb25a5e6550):

  1. SoC SPMI properties moved to shared T6050 DT files (e0bd1a6d676a): Moved the nub_spmi_a0 and nub_spmi_a1 fault-queue windows (0x28a184000, 0x28a1a4000), interrupt-controller, #interrupt-cells = <2>, interrupt-parent = <&aic>, and AIC 761/763 interrupts out of arch/arm64/boot/dts/apple/t6050-j716c.dts into t6050-die0.dtsi (nub_spmi_a0), t6050-max.dtsi (nub_spmi_a1), t6050-peripherals.dtsi (nub_spmi_a1), and t6050-j716s.dts (nub_spmi_a1). t6050-j716c.dts now keeps only the hpm0/1/2/5 port wiring and smc_hwmon keys.
  2. Dropped "apple,t8132-sn201202x" and keyed select_polled on an absent "select" IRQ (b3e5081e5ba9, e3b8967905e3, e0bd1a6d676a): Updated Documentation/devicetree/bindings/usb/apple,sn201202x.yaml so the 3-interrupt (irq, sleep, wake) vs 4-interrupt (irq, select, sleep, wake) schema keys on the presence of the "select" interrupt name, updated drivers/usb/typec/tipd/spmi.c (sn201202x_select_irq_get()) to check interrupt-names separately via of_property_match_string() so lookup errors (-EINVAL, -EOVERFLOW, -EPROBE_DEFER, etc.) propagate whenever "select" is declared and sn->select_polled is enabled only when "select" is genuinely absent (keying __regmap_sn201202x_read()'s 0x1f length check on sn->select_polled without gating on "apple,t8132-sn201202x"), updated tools/testing/selftests/drivers/apple/sn201202x-transport.py, added sn201202x_select_irq_test in sn201202x-pm-test.c, and removed "apple,t8132-sn201202x" from hpm0/1/2/5 in t6050-j716c.dts.

Verified at e0bd1a6d676a:

  • scripts/dtc/apple-dt-check.sh 8c6992db4b9f HEAD /tmp/dtcheck-3291: dt_binding_check (apple,sn201202x.yaml) ok, CHECK_DTBS=y across all 139 Apple DTBs (0 new warnings).
  • make O=_build ARCH=arm64 LLVM=1 W=1 drivers/usb/typec/tipd/ drivers/spmi/spmi-apple-controller.o: compiled cleanly (0 errors, 0 warnings in modified files).
  • python3 -I tools/testing/selftests/drivers/apple/sn201202x-transport.py: 6/6 passed.
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=/tmp/sn201202x.kunitconfig 'sn201202x-pm': 37/37 passed (including sn201202x_select_irq_test).
  • ./scripts/checkpatch.pl --strict --git 3bb25a5e6550..e0bd1a6d676a: 0 errors, 0 warnings, 0 checks.

Live hardware verified at e0bd1a6d676a:

  • J716c (M5 Max 16" MacBook Pro, T6050): all 4 sn201202x controllers (1-08, 1-0a, 1-0c, 2-0c) bound (port controller ready), 12 apple_spmi Edge IRQs (3 each); across 2× pm_test=devices cycles (mem/freeze) IRQ counts advanced +2/cycle matching baseline; Type-C port0 partner and AC charger (tps6598x-source-psy-1-08) persisted; 0 post-boot tipd/spmi errors.
  • J713 (M4 MacBook Air, T8132): 1-08, 1-0a, 1-0c bound to sn201202x, 3 apple_spmi Edge IRQs each; across 3× s2idle cycles per-device IRQ counts advanced cleanly (+2/cycle: 1 -> 3 -> 5 -> 7); Type-C partner and CalDigit TS5 dock stayed authorized; 0 tipd/spmi errors.

Still under **Not yet:**: manual-wake full s2idle/deep S2R on J716c at e0bd1a6d676a (3bb25a5e6550 previously passed 2× s2idle + 2× deep S2R), deep S2R on J713 (M4 MacBook Air, T8132) once main's pre-existing J713 deep-sleep reset is fixed, and other T6050 boards not in this lab.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please preserve payload-length reads for legacy fully polled T8132 DTs. The binding permits omitting interrupt resources. Previously the apple,t8132-sn201202x compatible selected the 0x1f length read even when sn->polled was true. Now probe skips sn201202x_select_irq_get() in that case, leaves sn->select_polled false, and __regmap_sn201202x_read() skips the length read. Can you preserve that compatible behavior in the fully polled path while keeping IRQ-backed select admission resource-driven, and cover it in the transport tests? The reported exact-head DTB and IRQ-backed hardware results still stand.

@github-actions github-actions Bot added area:usb Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:one-way Revertible or not, from Merge risk (bot) and removed door:two-way Revertible or not, from Merge risk (bot) labels Nov 28, 2026
Legacy T8132/T8152 device trees without interrupt resources set
sn->polled and skip sn201202x_select_irq_get(), leaving
sn->select_polled false. Preserve the register 0x1f payload-length
validation in __regmap_sn201202x_read() for that fully polled
"apple,t8132-sn201202x" path while keeping IRQ-backed select admission
and length checking strictly resource-driven via sn->select_polled.

Cover fully polled T8132 reads (valid, short, and oversized responses),
NULL of_node handling, IRQ-backed select with "apple,t8132-sn201202x"
compatible, and the corresponding negative controls in
sn201202x-transport.py.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Preserved register 0x1f payload-length validation for legacy fully polled "apple,t8132-sn201202x" device trees in c7b2476fe420:

  • drivers/usb/typec/tipd/spmi.c (__regmap_sn201202x_read()): Keys the 0x1f payload-length check on sn->select_polled || (sn->polled && of_device_is_compatible(sdev->dev.of_node, "apple,t8132-sn201202x")). When sn->polled is true (no interrupt resources), legacy "apple,t8132-sn201202x" / "apple,t8152-sn201202x" nodes retain the 0x1f check while generic "apple,sn201202x" polled nodes still skip it; when !sn->polled, IRQ-backed select admission and 0x1f checking stay strictly resource-driven via sn->select_polled.
  • tools/testing/selftests/drivers/apple/sn201202x-transport.py: Extended test 5 to cover IRQ-backed 4-IRQ "apple,t8132-sn201202x" (!length_reads) and NULL of_node safety, added test 6 covering legacy fully polled "apple,t8132-sn201202x" valid/short/oversized 0x1f reads, and added polled_t8132_unchecked and irq_select_compat negative controls in test 7.

Verified at c7b2476fe420:

  • python3 -I tools/testing/selftests/drivers/apple/sn201202x-transport.py: 7/7 passed (tools/asahi/run-host-tests.py --only sn201202x: 1/1 passed).
  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=/tmp/sn201202x-3291.kunitconfig 'sn201202x-pm': 37/37 passed (0 skipped).
  • make O=_build ARCH=arm64 LLVM=1 W=1 drivers/usb/typec/tipd/ drivers/spmi/spmi-apple-controller.o: 0 errors, 0 warnings in modified files.
  • make O=_build_dt ARCH=arm64 LLVM=1 dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/apple,sn201202x.yaml: passed.
  • ./scripts/checkpatch.pl --strict --git 3bb25a5e6550..c7b2476fe420: 0 errors, 0 warnings, 0 checks.
  • J716c (M5 Max, T6050) at c7b2476fe420 (batched 3545ebecb76f, 5/10 blob-identical, 5/10 hunks-present; Image.gz d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312, Stage 2 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d): all 4 sn201202x controllers (1-08, 1-0a, 1-0c, 2-0c) ready, 12 apple_spmi Edge IRQs (78 -> 94 -> 110 summed across 2× pm_test=platform), macsmc_hwmon PSTR/PHPC/PDTR/SBAV live, 4× pm_test=devices clean, 0 new tipd/spmi errors, 6-item smoke pass (aurora-peripherals.service warm-reboot baseline failure also on default/control). Manual-wake s2idle/deep S2R and Type-C partner/dock persistence at c7b2476fe420 stay under **Not yet:**.
  • J713 (M4 Air, T8132) at c7b2476fe420 (batched 76649338a1bc, default cmdline + panic=10): 1-08, 1-0a, 1-0c bound to sn201202x, 9 apple_spmi Edge IRQs, per-controller counts 15 -> 17 -> 19 -> 21 across 3x s2idle, 0 tipd/spmi errors, 0 failed units, display/input/networking/audio sink/GPU smoke clean (booted kernel SHA-256 e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, one-shot Stage 2 f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa). No dock or Type-C partner was attached, so partner persistence stays under **Not yet:**.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at c7b2476f once the queued CI checks pass.

Blockers: none in code (queued CI pending).

Checked: Delta commit c7b2476fe4 (drivers/usb/typec/tipd/spmi.c, tools/testing/selftests/drivers/apple/sn201202x-transport.py) over e0bd1a6d, host/KUnit/DT binding checks, and J716c verification.

Evidence
  • Blocker resolved (e0bd1a6d -> c7b2476f): __regmap_sn201202x_read() now checks register 0x1f payload length on sn->select_polled || (sn->polled && of_device_is_compatible(sdev->dev.of_node, "apple,t8132-sn201202x")), preserving legacy fully polled T8132/T8152 payload-length checks (NULL-safe of_node) while keeping IRQ-backed select admission and length checks strictly resource-driven via sn->select_polled.
  • Verification at c7b2476f: sn201202x-transport.py 7/7 (including IRQ-backed T8132, NULL of_node, fully polled T8132 valid/short/oversized reads, and negative controls polled_t8132_unchecked + irq_select_compat), sn201202x-pm KUnit 37/37, W=1 0/0 in modified files, dt_binding_check (apple,sn201202x.yaml), checkpatch --strict 0/0/0, and live J716c 4-controller SPMI IRQ verification pass.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at c7b2476f. App approved (NEON-PR-REVIEW2); rows needs-J713-legacy-polled-row. The SN201202x SPMI transport is also used by the J713's legacy fully polled apple,t8132-sn201202x DT, so one J713 regression row at this head is needed (plug/unplug a USB-C device and charger, a short s2idle, tipd state correct). Merges under the 6-point rule 1 h from now once hosted CI is green, unless you object.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026

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

Approved. The SPMI interrupt and fault-queue properties are now in the T6050 SoC dtsi, select polling is chosen by a missing select interrupt rather than the T8132 compatible, and the 0x1f payload-length check stays for the old fully polled T8132 DT. Driver data is set before the regmap exists, so the new lookup in the read path is safe. J716c and J713 rows ran at this head. One row is still owed before merge, the J713 check Ryan asked for: plug and unplug a USB-C device and a charger, a short s2idle, then tipd state.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at c7b2476fe420 (B2 merge train, 12-01 merge bar). Approval at this head: DjDeveloperr,aurora-silicon-review[bot]. Row: in the PR body at c7b2476. CI: linux train L2 = main (after train L1) + #1489 #3223 #3291 #3333 #3395 #3407 #3547 #3560 #3651 #3684 #3569 #3599 (candidate dd0c7bb9): Apple driver compile pass, Apple DTBs W=1 pass, planned KUnit ane-boot/clpc/ane-pm/dcp-topology/ave/asahi all pass; host-tests/dt-checks green at this head where they apply. The rest of the hosted run is queued behind the backlog. Revert: git revert -m 1 <merge commit>.

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

Labels

area:bringup Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants