Repository navigation
arm64: dts: apple: t6050-j716c: wire HPM SPMI interrupts and SMC power sensors - #3291
Conversation
…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]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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]>
|
Addressed both review points in
Verified at
Live hardware verified at
Still under |
There was a problem hiding this comment.
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.
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]>
|
Preserved register
Verified at
|
There was a problem hiding this comment.
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 register0x1fpayload length onsn->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-safeof_node) while keeping IRQ-backed select admission and length checks strictly resource-driven viasn->select_polled. - Verification at
c7b2476f:sn201202x-transport.py7/7(including IRQ-backed T8132, NULLof_node, fully polled T8132 valid/short/oversized reads, and negative controlspolled_t8132_unchecked+irq_select_compat),sn201202x-pmKUnit37/37,W=10/0 in modified files,dt_binding_check(apple,sn201202x.yaml),checkpatch --strict0/0/0, and live J716c 4-controller SPMI IRQ verification pass.
|
code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
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.
|
Merging at |
What: Wire T6050
nub_spmi_a0andnub_spmi_a1fault-queue windows,interrupt-controllerproperties, and AIC 761/763 interrupts in the shared T6050 DT files, keysn201202xselect-polled handling and the 3-interrupt (irq/sleep/wake) DT binding on the absence of theselectinterrupt instead of"apple,t8132-sn201202x"(propagating lookup errors when"select"is declared ininterrupt-namesand preserving register0x1fpayload-length reads for legacy fully polled"apple,t8132-sn201202x"DTs), wire per-portirq/sleep/wakeinterrupts on J716chpm0/1/2/5, and exposePSTR/PHPC/PDTR/SBAVSMC hwmon sensors on J716c.Tested: Host and live hardware at
c7b2476fe420(full details, hashes, and earliere0bd1a6d676a/3bb25a5e6550runs in Evidence):W=1 ARCH=arm64 LLVM=1(defconfig+asahi.config,CONFIG_RUST=n)0errors /0warnings inspmi.c,tps6598x.h,spmi-apple-controller.c(2pre-existing intipd/{core,i2c}.c);sn201202x-transport.py7/7;sn201202x-pmarm64 KUnit 37/37;dt_binding_check(apple,sn201202x.yaml) andcheckpatch.pl --strict --git 3bb25a5e6550..HEAD0/0/0.3545ebecb76f(5/10blob-identical,5/10hunks-present, default cmdline): 4sn201202xcontrollers ready,12apple_spmiEdge IRQs (78 -> 94 -> 110across 2×pm_test=platform),macsmc_hwmonPSTR/PHPC/PDTR/SBAVlive, 4×pm_test=devicesclean,0new tipd/spmi errors, 6-item smoke pass (aurora-peripherals.servicewarm-reboot baseline failure also on default/control).76649338a1bc(3/8runtime blob-identical, 5t6050-*.dts(i)hunks-present, default cmdline +panic=10):1-08/1-0a/1-0cbound,9apple_spmiEdge IRQs (15 -> 17 -> 19 -> 21across 3×s2idle),0tipd/spmi errors, 8-item smoke pass (0failed units,0AppArmor denials).Risk: one-way door · expands
apple,sn201202x.yamlDT binding (3-IRQ layout whenselectis absent); T6050 boards (sharednub_spmi_a0/nub_spmi_a1IRQ and fault-queue properties) andsn201202xselect-polled / legacy fully polled payload-length read paths (J713/T8132/T8152/T6050); port IRQs and SMC hwmon keys on J716c.Revert:
git revertrestores polled T6050 SPMI/HPM defaults, removes the J716c SMC hwmon sensor nodes, and restoresapple,sn201202x.yamlandspmi.cwith 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:
s2idle/deepS2R and Type-C partner/dock persistence atc7b2476fe420onJ716c(apple-pmu-rtccannot wake J716c, and no dock/USB-C partner was attached on the 2026-11-28 pass; earliere0bd1a6d676averified Type-Cport0partner + AC charger persistence acrosspm_test=deviceson J716c, and3bb25a5e6550passed docked with a CalDigit TS5 across 2×s2idle+ 2×deepS2R) andJ713Type-C partner/dock persistence acrosss2idleatc7b2476fe420(no dock/partner was attached on the 2026-11-28 J713 pass; earliere0bd1a6d676averified CalDigit TS5 dock persistence across 3×s2idleon J713).deepS2R onJ713(M4 MacBook Air, T8132) oncemain's pre-existing J713 deep-sleep reset is fixed.apple,t8132-sn201202xDT (none in lab DTs; covered bysn201202x-transport.py) and other T6050 boards (J716s/J714s) not in this lab.Details
nub_spmi_a0andnub_spmi_a1fault-queue register windows (0x28a184000,0x28a1a4000),interrupt-controller,#interrupt-cells,interrupt-parent, and AIC interrupts (761onnub_spmi_a0,763onnub_spmi_a1) intot6050-die0.dtsi,t6050-max.dtsi,t6050-peripherals.dtsi, andt6050-j716s.dtsso all T6050 boards inherit interrupt-driven SPMI.apple,sn201202x.yaml3-interrupt (irq,sleep,wake) vs 4-interrupt (irq,select,sleep,wake) validation on the presence of the"select"interrupt name, and keyssn201202x_probe()select_polledon"select"being absent frominterrupt-namesrather than"apple,t8132-sn201202x".interrupt-namespresence separately insn201202x_select_irq_get()viaof_property_match_string(), so lookup errors (-EINVAL,-EOVERFLOW,-EPROBE_DEFER, etc.) propagate whenever"select"is declared instead of silently falling back toselect_polled, with KUnit coverage (sn201202x_select_irq_test) insn201202x-pm.__regmap_sn201202x_read(), keys register0x1fpayload-length validation onsn->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 register0x1fpayload-length checks for legacy fully polled T8132/T8152 DTs that omit interrupt resources."apple,t8132-sn201202x"fromhpm0,hpm1,hpm2, andhpm5int6050-j716c.dts, keeping the board-specificirq/sleep/wakeinterrupts andapple,sleep-ssps-rules, and exposesPSTR,PHPC,PDTR, andSBAVundersmc_hwmon.Evidence
Host checks at
c7b2476fe420make 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 (0errors;0warnings inspmi.c,tps6598x.h, andspmi-apple-controller.c;2pre-existing warnings in unrelatedtipd/core.candtipd/i2c.c).python3 -I tools/testing/selftests/drivers/apple/sn201202x-transport.py:7/7passed (1..7, includingok 5 - older SN201202x and IRQ-backed select transport behavior preserved,ok 6 - legacy fully polled T8132 payload-length check preserved, andok 7 - busy, missing-length, polled-T8132, IRQ-compat and oversize negative controls rejected).python3 -I tools/asahi/run-host-tests.py --only sn201202x:1/1passed (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/37passed (0skipped,0failed, includingsn201202x_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 (0errors)../scripts/checkpatch.pl --strict --git 3bb25a5e6550..c7b2476fe420:0errors,0warnings,0checks acrossb3e5081e5ba9,e3b8967905e3,e0bd1a6d676a, andc7b2476fe420.Earlier-head checks and live hardware at
e0bd1a6d676a(default command line; DT/YAML files byte-identical atc7b2476fe420)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 inspmi.c,sn201202x-pm-test.c,tps6598x.h, andspmi-apple-controller.c; 2 pre-existing warnings in unrelatedtipd/core.candtipd/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, includingsn201202x_select_irq_test)../scripts/checkpatch.pl --strict --git 3bb25a5e6550..e0bd1a6d676a: 0 errors, 0 warnings, 0 checks across all three commits.sn201202xcontrollers (1-08,1-0a,1-0c,2-0c) bound (port controller ready), 12apple_spmiEdge IRQs (3 each); across 2×pm_test=devicescycles (mem/freeze), IRQ counts advanced +2/cycle matching baseline; Type-Cport0partner and AC charger (tps6598x-source-psy-1-08) persisted (no dock attached);0post-boot tipd/spmi errors.1-08,1-0a,1-0cbound tosn201202x, 3apple_spmiEdge IRQs each; across 3×s2idlecycles, per-device IRQ counts advanced cleanly (+2/cycle:1 -> 3 -> 5 -> 7); Type-C partner and CalDigit TS5 dock stayedauthorized;0tipd/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_spmiEdge IRQs registered and firing for1-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 Voltagelive.s2idle+ 2×deepS2R resumed cleanly, 0 kernel errors; docked with CalDigit TS5 (40G USB4 +igcEthernet + dual 4K@240 displays).J716c (M5 Max, T6050, firmware 27.2) at
c7b2476fe420(2026-11-28)3545ebecb76f(origin/mainb897ccb4e71c+ 18 PRs,CONFIG_ARM_APPLE_SOC_CPUFREQ=m, AC power, default command line). Parity:c7b2476fe420is an ancestor;5/10changed files are blob-identical and5/10(fivet6050-*.dts(i)files) carry all PR hunks (0not provable).Image.gzSHA-256d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312,t6050-j716c.dtbSHA-256d2f0db7a5026ae9cc4e1cff61dca38b4d1b363d47e5bad696ef65c7d715517e0, modules SHA-2569d5782bcf02ea60a225278c9319431f902b495f6beb485d79d127c0fb2fccc92, one-shotaura-tryStage 2 SHA-256b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d(default Stage 221edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170, default kernelbf2582ab357573db64031f39e7bc9d617eb574c6b221364ff417810bbddf4c87, default DTBffe7604c98ad23849b2aff19eb161bec712f8b367a9bc87339fabb6d7dc1276cunchanged).sn201202x/ SPMI: all 4 controllers (1-08,1-0a,1-0c,2-0c) loggedport controller ready;12apple_spmiEdge IRQs registered in/proc/interrupts(105..107,134..136,168..170,171..173); summed IRQ counts78 -> 94 -> 110across 2×pm_test=platform;pm_test=devices2× freeze + 2× mem allrc=0,fail=0;6apple-spmi ... fault 0x6a100f0xlines at0.256 salso appear on the default boot (0new tipd/spmi errors). No dock or USB-C partner attached (DP-1..DP-6disconnected), and reals2idle/deepwas not run (apple-pmu-rtccannot 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.eDP-13456x2234@120enabled, 4 input devices,wlan00% loss,AppleJ716+AppleJ716HPAIenumerated (speakerguardd-v2active), BorealisApple M5 Max (G17C B1)+vkcube --c 180OK,0failed user units,0LSM denials,0Oops/BUG/fault;1warm-reboot baseline failed unit (aurora-peripherals.service, also fails on control and restored default);40err+lines all pre-existing vs55-line default boot exceptPM: suspend debugand 3 DPMSIOAVVideoInterface open failedsyslog lines.J713 (M4 Air, T8132) at
c7b2476fe420(2026-11-28)76649338a1bc(the J713 default kernel source8dbfa2895b93plus the heads of drm/asahi: g16 + t8132: scale CLPC memory states by GPU busy share #3491, arm64: dts: apple: t6050-j716c: wire HPM SPMI interrupts and SMC power sensors #3291, cpufreq: apple-soc: enable lazy verification fast-switch on T6050 #3397, drm/apple: enable static-frame idle caching on firmware 27 panels #3289, ASoC: apple: enable J716c (16-inch M5 Max) AOP audio, v2-only speakers, jack and mic array #3085, phy: apple: atc: enable runtime idle power-off on T8103 #3223, arm64: dts: apple: t6050: allow idle ps_isp_sys domain to power off #3329, PCI/ASPM: add sleep L1SS suppression and deferred D0 PM recheck #3495, thermal: apple-pmp: avoid P-core wakeups for cool idle polling #3546 and drm/asahi: g16: lower governed GPU floor from S3 to S2 #3548, with drm/apple: drive a two-display dock from the firmware-27.2 T8132 dcpexts #3273, drm/apple: soft power-off firmware-27 internal panel on DPMS off #3294 and serial: apple-dockchannel: stop idle console drain timer, back off RX, and add sleep PM #3335 already included; default command line pluspanic=10); the fivet6050-*DT files and the other changed files are blob-identical or carry every PR hunk (c7b2476fe420is an ancestor of the booted tree); this Mac's DTB SHA-256ceacf1d413c651396f4c1dfd9fa27b15c710dd849e46c2753fcff0a23a6681c6.e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491, one-shot Stage 2 SHA-256f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa(default Stage 2 and kernel untouched).1-08,1-0aand1-0cbound tosn201202x(3 controllers);apple_spmiEdge IRQs117-119,153-155,156-158(9); per-controller counts15 -> 17 -> 19 -> 21across 3xrtcwake -d rtc1 -m freeze -s 20(+2 per cycle);0tipd/spmi/sn201202x error lines; Type-Cport0-port2present; no partner or dock attached (boltctlTS5disconnected).eDP-12560x1664@60 enabled; no external monitor or dock attached), input (Apple MTP keyboard and trackpad devices enumerated, not exercised remotely), networking (wlan0connected, gateway ping 0% loss), permitted audio sink (speakerguardd-v2active, 1 s tone at -26 dB through the protected default sink, rc 0), GPU rendering (BorealisApple M4 (G16G B0), Vulkan 1.4.363,glmark2score 5,099),0failed units,0AppArmor denials (no SELinux on this userland).err-leveldmesg: the three lines the default kernel also logs (apple-dcp 30ae00000.dcp: AFK[ep:20]: failed to extract init props: -2,unsupported DFB layout 2560x1664 format=0x62336138 compression=3 (-22), anapple_sep ... matching unavailable this bootnotice) plus onebrcmfmac 0000:01:00.0: brcmf_pcie_ring_mb_update_rptr: ring 4: r_ptr 0 outside depth 0at 9.2 s (also observed on the default kernel boot).