Repository navigation
phy: apple: atc: enable runtime idle power-off on T8103 - #3223
Conversation
Enable runtime PM on apple_dpxbar_hw_t8103 so idle ATC power domains can power-gate when no external display output is routed or preselected. Run initial disconnect baseline writes while powered at probe, serialize UNK_TUNABLE restoration in runtime_resume, and guard both apple_dpxbar_set() and apple_dpxbar_preselect() with serialized runtime PM references. Signed-off-by: Erik Bourget <[email protected]>
Enable restore_after_pd_off and idle_power_off on apple,t8103-atcphy while keeping T8112/T600x/T602x fallback compatibles on the previous always-on behavior. Wrap atcphy_dp_configure() with runtime PM and restore_after_pd_off, guard apple_atc_dp_tunnel_rate() while idle in non-USB4/TBT modes, and mark pd_was_off on firmware-driven deep-sleep resume. Signed-off-by: Erik Bourget <[email protected]>
Remove apple,always-on from ps_atc0_pcie, ps_atc1_pcie, and ps_atc0_common now that the T8103 ATC PHY and display crossbar manage their power domains dynamically and restore state after power-off. Measured on J313 (M1 MacBook Air, T8103): all 10 idle ATC power domains drop to off-0 and stay off-0 across deep sleep, saving 116 mW median (235 mW average) at idle. Signed-off-by: Erik Bourget <[email protected]>
|
@erikwb checking open drafts today. To come out of draft, this still needs:
If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done. |
Parse every static const struct atcphy_hw definition in drivers/phy/apple/atc.c instead of a hardcoded 4-entry list so generation_scope() resolves atcphy_hw_t8103_always_on cleanly. Signed-off-by: Erik Bourget <[email protected]>
Signed-off-by: Erik Bourget <[email protected]>
tb_tunnel_dp() calls tb_dp_tunnel_notify(tunnel, true) even when
tb_tunnel_activate() returns -EINPROGRESS (leaving
tb_tunnel_is_active(tunnel) false while DPRX negotiation runs, or when a
second DP-IN adapter has no free display pipeline). On T8103, that maps
the DP-IN block and starts the 20 ms apple_dpin_poll_fn() worker.
tb_stop() previously skipped tb_dp_tunnel_notify(tunnel, false) for
inactive DP tunnels, leaving apple_dpin_poll_fn() armed across
apple_cio_release_domains(). Once ps_atc{0,1}_pcie are no longer
apple,always-on, ps_atc{0,1}_common power off during ACIO teardown and
the next poll panics with an SError in apple_dpin_irq_dispatch().
Notify the host glue for every DP tunnel in tb_stop() before tearing it
down, serialize poll re-arming under c->lock, drain in-flight DP-IN
IRQ/poll handlers in apple_dpin_down() and apple_cio_remove_children()
before unmapping or releasing power domains, and run the optional
PCIe-C reset in apple_cio_start() after powering on ACIO's domains so
the synchronous PMGR reset is clocked.
Signed-off-by: Erik Bourget <[email protected]>
…_ptr In apple_dpxbar_set(), running while (rpm_puts--) before checking need_mmio underflowed rpm_puts to UINT_MAX whenever a selected output disconnected, leaving the final put loop one put short and pinning ATC_USB/ATC_COMMON on after the first disconnect. Disconnect through MMIO whenever either rpm_held or rpm_preselect is set, and drop the runtime PM references only in the final put loop. Also register apple_dpxbar_pm_ops with pm_ptr() instead of pm_sleep_ptr() so runtime_resume still runs under CONFIG_PM=y with CONFIG_PM_SLEEP=n. Signed-off-by: Erik Bourget <[email protected]>
|
@RyanTheTide Thanks for the check — updated and marked ready for review at
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…oweroff # Conflicts: # drivers/phy/apple/atc.c
Signed-off-by: Erik Bourget <[email protected]>
There was a problem hiding this comment.
Verdict: Changes requested at a4ce4eee97be pending the integration rows.
The current head moves PCIe-C reset ordering in shared Apple USB4 code as well as gating T8103 rails. Earlier J313 rows show idle power and docked reboot, but do not cover the physical TS5 unplug/replug or current integrated undocked deep wake. Please run both on the final kernel, verify display, Ethernet and PCIe tunnel recovery, and include a non-T8103 USB4 peer for the moved reset order. Hosted build, DT checks and host tests are green. The existing exact compatible matches preserve the always-on behavior on older fallback users.
Add the optional boolean apple,idle-power-off property indicating that the PHY's consumers and platform power-domain hierarchy support runtime idle power-off and state restoration. Signed-off-by: Erik Bourget <[email protected]>
Remove the duplicate atcphy_hw_t8103_always_on table and fallback compatible match entries for apple,t8112-atcphy, apple,t6000-atcphy, and apple,t6020-atcphy. Instead, check in atcphy_probe() via atcphy_can_idle_power_off() that the PHY supports state restoration after power loss, either defaults runtime idle power-off on for existing DTs (T8132) or explicitly advertises the apple,idle-power-off DT capability, and has a DT power-domain hierarchy that can drop (neither the attached domain nor all of its parent domains carry apple,always-on). Requiring the positive DT capability prevents T8112 ATC1 (where ps_atc1_common lacks apple,always-on while its ps_atc1_pcie child retains it) and older T8103/T8112/T600x/T602x DTs from enabling runtime PM prematurely. Also drop the redundant idle_power_off check in atcphy_sleep_lost_common(), since atcphy_hw_t8103 already sets sleep_drops_common, and add an OF overlay KUnit test covering T8112 ATC1 (with and without apple,idle-power-off), T8103 with and without the capability, always-on parent domains, T8132 compatibility, and T8152 without state restore. Signed-off-by: Erik Bourget <[email protected]>
|
Completed the exact-head (
Remaining open items stay under |
Resolve the conflict in drivers/phy/apple/atc.c with main's atcphy_dp_stop(): keep main's function, and since this branch lets DisplayPort PHYs runtime-suspend when idle, take the runtime PM reference around the link rate 0 stop in atcphy_dpphy_configure() the same way as around atcphy_dp_configure(). Signed-off-by: Erik Bourget <[email protected]>
There was a problem hiding this comment.
Verdict: FINISH at 404ef7e
Checked: The forward merge keeps main's DP stop and brackets it with runtime PM, returning early if the get fails and putting the reference even if stop fails. The DT opt-in remains scoped.
Blocker: The reported J313 deep wake was undocked. Please exercise dock unplug/replug after idle on J313 and the live-tunnel reset on a J713 with this head, plus hosted CI.
Signed-off-by: Erik Bourget <[email protected]>
|
J313 docked test at I repeated the physical cable cycle on the same J313 daily base, with ( The J313 kernel build and all 43 focused host checks passed. The docked J713 live-tunnel check at this head is still open. |
There was a problem hiding this comment.
Verdict: HOLD at 033e01db
Blockers:
- Docked
J713(T8132) live-tunnel PCIe-C reset and recovery verification at033e01dbremains open (prior docked J713 result was at096fa49abefore subsequent merges withmain, and this PR modifies sharedapple_cio_start()PCIe-C reset ordering andtb_stop()/apple.cDP-IN teardown). - Hosted CI workflows (
Apple build and KUnit,Host tests,Device tree checks) are still queued at033e01db.
Checked:
- Forward merge
033e01dbontomainand full 15-file diff (+483/-60): zero code regressions introduced. drivers/mux/apple-display-crossbar.c: verifiedrpm_held/rpm_preselect/probedrefcount balance acrossapple_dpxbar_set(),apple_dpxbar_preselect(), andapple_dpxbar_probe(), with allpm_runtime_put()calls outsidedpxbar->lockandapple_dpxbar_runtime_resume()wired viapm_ptr(&apple_dpxbar_pm_ops).drivers/phy/apple/atc.c+atc-test.c+atc-idle-pm-test.dtso: verifiedatcphy_can_idle_power_off()/atcphy_pd_can_power_off()keep non-T8132 platforms (including T8112 ATC1) runtime-active unlessapple,idle-power-offis present and the power-domain hierarchy can drop;atcphy_dpphy_configure()brackets bothatcphy_dp_stop()andatcphy_dp_configure()withatcphy_rpm_get()/put().drivers/thunderbolt/tb.c+drivers/thunderbolt/apple.c: verified unconditional DP tunnel notify ontb_stop(), serialized poll re-arm underc->lock, IRQ/poll drain beforeiounmap()andof_platform_depopulate(), andapple_cio_start()resetting PCIe-C after power-domain links come up withgoto remove_linkserror cleanup.- Exact-head
033e01dbJ313 docked TS5 physical replug and matched daily-base A/B (07aa51ebvscfa98b5c) satisfies the prior J313 docked replug ask (USB4/PCIe/2.5GbE recover cleanly, 10/12 vs 6/12 ATC domains drop at idle, and the external display/docked-sleep behaviors match the control arm).
Evidence
- No code defects found at
033e01db. Ready to upgrade once the docked J713 (T8132) live-tunnel PCIe-C reset row and hosted CI finish green at head.
|
The J313 docked display teardown and wake issue is addressed by #3523 and #3655. With both patches on the J313 daily ( The separate J713 live-tunnel PCIe-C reset check for #3223 is still open. |
|
J713 docked PCIe-C reset and live-tunnel check passed at The unused ATC0 PHY stayed suspended with all six idle domains off. No SErrors, kernel panics, oopses, or failed units were observed. |
There was a problem hiding this comment.
Verdict: MERGE at 033e01db826d
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Forward merge 033e01db onto main and full 15-file diff (+483/-60): zero code regressions introduced.
drivers/mux/apple-display-crossbar.c: verifiedrpm_held/rpm_preselect/probedrefcount balance acrossapple_dpxbar_set(),apple_dpxbar_preselect(), andapple_dpxbar_probe(), with allpm_runtime_put()calls outsidedpxbar->lockandapple_dpxbar_runtime_resume()wired viapm_ptr(&apple_dpxbar_pm_ops).drivers/phy/apple/atc.c+atc-test.c+atc-idle-pm-test.dtso: verifiedatcphy_can_idle_power_off()/atcphy_pd_can_power_off()keep non-T8132 platforms (including T8112 ATC1) runtime-active unlessapple,idle-power-offis present and the power-domain hierarchy can drop;atcphy_dpphy_configure()brackets bothatcphy_dp_stop()andatcphy_dp_configure()withatcphy_rpm_get()/put().drivers/thunderbolt/tb.c+drivers/thunderbolt/apple.c: verified unconditional DP tunnel notify ontb_stop(), serialized poll re-arm underc->lock, IRQ/poll drain beforeiounmap()andof_platform_depopulate(), andapple_cio_start()resetting PCIe-C after power-domain links come up withgoto remove_linkserror cleanup.- Exact-head
033e01dbJ313 docked TS5 physical replug and matched daily-base A/B (07aa51ebvscfa98b5c) satisfies the prior J313 docked replug ask (USB4/PCIe/2.5GbE recover cleanly, 10/12 vs 6/12 ATC domains drop at idle, and the external display/docked-sleep behaviors match the control arm).
Follow-ups (not blocking): docked J713 live-tunnel PCIe-C reset row, queued CI
|
Merging at |
What: Enable runtime idle power-off for idle USB-C/ATC PHYs (gated on the positive
apple,idle-power-offDT capability or existing T8132 default, plus a droppable DT power-domain hierarchy) and T8103 display crossbars, dropapple,always-onfromps_atc0_pcie,ps_atc1_pcie, andps_atc0_commonon T8103 so idle ATC domains power down tooff-0, and fix Apple DP-IN teardown ontb_stop()plusapple_cio_start()PCIe-C reset ordering so inactive DP tunnels cannot trigger an unclocked MMIO SError once ATC domains power off.Tested: J313 (M1 Air, T8103) at
033e01db826dbooted with a CalDigit TS5 on the default command line. Physical replug after idle restored USB4, PCIe, USB hubs and 2.5 Gb/s Ethernet. External display recovery was intermittent. The daily A/B reproduced a display replug failure without this PR and reproduced the same docked sleep abort on both arms. The J313 kernel build and 43 focused host checks passed. J713 (M4 Air, T8132) at033e01db826dpassed the docked live-tunnel PCIe-C reset check. The TS5 Ethernet controller enumerated after reset and passed 3/3 gateway pings at 2.5 Gb/s.Risk: one-way door (adds the
apple,idle-power-offDT binding) · T8103 Macs (USB-C, USB4, DisplayPort alt-mode) and Apple USB4 hosts (sharedtb.c/thunderbolt/apple.cDP-IN teardown andapple_cio_start()PCIe-C reset ordering); T8112 (including ATC1 whereps_atc1_commonlacksapple,always-onwhileps_atc1_pcieholds it), T600x, and T602x ATC PHYs stay runtime-active unless they explicitly advertiseapple,idle-power-offand their display crossbars remain non-runtime-PM, older T8103 DTs keep their ATC PHYs runtime-active unless they explicitly advertiseapple,idle-power-off(while T8103 display crossbars enable runtime PM by compatible), and T8132 keeps its existing default runtime PM behavior.Revert:
git revert -m 1the merge commit onmain; restoringapple,always-ononps_atc0_pcie,ps_atc1_pcie, andps_atc0_commonand droppingapple,idle-power-offfromt8103.dtsireturns T8103 ATC PHYs and domains to always-on. External DTBs that already carryapple,idle-power-offkeep the property harmlessly ignored after reverting the driver.Not yet: Hosted checks at the current head.
Details
dt-bindings: phy: apple,atcphy:apple,idle-power-offproperty indicating that the PHY's consumers and platform power-domain tree support runtime idle power-off and state restoration.apple-display-crossbar:.runtime_pm = trueonapple_dpxbar_hw_t8103and register PM ops withpm_ptr(&apple_dpxbar_pm_ops)(SYSTEM_SLEEP_PM_OPS+RUNTIME_PM_OPS) soruntime_resumeruns underCONFIG_PM=yregardless ofCONFIG_PM_SLEEP.devm_mux_chip_register()(dpxbar->probed = trueafterwards) so initial disconnect baseline writes clear any stale bootloader route before suspending.UNK_TUNABLEin serializedapple_dpxbar_runtime_resume().apple_dpxbar_set()andapple_dpxbar_preselect()underdpxbar->lock(rpm_heldandrpm_preselectbitmasks) with temporary RPM references bracketing every MMIO access and balanced disconnect puts.phy-apple-atc:.restore_after_pd_off = trueonatcphy_hw_t8103without duplicatingatcphy_hwtables or compatible gates, and select runtime PM (idle_rpm) inatcphy_probe()viaatcphy_can_idle_power_off().atcphy_can_idle_power_off()requireshw->restore_after_pd_off, eitherhw->idle_power_off(preserving existing runtime PM on older T8132 DTs) or explicitapple,idle-power-offin DT, andatcphy_pd_can_power_off()(neither the attached domain nor all of its parent domains carryapple,always-on). This keeps T8112 ATC1 (whoseps_atc1_pciechild carriesapple,always-onoutside the PHY's parent walk) and older T8103 DT ATC PHYs runtime-active unless explicitly capable.atcphy_dpphy_configure()aroundatcphy_dp_configure()withatcphy_rpm_get()/atcphy_rpm_put(), and callatcphy_restore_after_pd_off()underatcphy->lock.apple_atc_dp_tunnel_rate()whenatcphy->idle_rpmis active outsideAPPLE_ATCPHY_MODE_USB4/APPLE_ATCPHY_MODE_TBT.atcphy_test_idle_power_off_dt/atc-idle-pm-test.dtso) covering T8112 ATC1 (with and withoutapple,idle-power-off), T8103 with and without the capability, always-on parent domains, T8132 compatibility, and T8152 without state restore.thunderbolt(tb.c,apple.c):tb_dp_tunnel_notify(tunnel, false)) for every DP tunnel intb_stop()(including-EINPROGRESS/ inactive tunnels waiting for a display pipeline) before tearing it down.apple_dpin_poll_fn()re-arming underc->lockand drain in-flight DP-IN IRQ/poll handlers (synchronize_irq/cancel_delayed_work_sync) inapple_dpin_down()andapple_cio_remove_children()before unmapping or releasing power domains, preventing an SError inapple_dpin_irq_dispatch()whenps_atc{0,1}_commonpower off during ACIO teardown.acio->pcie_resetinapple_cio_start()after creating device links toacio->pd_listso the synchronous PMGR reset is clocked when PCIe-C's domain was idle power-gated.t8103.dtsi/t8103-pmgr.dtsi/t8103-jxxx.dtsi: addapple,idle-power-off;onatcphy0andatcphy1, and dropapple,always-onfromps_atc0_pcie,ps_atc1_pcie, andps_atc0_common.tools/asahi: updateatc-usb3-tests.pyto parse allstruct atcphy_hwtables dynamically, stubatcphy_rpm_get/putinatc-dp-drive-tests.py, and stubapple_dpin_ctxdrain helpers inpciec-policy-tests.py.origin/main(ee36fbdcd1c8) at676f24e8883c: resolved the single kernel-doc comment conflict indrivers/phy/apple/atc.c(struct atcphy_hw: kept both@idle_power_offand@no_ss_device).#3554(fix/dp-external-sleep) also touchesdrivers/phy/apple/atc.c, addingatcphy_dp_stop()onatcphy_dpphy_configure()case 0:. If#3223merges before#3554,#3554will needatcphy_rpm_get()/atcphy_rpm_put()aroundatcphy_dp_stop()(or to routecase 0:through the RPM-guarded block inatcphy_dpphy_configure()) so stopping a DP link cannot touch registers while suspended.#3551(feat/dt-complete-t8103) also editst8103.dtsiandt8103-jxxx.dtsiin non-overlapping nodes (aop/ peripherals vsatcphy0/atcphy1and&ps_atc0_common).#3506,#3507, and#3508are independent T8103 idle-power PRs in separate subsystems (mcc,asahi,pmgr-misc).Evidence
J713 (M4 Air, T8132), exact PR head
033e01db826d, docked CalDigit TS5 on ATC1: Standalone kernel and matching J713 DTB from the same commit, default command line, one-shot GRUB and Stage 2.409ac0000.ciologged PCIe-C reset before ACIO start at 5.45 s and PCIe-C tunnel population at 7.54 s. The TS5 was authorized at USB4 Gen 4, its I225-LMvP PCIe endpoint enumerated, and its Ethernet linked at 2500 Mb/s with 3/3 gateway pings. ATC0 PHY stayed suspended with its six idle domains off. No SErrors, kernel panics, oopses, or failed units were observed.J313 (M1 Air, T8103) exact head
033e01db826d, TS5 on ATC1: Both PHYs suspended and all 12 idle ATC domains wentoff-0with the cable out. On reconnect the dock was authorized at USB4 Gen 4, PCIe-C reset and repopulated, its I225 endpoint and USB hubs enumerated, and Ethernet returned at 2500 Mb/s with 3/3 gateway pings. DP-2 recovered at 3840×2160@120 on the diagnostic boot (default command line plusearlycon=efifb ignore_loglevel panic=10). On the default-command-line run DP-2 stayed disconnected after replug. With the TS5 connected and DP-2 in that state, onertcwake -d rtc1 -m mem -s 15completed with suspend counters 1 success / 0 failures, PCIe-C rebuilt and Ethernet returned. The matchingmaindbfbced70b31booted docked and aborted its sleep attempt with the display active at271c00000.dcp(-EBUSY).J313 daily A/B on the default command line: Same daily source
ee2c37398e47, config, Stage 2 base, TS5 and port. Controlcfa98b5c05b6reverts the older phy: apple: atc: enable runtime idle power-off on T8103 #3223 integration. Patched07aa51eb92eaapplies the current PR delta to that control, retaining the daily's existing DP link-rate-zero behavior in both arms. With DP-2 active, both arms aborted a docked deep-sleep attempt at271c00000.dcp(-EBUSY) and recovered Ethernet. During physical disconnect, at the 15-second snapshot, 6/12 ATC domains were off on the control and 10/12 on the patched arm. Both recovered USB4, PCIe and 2500 Mb/s Ethernet with 3/3 gateway pings on reconnect. DP-2 stayed disconnected on both arms. No SErrors or kernel panics were observed during the cable cycles.Host checks at
033e01db826d: ATC 8/8, PCIe-C 1/1, Thunderbolt 4/4, T6030 12/12, G17 owed-stamp 18/18.Earlier verification: Exact head
676f24e8883cpassed standalone J313 (M1 Air,T8103) undockeddeepS2R and matched coulomb-meter idle-power A/B, batched J713 (M4 Air,T8132) undocked idle smoke (76649338a1bc), and builds, DT checks, host tests, and localapple-atc/apple-dpinKUnit:J313 (
M1 Air,T8103, 27.2) exact-head676f24e8883cundockeddeepS2R & smoke: PASS —apple,idle-power-offpresent on both PHYs, both PHYssuspended(control=autopre-sleep) and all 12 idle ATC domainsoff-0(atc{0,1}_usb_aonon) before and after 1xdeepS2R (rtcwake -d rtc1 -m mem -s 15), Borealis compute (2682runs,0wrong) and render (1run,0wrong) pass,3xDPMS pass (0bad dmesg lines),0AVC denials,1pre-existing failed unit (speakerguardd-v2-switchtest.service), and all14err+messages also appeared with the same counts in the baselinemainee36fbdcd1c8first-wake ISP control (29err+total; the other15baseline lines were DART/ISP faults from a camera-capture step not run here).J313 (
M1 Air,T8103, 27.2) exact-head676f24e8883cvsmainee36fbdcd1c8coulomb-meter idle-power A/B (macsmc-battery/charge_counter, SMCBAACin mC,Discharging,backlight=130,kbd=0, 45 s settle + 2x 60 s): logged windows3380.1 mW(win1) and3327.3 mW(win2, mean3353.7 mW, all 12 idle ATC domainsoff-0) vs matchedmain3441.2 mW(win1) and3448.5 mW(win2, mean3444.9 mW,atc{0,1}_{common,pcie,usb}on; recalculated pre-test baseline3423.7 mW) —-61.1 mW(win1),-121.2 mW(win2),-91.2 mWtwo-window mean (scoped to idle power and ATC domain states;11vs10err+lines and1failed unit per arm were not diffed per line).J713 (
M4 Air,T8132, 27.2) undocked idle smoke (76649338a1bc,676f24e8883can ancestor,8/11runtime files byte-identical, default cmdline +panic=10): PASS —phy-apple-atcbound, Type-Cport0..2registered,atc0_usb/atc1_usboff-0(*_aonon, USB controllers runtime suspended),atc1_cio_usb/atc1_cio_pcieoff-0,0ATC/Type-C/TIPD errors,0failed units.Builds, DT checks, host tests, and KUnit at
676f24e8883c: PASS locally (apple-atc62/62,apple-dpin112 passed / 1 skipped) and in completed hosted CI (apple-build,dt-checks,host-tests,pr-text, plus 8 KUnit suites); pre-merge096fa49a721bdocked J713/J313 rows and earlier historical rows retained in Evidence.J313 (
M1 MacBook Air,T8103, firmware 27.2) exact-head676f24e8883cundockeddeepS2R & smoke (2026-11-29):676f24e8883c, default command line (rw rootflags=subvol=root plymouth.ignore-serial-consoles user4k=on loglevel=4 console=tty0),vmlinuzsha256a400a23370fc7bc599fe43fc9e9b12dfa35b918e90015efedcaa0c5bfb37514d, one-shotaura-tryStage 2 (sha2563901ddb693a2e62f502ee9197915369512995f974fa8ec78cfc94c8fb2716a0b, carrying676f24e8883c'st8103-j313.dtb,aura-tryspent; default Stage 21262bc5de585fc57e34c36f10560522d4b231be4f9ac7e45066bc4e364f95484untouched).phy@383000000andphy@503000000both exposeapple,idle-power-off;383000000.phyand503000000.phyboth reportruntime_status=suspendedandcontrol=auto; all 12 idle ATC domains (atc{0,1}_{common,pcie,cio,cio_pcie,cio_usb,usb}) areoff-0withatc{0,1}_usb_aonon.compute-check 3PASS (2682 runs in 3.0 s, 0 with wrong results),render-checkPASS (1 runs, 0 wrong), 3x DPMS (eDP-1off/on, backlight0 -> 130,DPMS_RESULT PASS cycles=3 bad_dmesg_lines=0).rtcwake -d rtc1 -m mem -s 15, 1 cycle): resumed cleanly; both PHYsruntime_status=suspended; all 12 idle ATC domainsoff-0and bothatc{0,1}_usb_aonon;0AVC denials;1pre-existing failed unit (speakerguardd-v2-switchtest.service);14err+lines (2apple-dcpAFK[ep:20],8snd-soc-macaudioVSENSE/ISENSE,1fpwm1,1brcmfmacD3hot->D0,1hci_bcm4377D3hot->D0,1Bluetooth: hci0: power lost in the sleep, rebinding the driver). All14messages also appeared with the same counts in the baselinemainee36fbdcd1c8first-wake ISP control (29err+total; the extra15baseline lines were DART/ISP faults from a camera-capture step not run here; Wi-Fi and Bluetooth wake messages appeared in reverse order).J313 (
M1 MacBook Air,T8103, firmware 27.2) exact-head676f24e8883cvsmainee36fbdcd1c8coulomb-meter idle-power A/B (2026-11-29):Discharging,eDP-1backlight=130,kbd=0, same Stage 2 base (1.0.0b17-gc67db2a6, paired with each build'st8103-j313.dtb), 45 s post-boot settle followed by two consecutive 60 s windows reading/sys/class/power_supply/macsmc-battery/charge_counter(SMCBAAC, exported directly inmC = mA·sbydrivers/power/supply/macsmc-power.c, soP = (|Δcharge_counter| / Δt) × V_avg; per-window values use unroundedtime.monotonic()Δt, printed as60.00 s). Scoped to idle power and ATC domain states (11err+lines on head vs10on baseline,1failed unit in each arm; individual error lines were not diffed in this run).676f24e8883c(separate rebuild of676f24e8883c:vmlinuzsha256f249dca197e631383a0ec433b26e4f4bef4d2cb2336b4e7ac4d78a12155ceb6d,t8103-j313.dtbsha2569bb543fdf4e9d782f82dfa3c757bf61f569c5832d0b12ab70cf470435351151b, all 12 idle ATC domainsoff-0,atc{0,1}_usb_aonon,capacity=40%):60.00 s,-38205 -> -56166,ΔC = -17961 mC,V_avg = 11.2920 V):299.34 mA/3380.1 mW60.00 s,-56166 -> -73845,ΔC = -17679 mC,V_avg = 11.2930 V):294.64 mA/3327.3 mW3353.7 mW(nominal 120 s aggregate from summedΔC = -35640 mCand meanV = 11.2925 V: approx.3353.9 mW).mainee36fbdcd1c8(vmlinuzsha256f750b04aebd30c439edbd3b995c17b3fd9ad805a4561dadc7ecbf78040c89289,atc{0,1}_{common,pcie,usb}on,atc{0,1}_{cio,cio_pcie,cio_usb}off-0,capacity=39%):60.00 s,-26547 -> -44848,ΔC = -18301 mC,V_avg = 11.2825 V):305.00 mA/3441.2 mW60.00 s,-44848 -> -63193,ΔC = -18345 mC,V_avg = 11.2795 V):305.74 mA/3448.5 mW3444.85 mW(3444.9 mW; nominal 120 s aggregate from summedΔC = -36646 mCand meanV = 11.2810 V: approx.3445.0 mW).#3223(-21646 -> -39830,ΔC = -18184 mC,V_avg = 11.2970 V): recalculated303.07 mA/3423.7 mW(the raw script output for this earlier window mislabeledBAACasuAhand printed12325.3 mW, a3.6xfactor; corrected here from the saved counter delta and voltage).676f24e8883cvs matched 45 s-settledmainee36fbdcd1c8):-61.1 mW(win1),-121.2 mW(win2),-91.2 mW(two-window mean; approx.-91.2 mWnominal 120 s aggregate).J713 (M4 MacBook Air, T8132, 27.2) undocked idle smoke (
76649338a1bc,676f24e8883can ancestor, 2026-11-28, default cmdline +panic=10):e8e9fd2813dd6347176d0e4a55a70d1c694bdab75817c3ab83c441c203140491f7d4e2f7ebbfb423bd71f233f1aef7af0a39091b288a749d25f9250eb80adbfa(one-shotaura-try, default Stage 23b2d2f059858d1891b225910864c02d68afb1b42893667e0afa8666491651071untouched)t8132-j713.dtbSHA-256:ceacf1d413c651396f4c1dfd9fa27b15c710dd849e46c2753fcff0a23a6681c611/15PR files blob-identical,8/11runtime files blob-identical, and all PR hunks present in the remaining shared files (apple-display-crossbar.c,thunderbolt/apple.c,thunderbolt/tb.c, and a host test).phy-apple-atcbound; Type-Cport0..port2registered;atc0_usb/atc1_usbgenpdoff-0with*_aononand both USB controllers runtimesuspended;atc1_cio_usb/atc1_cio_pcieoff-0;0atc/typec/tipderror lines;0failed units;0AppArmor denials. (A separate one-offbrcmfmac 0000:01:00.0: brcmf_pcie_ring_mb_update_rptr: ring 4: r_ptr 0 outside depth 0line occurred once at 9.2 s and did not recur across 5×wlan0down/up and 5s2idlecycles; no PR in the batch touchesbrcmfmac.) No dock/external monitor was attached in this pass.Historical J313 sleep caveats (2026-11-28): An earlier attempt on baseline
mainee36fbdcd1c8became unreachable after a second consecutivedeepS2R cycle (requiring physical recovery), and baselines2idlehard-resets J313, so single-cycledeepS2R with RTC wake is the working sleep path exercised above.Build, DT, host-test, and KUnit verification at
676f24e8883c:make O=_build_w1 ARCH=arm64 LLVM=1 W=1 drivers/phy/apple/atc.o drivers/mux/apple-display-crossbar.o drivers/thunderbolt/apple.o drivers/thunderbolt/tb.o: clean compile (0non-kernel-doc warnings; only pre-existing kernel-doc warnings).make O=_build_dt ARCH=arm64 LLVM=1 DT_SCHEMA_FILES=Documentation/devicetree/bindings/phy/apple,atcphy.yaml dt_binding_check: clean (0errors,0warnings).make O=_build_dt ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t8103-{j313,j293,j274,j456,j457}.dtb apple/t8112-j413.dtb apple/t8132-j713.dtb: clean DTB builds with0warnings on ATC, crossbar, or PMGR nodes.python3 -I tools/asahi/run-host-tests.py:--only atc-(8/8passed),--only pciec-(1/1passed),--only tb-(4/4passed),--only t6030-(12/12passed)../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1:drivers/phy/apple/.kunitconfig.apple-atc(62/62passed, includingatcphy_test_idle_power_off_dt),drivers/thunderbolt/.kunitconfig.apple-dpin(112passed,1skipped forCONFIG_UCLAMP_TASK)../scripts/checkpatch.pl --strict --git origin/main..HEAD:0errors,2Missing commit descriptionwarnings on earlier host-test commits (bf4522c462b1,a4ce4eee97be), and1MAINTAINERSnew-file notice ondrivers/phy/apple/atc-idle-pm-test.dtso(covered bydrivers/phy/apple/).Pre-merge (
096fa49a721b, prior to forward-mergingorigin/mainee36fbdcd1c8) hardware reference rows (origin/mainaddeddpin0/dpin1AIC interrupts int8103.dtsi,no_ss_deviceinatc.c,QUIRK_NO_RETIMER_SCANinthunderbolt/apple.c, and droppedapple,always-onfromps_msgint8103-pmgr.dtsi;apple-display-crossbar.candthunderbolt/tb.care unchanged):096fa49a721bovermainef29ad17facb(standalone build, default cmdline, CalDigit TS5 onatc0,atc1empty):0failed systemd units), ACIO & USB4 tunnel bring-up:thunderbolt-apple-acio 401ac0000.cio: PCIe-C reset before ACIO start,thunderbolt 0-1: CalDigit, Inc. TS5(authorized=1,generation=4),PCIe-C populated after USB4 PCIe tunnel adapter enable.0001:03:00.0(I225-LMvP),enP1p3s0UP192.168.1.118/23,3/3ping to192.168.0.1(min/avg/max = 0.217/0.246/0.275 ms).0:5 <-> 1:11,0:6 <-> 1:19) timed out waiting for display pipeline readiness (expected without external DCP PRs onmain) and tore down with0observed SErrors.atc1(40aa90000.phy):runtime_status=suspended;atc1_common,atc1_pcie,atc1_cio,atc1_cio_pcie,atc1_cio_usb,atc1_usballoff-0(atc1_usb_aonon).rtcwake -d rtc1 -m freeze -s 8(s2idle): aborted atdwc3-apple 402280000.usb: PM: device_prepare(): genpd_prepare returns -11(pre-existing on docked J713; reproduced on patched J713 candidate0e0bb9323576);enP1p3s0recovered2500 Mbps Full Duplex(3/3ping0.243/340.990/1022.141 msmin/avg/max),0failed units,0SErrors. (rtcwake -d rtc1 -m mem -s 8rebooted the machine into its default kernel without an observed resume;ef29ad17facblacks J713 deep S2R.)096fa49a721bvsmainef29ad17facb(same kernel config/toolchain, default cmdline):mainef29ad17facb:383000000.phy&503000000.phyruntime_status=unsupported;atc{0,1}_{common,pcie,usb}allon(atc{0,1}_{cio,cio_pcie,cio_usb}off-0).096fa49a721b: live DT hasapple,idle-power-offonphy@383000000andphy@503000000; both PHYsruntime_status=suspended; all 12 idle ATC domains (atc{0,1}_{common,pcie,cio,cio_pcie,cio_usb,usb})off-0(atc{0,1}_usb_aonon),0failed units. (Instantaneouspower_nowreadings from that pre-merge run are omitted here in favor of the exact-head coulomb-meter A/B above.)deepS2R (rtcwake -d rtc1 -m mem -s 8) on096fa49a721b: resumed cleanly with0failed units, both PHYssuspended, and all 12 idle ATC domainsoff-0.096fa49a721bin batched candidateac44bee46ee4(main9e38a276dcb4, default cmdline):apple,idle-power-offpresent onatcphy0andatcphy1.atc0(383000000.phy):runtime_status=suspended;atc0_common,atc0_pcie,atc0_cio,atc0_cio_pcie,atc0_cio_usb,atc0_usballoff-0, both before and after adeepS2R.atc1(503000000.phy): TB5, 2.5 GbEenP1p3s05/5 ping at 0.255 ms, USB2/3,DP-23840x2160@120. AcrossdeepS2R:Switched dpin0 to disconnected -> dispext0,0,enP1p3s03/3 ping at 0.407 ms, 0 SErrors.096fa49a721bin batched candidateb3dbf237542b(main9e38a276dcb4):402a90000.phyand40aa90000.phyrpm=suspendedbefore and after 3xs2idle;401ac0000.cioand409ac0000.ciobound cleanly;atc0/1idle domainsoff-0; 0 errors.Historical J313 (M1 MacBook Air, T8103) rows (prior to
096fa49a721b; not claimed as head results):9fd40b4b5694(default command line, CalDigit TS5 onatc1,atc0empty): 0 failed systemd units, 0 kernel panics, 0 SErrors;0-1: TS5(authorized=1),card1-DP-2(2560x1440),enP1p3s0UP (2500 Mbps, 0% ping loss), USB2/USB3 hubs working; empty portatc0_usb/atc0_cio*/atc0_pcie/atc0_commonalloff-0whileatc1_*active; clean docked reboot throughtb_stop()/apple_dpin_down().pm_genpd_summarybefore and afterdeepS2R (boot object resumes 0 -> 1) showed all idle ATC domains (atc0_*,atc1_*)off-0(instantaneous power readings from that prototype omitted in favor of the exact-head coulomb-meter A/B above).