Repository navigation
Conversation
Document the apple,t8103-pmgr-misc compatible for T8103 fabric-ps and dcs-ps scaling, keeping interconnect/OPP properties restricted to T600x. Signed-off-by: Erik Bourget <[email protected]>
Add support for apple,t8103-pmgr-misc with single-step p-state
transitions executed inside a single 64-byte cache line with IRQs
disabled so memory clock transitions cannot stall their own
instruction fetch.
- Validate initial BUSY, ACTUAL/DESIRED state, and every intermediate
DCS step against dcs_valid_states (BIT(3..6) on T8103, keeping
p-state 3 as the safe runtime floor).
- Default-enable idle fabric (p-state 1) and idle DCS (p-state 3) on
T8103 when no PMP node owns the rails and boot DCS is valid.
- Skip suspend_noirq/resume_noirq stepping on non-s2idle sleeps so the
T8103 deep-sleep engine owns DCS stepping undisturbed; verify live
active state on deep resume and roll back cleanly on s2idle error.
- Treat CPUs with <=5% busy utilization over >=50 ms as parked-idle so
default schedutil clusters parked at stale high frequencies still
allow idle scaling.
- Export apple_pmgr_gpu_tracking_{start,stop}() and
apple_pmgr_gpu_busy_{get,put}() so GPU backends whose ASC keeps
PS_GFX on while idle can report active work and synchronously raise
fabric and DCS before job publication.
- Add synchronized teardown via rwsem and delayed-work cancellation,
observational debugfs status, and KUnit coverage (33/33 tests pass).
Signed-off-by: Erik Bourget <[email protected]>
On T8103 with 27.2 GPU firmware, PS_GFX remains active while the ASC runs even when GPU cores are idle. Register GPU activity tracking with apple-pmgr-misc so idle fabric/DCS scaling can engage while no GPU jobs are running, synchronously raising fabric and DCS before staging and publishing compute or render work and releasing the hold once in-flight work drains or after firmware stops. Signed-off-by: Erik Bourget <[email protected]>
Add the pmgr_misc node (fabric-ps at 0x23b058000, dcs-ps at 0x23b05c000) to t8103.dtsi. Measured on J313 (M1 MacBook Air, T8103) under default schedutil: saves ~395 mW total (~118 mW fabric 4->1 and ~277 mW DCS 6->3) with full Borealis compute/render, s2idle, and deep S2R passing. 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. |
|
Moving back to draft after spotting a visual regression on J313 (M1 MacBook Air, T8103): With Likely either the |
…xplicit cmdline 0 Visual testing on J313 (M1 MacBook Air, T8103) showed that stepping DRAM DCS to p-state 3 while the internal 2560x1600 panel (disp0) is scanning out latches the display blank (backlight stays on and the screen does not recover when stepping back to p-state 4). Fabric p-state 1 with DCS p-states 5 and 4 keeps the display clean. Raise DCS_DEV_PSTATE_MIN_T8103 to 4 and narrow DCS_VALID_STATES_T8103 to BIT(4) | BIT(5) | BIT(6), update the T8103 KUnit expectations accordingly (including rejecting p-state 3 with -EINVAL), and track explicit module parameter writes so passing idle_fabric_pstate=0 or idle_dcs_pstate=0 on the kernel command line is not overwritten by hw defaults during probe. Signed-off-by: Erik Bourget <[email protected]>
|
Resolved in
|
…c-dcs # Conflicts: # drivers/gpu/drm/asahi/g14_v27_2.rs
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict at d9326f9: finish, then merge. The T8103 data is a per-compatible entry (apple,t8103-pmgr-misc), not a code gate, and the J313 rows look careful.
Blockers:
- Regression row on a second SoC. The new GPU busy get/put and the tracking start/stop calls in
g14_v27_2.rsreachapple_pmgr_raise_fabric()on every SoC that binds pmgr-misc, which includes T600x and T602x (t600x-die0.dtsi,t602x-die0.dtsi). They change when fabric/DCS go up and down under GPU load there, and only the J313 has run them. We will add a T6000 row (M1 Pro: boot, a GPU load, s2idle + deep, fabric/DCS read back) at this head. Please keep the head stable until it is posted. - pr-text is failing at this head. The fix is in the check output (body format); please fix it there.
Questions (answer on the PR):
DCS_DEV_PSTATE_MIN_T8103 = 4comes from a visual bisect: atdcs=3the internal panel latches blank. Does the J313 ADT describe a DCS floor for display scanout (pmgr perf-state or disp0 bandwidth properties)? If it does, read the floor from there. If it does not, please say so in the commit message so the next SoC knows to measure it.idle_dcs_pstateis a new module parameter. Nothing needs it set (the default comes from the per-compatible data), so it reads as a development knob next to the existingidle_fabric_pstate. Fine if it stays default-off and documented. Otherwise, consider dropping it before merge.
Checked:
apple_pmgr_find_pmp_node()only addsapple,t8103-pmpnext toapple,t6000-pmp-v2(a block compatible).- On SoCs without pmgr-misc (T8112), the new exports only count atomically and return 0.
- Single-step deep sleep is left to the sleep engine: no lowering in suspend_noirq on a non-s2idle target. The rollback on a partial set_pstate failure restores both devices.
- KUnit: 33/33 on the author's arm64 run, which covers the rejection of DCS 1-3.
|
|
|
Superseded by #3468 ( Key changes in #3468 addressing the review feedback here:
Leaving this PR untouched at |
|
Thanks for #3468; it takes all three review points (DT floors, no module parameter, hardening). Since #3468 carries this work, could you close this PR with a pointer to it? The review history and the J316s row stay readable on a closed PR. We have asked for a T6000 (M1 Pro) row at #3468 head 6588024 with SELinux enforcing and a failed-unit capture, the regression run its Not yet names. |
|
Superseded by #3468 (clean DCO-signed history on main with DT-driven fabric/DCS floors). |
Merge #3468 (6588024, superseding closed #3222) into the tiered active fabric/DCS scaling branch: - Adopt #3468's board-level DT floors (apple,fabric-min-pstate and apple,dcs-min-pstate), dropping hardcoded default_idle_fabric, default_idle_dcs, DCS_DEV_PSTATE_MIN_T8103, and the idle_dcs_pstate module parameter. When DT omits floors, both rails stay at boot clocks. - Preserve apple_pmgr_inst_sem locking, apple_pmgr_verify_active() unknown-rail tracking (U32_MAX), .prepare() error propagation, and -EAGAIN deferral in apple_pmgr_gpu_busy_get() while sleeping (via apple_pmgr_gpu_sleep_set()). - Step DCS back to active in apple_pmgr_raise_dcs() whenever dcs_now is already known-lowered, even if idle_dcs_pstate was cleared. - Combine #3468's KUnit coverage (including pf_dt_floors_test) with the tiered governor and GPU busy edge/rate-limit KUnit cases (41/41 pass). Signed-off-by: Erik Bourget <[email protected]>
What: Add
apple,t8103-pmgr-miscwith 64-byte single-cache-line single-step fabric (4 -> 1) and DRAM DCS (6 -> 4) idle ands2idlescaling plus GPU activity notification fromg14_v27_2, saving ~218 mW automatically under defaultschedutilon J313 while keeping internaldisp0scanout clean.Tested: J313 M1 MacBook Air at
d9326f973d88 (merged origin/main over verified 97a33f386c50; booted in candidate 7.3.0-j313ener2: 0 failed units, 3x s2idle + deep S2R clean)(default command line, defaultschedutil): boots cleanly with 0 failed units and visually verified crisp internaleDP-1display atfab=0x00000111 dcs=0x00000444, rejectsdcs=3with-EINVAL, passes 1xs2idleand 1xdeepS2R (boot object resumes 0 -> 1,GPU firmware 27.2 back in 2760 us,suspend_stats success=2 fail=0) returning tofab=0x00000111 dcs=0x00000444with screen visually intact; arm64 KUnitapple-pmgr-misc33/33 passed.Risk: two-way door · T8103 Macs (M1 Air/Pro/mini/iMac); shared
apple-pmgr-miscandg14_v27_2paths on T600x/T602x/T8112.Not yet: non-J313 T8103 / T600x / T602x / T8112 hardware runs.
Details
dt-bindings: addapple,t8103-pmgr-misctoapple,t6000-pmgr-misc.yaml(disallowing interconnect/OPP properties as ont6020).apple-pmgr-misc:apple_pmgr_perf_step()(40 bytes, zero memory accesses between write anddsb sy) and IRQ-disabledapple_pmgr_step_to()checking initialBUSY,ACTUAL/DESIRED, every intermediate state againstvalid_mask, and post-stepBUSY == 0 && ACTUAL == target.DCS_VALID_STATES_T8103 = BIT(4) | BIT(5) | BIT(6)andDCS_DEV_PSTATE_MIN_T8103 = 4. Visual testing on J313 showedfabric=1withdcs=6,5, and4keeps the 2560x1600 internal panel clean (-118 mWfabric4->1,-44 mWDCS6->5,-56 mWDCS5->4, ~218 mW total), while stepping DCS to3starves and latchesdisp0blank even after raising DCS back to4, and2->1resets the SoC while DRAM is live.idle_fabric_pstate = 1andidle_dcs_pstate = 4on T8103 when no PMP node (apple,t6000-pmp-v2/apple,t8103-pmp) owns the rails and boot DCS is valid, while tracking explicit parameter writes so passingidle_fabric_pstate=0oridle_dcs_pstate=0on the kernel command line is preserved.suspend_noirq/resume_noirqstepping on non-s2idlesleeps so the T8103 deep-sleep engine owns DCS stepping undisturbed; verify live active state on deep resume and roll back cleanly ons2idlestep failure.<= 5%busy over>= 50 ms) inapple_pmgr_cpus_at_min()so defaultschedutilclusters parked at stale high frequencies still allow idle scaling.apple_pmgr_gpu_tracking_{start,stop}()andapple_pmgr_gpu_busy_{get,put}()(protected byrwsemfor synchronized teardown on module unload).g14_v27_2: notifyapple-pmgr-miscviaIS_REACHABLE-equivalent#[cfg(any(CONFIG_APPLE_PMGR_MISC = "y", all(CONFIG_APPLE_PMGR_MISC = "m", MODULE)))], raising fabric and DCS before staging/publishing compute or render work and releasing once idle or after firmware stops.t8103.dtsi: addpmgr_misc: power-management@23b058000.Evidence
97a33f386c50(7.3.0-j313pmgrdbg, trial DTm1n1/boot-try-pmgrdbg.bin, default command line):2560x1600@60Hzpanel (eDP-1):fabric=1+dcs=6(good),dcs=5(good),dcs=4(good),dcs=3(latches screen blank, does not recover when raised back to4).97a33f386c50: 0 failed units,echo 3 > idle_dcs_pstaterejected (-EINVAL), 1xs2idlepassed (fab=0x00000111 dcs=0x00000444), 1xdeepS2R passed (boot object resumes 0 -> 1,GPU firmware 27.2 back in 2760 us,suspend_stats success=2 fail=0, returning tofab=0x00000111 dcs=0x00000444), internal display visually verified clean across boot and both wakes.eDP-1 @ 118/420,kbd=0,wifi_ps=off):fabric 4 -> 1:-118 mWPSTR (3.270 W -> 3.152 W),-72 mWPHPCdcs 6 -> 5:-44 mWPSTR (3.152 W -> 3.108 W)dcs 5 -> 4:-56 mWPSTR (3.108 W -> 3.052 W)fabric=1, dcs=4: ~218 mW saved at idle.97a33f386c50:tools/testing/kunit/kunit.py run --arch=arm64 --make_options=LLVM=1 --kunitconfig=drivers/soc/apple/apple-pmgr-misc.kunitconfig:Testing complete. Ran 33 tests: passed: 33.