Repository navigation
soc: apple: mcc: enable T8103 DCS dynamic clock and power gating - #3506
Conversation
On T8103 (M1), boot firmware leaves DCS_CTL bit 12 (dynamic power gating) clear on all eight DRAM channels (0x20020000c + ch * 0x40000), keeping all eight ps_dcs0..7 PMGR power domains permanently active at idle (0x1f0002ff) with WAS_PWRGATED=0. Support apple,t8103-mcc in apple-mcc by mapping the MCC broadcast aperture (reg[0]) and DCS channel aperture (reg[2]), asserting the broadcast low-power enable bits (0x30000000) and per-channel dynamic clock/power gating bits (0x1100) at probe, re-asserting them in resume_noirq after firmware-driven deep sleep, and restoring the pre-probe register values on remove or shutdown. Add a KUnit test covering enable, post-sleep reapply, and teardown restore. Signed-off-by: Erik Bourget <[email protected]>
Enable the memory-controller@200100000 node on J313 (M1 MacBook Air) so apple-mcc enables dynamic clock and power gating across all eight DCS channels, allowing ps_dcs0..7 to hardware power-gate at idle. 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: FINISH, then merge at a9ffde2a
Blockers:
host-testsCI failure (runs/46128744632):mcc-boot-dma-testsfails to compile againstdrivers/soc/apple/mcc.c(error: unknown type name 'resource_size_t','T8103_DCS_NCHAN' undeclared,implicit declaration of function 'apple_mcc_t8103_enable_lp'). Updatetools/asahi/mcc-boot-dma-tests.pysohost-testspasses cleanly.- Single-board DT gating (
arch/arm64/boot/dts/apple/t8103-j313.dts):&mcc { status = "okay"; };is enabled only on J313 even though MCC/DCS dynamic clock and power gating is a T8103 SoC block shared across all T8103 boards (t8103.dtsi: J313, J293, J274, J456, J457). Enable it int8103.dtsiinstead of per-board.dts(or document in the commit message why any other T8103 board cannot enable it).
Checked:
drivers/soc/apple/mcc.c&mcc-test.c: aperture bounds checks (bcast_res,dcs_resvsmin_dcs_size), probe save + enable,resume_noirqre-apply after firmware sleep,remove()/shutdown()restore of pre-probe values, and KUnitapple_mcc_test_t8103_dcs_lpare clean; J313 exact-head row PASS.- Checked for Apple material, tool attribution, and private serials: clean;
MERGEABLEonmain; humanSigned-off-bypresent.
Evidence
- Head:
a9ffde2aee76(base: main,mergeable: MERGEABLE,+161/-0across 3 files). - Non-blocking nit: in
drivers/soc/apple/mcc.c:196, preferof_device_get_match_data()(hardware match data onapple_mcc_of_match) over an inlineof_device_is_compatible(dev->of_node, "apple,t8103-mcc")branch inprobe().
Use of_device_get_match_data() in apple_mcc_probe() instead of an inline compatible check, and update tools/asahi/mcc-boot-dma-tests.py with the T8103_DCS_NCHAN, resource_size_t, and apple_mcc_t8103_enable_lp() stubs needed by its standalone PM harness. Signed-off-by: Erik Bourget <[email protected]>
Enable memory-controller@200100000 in shared t8103-peripherals.dtsi (included by t8103.dtsi) instead of only in t8103-j313.dts so all T8103 boards (J274, J293, J313, J456, J457) share DCS dynamic clock and power gating. Signed-off-by: Erik Bourget <[email protected]>
|
Addressed both blockers and the match-data nit from the review at
Local verification at
Hardware verification (2026-11-28 J313 M1 MacBook Air, T8103, Group A batched boot over
Open under
|
There was a problem hiding this comment.
Verdict: FINISH, then merge at 269a93f2
Blockers:
- Standalone J313 (
T8103) isolation & post-deep-wake ISP capture at269a93f2(noted under**Not yet:**): The Group A batched boot carrying#3506hit a post-deep-wake ISP capture failure (-19/DART fault) on J313 where baselinemainee36fbdcd1c8succeeded. Before merging, a standalone#3506(269a93f2) boot on J313 needs to verify DCS low-power gating and post-deep-wake ISP capture cleanly in isolation to confirm#3506did not cause the DART/ISP fault. - Hosted CI at
269a93f2: 28 queued CI jobs still need to finish green on this head.
Checked:
- Audited both new commits (
e771b28f,269a93f2) and the full 4-file diff (+170/-1); zero code blockers found — all prior review items froma9ffde2aare cleanly resolved:tools/asahi/mcc-boot-dma-tests.py: addsT8103_DCS_NCHAN,resource_size_t, and theapple_mcc_t8103_enable_lp()stub (6/6passing locally).arch/arm64/boot/dts/apple/t8103-peripherals.dtsi: dropsstatus = "disabled"on&mccacross all T8103 boards rather than gating per board (CHECK_DTBS=yclean across all 5 T8103 DTBs).drivers/soc/apple/mcc.c: usesof_device_get_match_data()(apple_mcc_t8103_data), validatesbcast_resanddcs_resaperture sizes, enables broadcast LP (0x30000000) and 8-channel DCS gating (0x1100), re-asserts inresume_noirqafter firmware sleep, and restores saved pre-probe register values onremove()/shutdown().
- Verified
apple_mcc_test_t8103_dcs_lpKUnit coverage (4/4passing locally) and PR text (What/Tested/Risktwo-way door/Revert/Not yet).
Evidence
drivers/soc/apple/mcc.c:apple_mcc_probe_t8103()checksresource_size(bcast_res) >= 0x008andresource_size(dcs_res) >= 7 * 0x40000 + 0x010beforedevm_platform_ioremap_resource(), andapple_mcc_remove()/apple_mcc_shutdown()restoredcs_ctl_saved[]andbcast_lp_savedwithwmb().arch/arm64/boot/dts/apple/t8103-peripherals.dtsi: single-line removal ofstatus = "disabled"covers all T8103 boards (J274,J293,J313,J456,J457).
There was a problem hiding this comment.
Verdict: FINISH at 269a93f2c856
Blockers: Please isolate the post-wake ISP failure before landing. In the reported J313 comparison capture worked on the first baseline wake and failed with a DART fault after the first batched wake. A standalone candidate and a matched first-wake control are needed to determine whether MCC gating contributes. Hosted validation remains due.
Checked: Verified the shared T8103 enable, hardware match data, and repaired host extract. Ran the unchanged host fixture successfully and confirmed that all five negative controls trip an assertion.
Evidence
The batch shows the intended MCC state and memory-integrity result, but cannot attribute the ISP failure to any one change.
|
Completed the matched first-wake standalone
In this matched first-wake isolation run, the post-deep-wake ISP/DART fault reproduced on unmodified baseline |
Conflicts: drivers/soc/apple/mcc.c main now describes each MCC with struct apple_mcc_hw match data and refuses a node without it. Fold the T8103 dcs_lp flag into that struct (apple_mcc_t8103_hw) in place of apple_mcc_match_data, and branch to the T8103 probe on hw->dcs_lp. Signed-off-by: Erik Bourget <[email protected]>
There was a problem hiding this comment.
The matched J313 first-wake control reproduces the ISP failure on unmodified main, with the same normalized error count in the standalone candidate. That addresses my earlier isolation request. Keep the current-head build, DT and host checks pending before landing the forward merge.
There was a problem hiding this comment.
Verdict: MERGE at 4e6f95332bbb
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: Code reviewed in the earlier App review at this head (6120958897).
Follow-ups (not blocking): current-head build, DT and host checks
|
Current-head (
On hosted CI at |
DjDeveloperr
left a comment
There was a problem hiding this comment.
The T8103 path validates both MMIO apertures before writing, saves the original values for teardown, and reapplies the bit masks after firmware sleep. The J313 candidate exercises those registers, deep resume and the memory canary. Related Apple build, DT and host checks passed.
What: Support
apple,t8103-mccindrivers/soc/apple/mcc.cto assert MCC broadcast low-power bits (0x30000000at+0x004) and per-channel DCS dynamic clock and power gating (0x1100at+0x00cacross all 8 channels) at probe, re-assert them inresume_noirqafter firmware-driven deep sleep, and restore pre-probe values onremove()/shutdown(). Enable&mccacross all T8103 boards inarch/arm64/boot/dts/apple/t8103-peripherals.dtsi(included byt8103.dtsi).Tested: Local host (
6/6), ARM64 KUnit (4/4),W=1compile (drivers/soc/apple/mcc.o), fullarm64kernel/DTB build,dt_binding_check,CHECK_DTBS=y(5 T8103 DTBs), andcheckpatch.pl --strictpass at current head4e6f95332bbb(details inEvidence). J313 (M1 MacBook Air,T8103) at current head4e6f95332bbbin a composite trial kernel (origin/main429e7e15f122+#3335,#3506,#3508,#3269,#3359,#3289;mcc.o.o/.textbyte-identical vs single-PR merge on429e7e15f122, default cmdline, docked TS5 +DP-2): PASS —"apple-mcc: DCS dynamic clock and power gating enabled on 8 channels",DCS_CTL0x070a1100x8 andps_dcs0..70x1f0003ffpre-sleep and after1x deepS2R (rtcwake -d rtc1 -m mem -s 30,success=1, wakeNUB.SPMI0Sw3IRQ), 16 MB RAM canary PASS across deep S2R,eDP-1DPMS x3 clean, GPU compute/render PASS,0failed units,0AVC denials,5err+lines identical to default boot (a subsequent post-resume ISPv4l2-ctlcapture hung in that composite session with cause unassigned). Earlier standalone isolation at269a93f2c856vs matched baselinemain(ee36fbdcd1c8) on J313 is inEvidence.Risk: two-way door · T8103 boards (J274, J293, J313, J456, J457).
Revert:
git revert -m 1 <merge-commit>removesapple,t8103-mccsupport fromdrivers/soc/apple/mcc.cand restoresstatus = "disabled"onmccint8103-peripherals.dtsi;remove()/shutdown()restore pre-probe register values and no persistent disk or firmware state is written.Not yet: Remaining queued hosted CI KUnit jobs at
4e6f95332bbb(and re-run of cancelledDWC3/ATC builtin-modular-atc); J313s2idlecoverage (hard-resets J313 on baselinemain, so only deep S2R with RTC wake was run); other T8103 boards not in local lab (J274,J293,J456,J457); SELinux-enforcing boot (test machine runs Arch without SELinux policy).Details
On T8103, boot firmware leaves
DCS_CTLbit 12 (dynamic power gating) clear (0x070a0100) on all eight DRAM channels (0x20020000c + ch * 0x40000), keeping all eightps_dcs0..7PMGR power domains permanently active at idle (0x1f0002ff,WAS_PWRGATED=0).sleep-t8103.halready enables the same0x1100mask during deep-sleep quiesce and restores saved values on wake, so enabling it at probe viaof_device_get_match_data()(apple_mcc_t8103_hwinstruct apple_mcc_hw) integrates cleanly with deep sleep and preserves the pre-probe register values forremove()/shutdown(). Removingstatus = "disabled"onmccint8103-peripherals.dtsi(included byt8103.dtsi) enables&mccacross all T8103 boards.Evidence
4e6f95332bbb(merge oforigin/maindbfbced70b31intofeat/t8103-mcc-dcs-lp; clean against currentorigin/maina171afd2123f):python3 -I tools/asahi/run-host-tests.py --only mcc-boot-dma: 6/6 passed (mcc-boot-dma-tests,--accept-unresolved,--ignore-detached-supplier,--final-skips-unresolved,--detach-retired-only,--resume-after-detach).python3 tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kconfig_add CONFIG_ARCH_APPLE=y --kconfig_add CONFIG_OF=y --kconfig_add CONFIG_APPLE_MCC=y --kconfig_add CONFIG_APPLE_MCC_KUNIT_TEST=y apple-mcc: 4/4 passed (apple_mcc_test_partial_enable,apple_mcc_test_quiesce,apple_mcc_test_not_ready,apple_mcc_test_t8103_dcs_lp).make LLVM=1 ARCH=arm64 W=1 drivers/soc/apple/mcc.o(defconfig+CONFIG_ARCH_APPLE=y,CONFIG_APPLE_MCC=y,CONFIG_APPLE_MCC_BOOT_DMA=y,CONFIG_APPLE_MCC_KUNIT_TEST=y) and fullarm64kernel/DTB/modules build (7.3.0+): clean (0 warnings indrivers/soc/apple/mcc.c).make LLVM=1 ARCH=arm64 dt_binding_check DT_SCHEMA_FILES=soc/apple/apple,t8140-mcc.yamlandmake LLVM=1 ARCH=arm64 CHECK_DTBS=y apple/t8103-j274.dtb apple/t8103-j293.dtb apple/t8103-j313.dtb apple/t8103-j456.dtb apple/t8103-j457.dtb: clean (0memory-controller@200100000orapple,t8140-mccwarnings).git diff dbfbced70b31..4e6f95332bbb | ./scripts/checkpatch.pl --strict -: 0 errors, 0 warnings, 0 checks (264 lines checked).4e6f95332bbb:apple-build,dt-checks,host-tests,kunit,rust-build,source,pr-text,DWC3/ATC builtin-no-atc,DWC3/ATC modular-no-atc,KUnit ane-boot,KUnit ane-pm,KUnit dcp-topology.KUnit dcp-fabricin progress (earlier run passed), remainingKUnit *jobs queued;DWC3/ATC builtin-modular-atccancelled.M1 MacBook Air,T8103) composite row at current head4e6f95332bbb(origin/main429e7e15f122+#3335,#35064e6f95332bbb,#3508,#3269,#3359,#3289;mcc.o.o/.textbyte-identical vs single-PR merge on429e7e15f122; GRUB one-shot, default cmdline, docked CalDigit TS5 +DP-23840x2160@120, AC 100%):0failed units,0AVC denials,5err+lines identical to default boot);apple-mcc: DCS dynamic clock and power gating enabled on 8 channels;DCS_CTL0x070a1100x8,ps_dcs0..70x1f0003ff.rtcwake -d rtc1 -m mem -s 30, ext display DPMS off first): PASS (success=1, wakeNUB.SPMI0Sw3IRQ), post-wakeDCS_CTL0x070a1100x8 andps_dcs0..70x1f0003ffheld; 16 MB RAM canary PASS across deep S2R;eDP-1DPMS x3 clean; GPU compute/render PASS. (Later in that composite session, post-resume ISPv4l2-ctlcapture hung with cause unassigned.)#3506vs baselinemain(ee36fbdcd1c8) ISP isolation on J313 (M1 MacBook Air, T8103, default cmdline, 2026-11-28 20:30–20:41 EST):main(ee36fbdcd1c8) control (kernel SHA-256f750b04aebd30c439edbd3b995c17b3fd9ad805a4561dadc7ecbf78040c89289, trial Stage 2 SHA-256ebf270451dfae099a118f68d98da0d2587ebb69d26affa48dac70a68e7844838):dcs_ctl: 0x070a0100x8;dcs0..2,4,6,7 0x1f0002ff,dcs3,5 0x1400024f.v4l2-ctl -d /dev/video0 --stream-mmap=4 --stream-count=90): PASS (during capture: 4 off-0, 14 on;after capture: 18 off-0; 0 ISP/DART errors).rtcwake -d rtc1 -m mem -s 15): post-wake 1 ISP capture failed withVIDIOC_STREAMON returned -1 (No such device), 1apple-dart 22c0e8000.iommutranslation fault at0x800b84000and 9 at0x800b84200(status:0x80000800 stream:0 code:0x800 (unknown)), andapple-isp 22a000000.isp: [isp_firmware_boot_stage1] never received first magic number from firmware(-19). Total29err+lines;1pre-#3449failed unit (speakerguardd-v2-switchtest.service).#3506(269a93f2c856merged ontomainee36fbdcd1c8;git diff 269a93f2c856empty on all 4 PR files before build) (kernel SHA-2565498ac1f6cbc852fe193c9c273b1a129c243c2f46420503ab12ff2433af53cc6, DTBt8103-j313.dtbSHA-256d0f5348b74eba08920267d5486fdb6b10d6632f3349958a70a357a2376873dfd, trial Stage 2 SHA-25619dd511922c8fdda13f021fa049111a8d9ad73134c4eb8da95c4b7655fcee6f6):apple-mcc 200100000.memory-controller: DCS dynamic clock and power gating enabled on 8 channels;dcs_ctl: 0x070a1100x8;dcs0..6 0x1f0003ff,dcs7 0x1000030f; 16 MB RAM integrity PASS (7845e4fcb640aecd); Borealis computePASS: 2603 runs in 3.0 s, 0 with wrong results, renderPASS: 1 runs, 0 wrong; pre-sleep ISP capture PASS (during capture: 4 off-0, 14 on;after capture: 18 off-0).rtcwake -d rtc1 -m mem -s 15): post-wake readback showeddcs_ctl: 0x070a1100x8 (dcs0..2,4..7 0x1f0003ff,dcs3 0x1400034f), 3x DPMS PASS (bad_dmesg_lines=0),0AVC denials, and the same post-wake 1 ISP failure (VIDIOC_STREAMON -1, 1 DART fault at0x800b84000, 9 at0x800b84200,apple-isp -19). Total29err+lines, all 29 messages matching the baseline control after removing timestamps; same1pre-#3449failed unit (speakerguardd-v2-switchtest.service).main(ee36fbdcd1c8) and no additional errors appeared in the standalone#3506run.mainee36fbdcd1c8(2026-11-28 earlier pass):888c041944da96032a9252504c4d5543b906fd98717234eca5e091150af85798949dc089ed390b7535dd5ef2a6e99975c3026658e58dbd9d17e9b20d2bbb7d71#3506(269a93f2c856) were verified byte-identical against standalone#3506(269a93f2c856) merged ontomain(ee36fbdcd1c8).apple-mccenabled DCS dynamic clock and power gating on 8 channels (DCS_CTL0x070a1100x8 vs baseline0x070a0100;dcs0..70x1f0003ffvs baseline0x1f0002ff), held across 2 deep S2R cycles (rtcwake -d rtc1 -m mem -s 30,0 -> 2, with one transientdcs6sample after the first), 16 MB RAM integrity PASS, DPMS off/on x3 PASS,0Oops/BUG/WARN,0AVC denials (one baseline failed unitspeakerguardd-v2-switchtest.servicealso present on baselinemain).a9ffde2aee76in batched candidate9885060f59b1overmainc6bf4998c83f(default kernel command line, one-shotaura-tryStage 2 DTB;0 Oops/BUG/WARN/SError):Live A/B on J313 at
a9ffde2aee76measured -20 mWPHPCmean / -11 mWPSTRmin at idle (0 Oops/BUG/WARN/SError).