Skip to content

soc: apple: pmgr-misc: add T8103 DT-floored fabric and DCS scaling - #3468

Merged
DjDeveloperr merged 8 commits into
mainfrom
feat/pmgr-fabric-dcs
Dec 1, 2026
Merged

DjDeveloperr merged 8 commits into
mainfrom
feat/pmgr-fabric-dcs

Conversation

@erikwb

@erikwb erikwb commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What: Adds apple,t8103-pmgr-misc and optional board-verified apple,fabric-min-pstate / apple,dcs-min-pstate DT properties to apple-pmgr-misc, implements single-step T8103 fabric/DCS scaling with live-clock confirmation and g14_v27_2 GPU busy tracking, and enables J313 floors (<1> / <4>) while keeping unverified T8103 boards at boot clocks. Supersedes #3222 on a clean, DCO-signed branch over main.

Tested: J316s (T6000), J313 (T8103), and J716c (T6050) pass at 658802454cc5 (plus J716c batched smoke coverage of the shared stack with #3508; J313 Group B #3332+#3468 trial built/parity-checked, unbooted awaiting J313 recovery):

  • J316s (M1 Pro, T6000, shared apple-pmgr-misc + g14_v27_2 regression) at 658802454cc5 (reported by RyanTheTide in comment, combined guarded one-shot trial kernel with byte-identical PR files on exact default cmdline): PASS — PMP fabric/DCS scaling verified under deqp-vk and idle/post-sleep, s2idle 2/2, Borealis VK api.smoke 8/8 pre- and post-sleep, SELinux Enforcing, 0 AVC denials, 0 failed systemd units, 0 new pmgr-misc/asahi warnings or errors.
  • J313 (M1 MacBook Air, T8103) at 658802454cc5 (without DT floor properties): one-shot trial kernel with existing Stage 2 DT: PASS — retained boot clocks (4/6), rejected below-floor write with -EINVAL, Vulkan compute smoke, eDP-1 active, 0 Oops/BUG/WARN/SError (Arch ARM without SELinux; 1 unrelated failed unit speakerguardd-v2-switchtest.service outside main).
  • J313 (M1 MacBook Air, T8103) at 658802454cc5 (with compiled t8103-j313.dtb, fabric=1, dcs=4): one-shot Stage 2 trial: PASS — settled to DT floors (1/4), parameter writes stepped fabric, Vulkan compute raise/drop (4/6 <-> 1/4), 1x s2idle + 2x deep S2R with post-resume compute, eDP-1 active, 0 Oops/BUG/WARN/SError (Arch ARM without SELinux; systemctl --failed not captured on Boot 2).
  • J716c (M5 Max, T6050, unaffected SoC) at 658802454cc5: standalone one-shot trial kernel: PASS — clean boot, GPU init, eDP-1 connected, 2/2 pm_test=devices, 0 new failed units vs baseline (2 pre-existing unrelated units), 0 Oops/BUG/WARN/SError. Also included as smoke coverage of the shared stack under #3508 (6a2a13f7328e) in batched kernel 3545ebecb76f (include/linux/soc/apple/pmgr-misc.h is the sole byte-identical file; g14_v27_2.rs and apple,t6000-pmgr-misc.yaml have PR hunks present; 4 other files were further modified by #3508): 2 boots clean, 5-item smoke pass, 0 pmgr/display-power errors, 0 new failed units.
  • Host checks at 658802454cc5: 34/34 ARM64 KUnit (CONFIG_SUSPEND=y and CONFIG_SUSPEND=n), W=1 0 warnings on touched C/KUnit/Rust targets, apple-dt-check.sh 139/139 DTBs + binding ok, checkpatch.pl --strict 0/0/0 across all 4 commits.

Risk: one-way door · apple,t6000-pmgr-misc.yaml DT binding (apple,t8103-pmgr-misc, apple,fabric-min-pstate, apple,dcs-min-pstate), T8103 (J313 enabled; other T8103 boards retain boot clocks), T6000/T6020 (apple-pmgr-misc), G13/G14 (g14_v27_2 GPU tracking).

Revert: git revert -m 1 <merge-commit> (or revert the 4 commits); note the DT binding (apple,t6000-pmgr-misc.yaml) and t8103.dtsi/t8103-j313.dts schema/property additions are one-way once released in DTBs/bindings, while driver/GPU scaling reverts cleanly with no persistent disk or firmware state written.

Not yet: T6020 live hardware test (no T6020 hardware locally; T6000 J316s passed the full SELinux-enforcing, 0-failed-unit regression run at 658802454cc5), and hardware floor verification for other T8103 boards (t8103-j274, t8103-j293, t8103-j456, t8103-j457, which intentionally omit apple,fabric-min-pstate and apple,dcs-min-pstate and retain boot clocks).

Details

Summary of changes (4 commits over 61e791b30687)

  1. dt-bindings: soc: apple: pmgr-misc: add apple,t8103-pmgr-misc and floors
    • Adds apple,t8103-pmgr-misc and optional apple,fabric-min-pstate / apple,dcs-min-pstate properties.
    • Disallows OPP/interconnect properties on t8103/t6020 and makes apple,dcs-min-pstate mutually exclusive with operating-points-v2.
  2. soc: apple: pmgr-misc: add T8103 single-step DT-floored fabric/DCS scaling
    • Removes all hardcoded T8103 fabric/DCS floors from match data (dev_min_ps = { 0, 0 }). When a board omits either DT floor property, that rail stays at its boot p-state across runtime idle and s2idle.
    • Drops the idle_dcs_pstate module parameter so DCS idle scaling is strictly DT-driven.
    • Implements single-step (±1) T8103 transitions inside a 64-byte aligned ARM64 sequence (apple_pmgr_step_to()), requiring settled BUSY=0 && ACTUAL==DESIRED, validating initial and intermediate p-states against valid_mask, and confirming ACTUAL and DESIRED after each step.
    • Verifies live clock state (apple_pmgr_verify_active()) at probe, s2idle resume/rollback, and deep resume; leaves unconfirmed rails as U32_MAX so apple_pmgr_gpu_busy_get() confirms clocks before returning success.
    • Propagates apple_pmgr_idle_stop() failures out of .prepare and returns -EAGAIN from apple_pmgr_gpu_busy_get() while PMGR owns the sleep transition.
    • Serializes probe publication and idle_fabric_pstate validation under apple_pmgr_inst_sem and enforces the effective floor at both parameter write and runtime idle evaluation on all compatibles.
    • Adds 2 registered KUnit test cases (pf_t8103_gpu_tracking_and_step_test, pf_dt_floors_test) covering single-step validation, absent-floor retention, floor enforcement, s2idle/deep resume and rollback, and CONFIG_SUSPEND=n builds.
  3. drm/asahi: g14_v27_2: notify apple-pmgr-misc while GPU jobs are active
    • Wires apple_pmgr_gpu_tracking_{start,stop} and apple_pmgr_gpu_busy_{get,put} in g14_v27_2.rs, deferring publication via self.notify.retry() when PMGR returns -EAGAIN.
  4. arm64: dts: apple: t8103: add pmgr_misc node and J313 floors
    • Adds pmgr_misc (apple,t8103-pmgr-misc) to t8103.dtsi with no floors and sets apple,fabric-min-pstate = <1>; apple,dcs-min-pstate = <4>; in t8103-j313.dts.

Changes since #3222

  • Replaced hardcoded T8103 floors with board-level DT properties (apple,fabric-min-pstate, apple,dcs-min-pstate), retaining boot clocks when absent.
  • Dropped the idle_dcs_pstate module parameter.
  • Hardened single-step state validation, live-clock confirmation across probe/resume/rollback, prepare() error propagation, and probe/sysfs serialization.
  • Rebuilt cleanly onto main (61e791b30687) with DCO sign-offs on all 4 commits and no merge commits.

Companion / stacked PRs

  • aurora-silicon/linux#3508 (feat/t8103-pmgr-misc-disp-ps) and aurora-silicon/linux#3332 (feat/t8103-pmgr-active-scaling) stack on feat/pmgr-fabric-dcs and will be retargeted to main before #3468 merges (per branch policy, deleting a merged base branch closes PRs still stacked on it).
Evidence

Commits at 658802454cc5 (base 61e791b30687, merges cleanly with main)

  • b6cf68977c9d dt-bindings: soc: apple: pmgr-misc: add apple,t8103-pmgr-misc and floors
  • f67773085bad soc: apple: pmgr-misc: add T8103 single-step DT-floored fabric/DCS scaling
  • 076c43e88f33 drm/asahi: g14_v27_2: notify apple-pmgr-misc while GPU jobs are active
  • 658802454cc5 arm64: dts: apple: t8103: add pmgr_misc node and J313 floors

Hardware results at 658802454cc5

Board / SoC Configuration Result Key observations
J316s (M1 Pro, T6000) Combined guarded one-shot trial kernel (byte-identical PR files, default cmdline; RyanTheTide) PASS pmp_owned=1 voters_ok=1 holds=0 dcs_bw_active=0 gpu_tracked=0 gpu_busy=0, fabric_active=7 fabric_now=7 dcs_active=9 dcs_now=9 dcs_idle=0; fabric_ps/dcs_ps 0x00000bbb/0x00000777 under deqp-vk -> 0x00000333/0x00000666 settled idle & post-sleep; s2idle 2/2 (15s /dev/rtc1); Borealis VK api.smoke 8/8 pre- and post-sleep; SELinux Enforcing, 0 AVC denials, 0 failed units (systemctl --failed empty), 0 new pmgr-misc/asahi warnings or errors
J313 (M1 Air, T8103) Existing Stage 2 DT (no floor props) PASS (smoke) fabric_now=4 dcs_now=6 dcs_idle=0, idle_fabric_pstate=0, writing 1 -> -EINVAL; compute-check 3 2719/2719 runs (0 bad); eDP-1 enabled; 0 Oops/BUG/WARN/SError; Arch ARM (CONFIG_SECURITY_SELINUX unset); 1 unrelated failed unit (speakerguardd-v2-switchtest.service, speaker sense-channel check; local daily baseline carries a downstream tas2770 fix not in main)
J313 (M1 Air, T8103) One-shot Stage 2 trial with compiled t8103-j313.dtb (fabric=1, dcs=4) PASS (smoke) Initial DT-default boot settled to fabric_now=1 dcs_now=4 dcs_idle=4 (gpu_tracked=1); parameter writes 2 and 1 stepped fabric, and 9 was accepted (>= fabric_active, keeping fabric at active state 4); under idle_fabric_pstate=9: compute-check 4 3624/3624 runs (0 bad), 1x s2idle (rtcwake -d rtc1 -m freeze -s 15, success=1 fail=0), 1x deep S2R (rtcwake -d rtc1 -m mem -s 20, success=2 fail=0), post-resume compute-check 3 2716/2716 runs (0 bad); after restoring idle_fabric_pstate=1: compute-check 4 3603/3603 runs (0 bad, raised to 4/6 active and returned to 1/4 idle), 2nd deep S2R (rtcwake -d rtc1 -m mem -s 20, success=3 fail=0, settled to 1/4); eDP-1 enabled; 0 Oops/BUG/WARN/SError; systemctl --failed not captured on Boot 2
J716c (M5 Max, T6050) One-shot trial kernel (unaffected SoC) PASS (smoke) Boot clean, GPU initialized, eDP-1 connected, 2/2 pm_test=devices pass (success=2 fail=0), 0 Oops/BUG/WARN/SError, Arch ARM (CONFIG_SECURITY_SELINUX unset); baseline failed units before trial = 2 (aurora-peripherals.service, systemd-networkd-wait-online.service), trial = same 2, post-restore baseline = same 2 (0 new failed units)
J716c (M5 Max, T6050, smoke coverage of shared stack) Batched trial kernel 3545ebecb76f (#3468 658802454cc5 + stacked #3508 6a2a13f7328e, 2026-11-28) PASS (shared-stack smoke) Kernel d56efde4c7232208bd29d5c4e5890319e0050595dd4f4b1c3844df6656a08312 (boot 1) / 0379bd3eb63c74b8e429dd9a67dcd85b0f300d9725a2cf6495e2609be3f9c926 (boot 2), Stage 2 b7d99286395ddd7dadccc6d9593f4bd55391d9e787af97c18b45f58688d9885d; include/linux/soc/apple/pmgr-misc.h is the sole byte-identical file (g14_v27_2.rs differs — parity only establishes its PR hunks are present, along with apple,t6000-pmgr-misc.yaml; 4 other files t8103-j313.dts, t8103.dtsi, apple-pmgr-fabric-test.c, apple-pmgr-misc.c were modified further by stacked #3508); 5-item smoke pass on both boots, 0 pmgr/display-power errors, 0 new failed units (aurora-peripherals.service fails on default Stage 2 after warm reboots)
J313 (M1 Air, T8103, Group B #3332+#3468) Trial kernel built & parity-checked against main ee36fbdcd1c8 (2026-11-28) Not booted (needs-human) Kernel built and parity-checked (changed files IDENTICAL), but never booted because J313 became unreachable after the second deep-sleep cycle on baseline main ee36fbdcd1c8 (awaiting physical recovery)

Prior J316s result on superseded #3222 at d9326f973d88

  • J316s (M1 Pro, T6000) at d9326f973d88 (RyanTheTide): exact-head guarded one-shot trial kernel on default cmdline (Enforcing, 0 failed units); pmp_owned=1 voters_ok=1 holds=0 dcs_bw_active=0 gpu_tracked=0 gpu_busy=0, fabric_active=7 fabric_now=7 dcs_active=9 dcs_now=9; fabric_ps/dcs_ps 0x00000bbb/0x00000777 under deqp-vk -> 0x00000333/0x00000666 settled post-load idle and post-sleep; s2idle 2/2 (15s /dev/rtc1, suspend_stats/success 0 -> 2); dEQP-VK.api.smoke.* 8/8 pre- and post-sleep; 0 new pmgr-misc or GPU warnings/errors.

J313 debugfs snapshots at 658802454cc5

Without DT floor properties (boot-clock retention):

pmp_owned=0 voters_ok=1 holds=0 dcs_bw_active=0 cpus_at_min=0 gpu_tracked=1 gpu_busy=0
fabric_active=4 fabric_now=4 dcs_active=6 dcs_now=6 dcs_idle=0

With compiled t8103-j313.dtb (apple,fabric-min-pstate = <1>, apple,dcs-min-pstate = <4>):

# Initial boot at DT defaults (idle_fabric_pstate=1, no parameter writes):
pmp_owned=0 voters_ok=1 holds=0 dcs_bw_active=0 cpus_at_min=1 gpu_tracked=1 gpu_busy=0
fabric_active=4 fabric_now=1 dcs_active=6 dcs_now=4 dcs_idle=4

# Follow-up pass after restoring idle_fabric_pstate=1 — during GPU compute (compute-check 4, 3603/3603 runs):
pmp_owned=0 voters_ok=1 holds=0 dcs_bw_active=0 cpus_at_min=0 gpu_tracked=1 gpu_busy=1
fabric_active=4 fabric_now=4 dcs_active=6 dcs_now=6 dcs_idle=4

# After GPU compute idle:
pmp_owned=0 voters_ok=1 holds=0 dcs_bw_active=0 cpus_at_min=1 gpu_tracked=1 gpu_busy=0
fabric_active=4 fabric_now=1 dcs_active=6 dcs_now=4 dcs_idle=4

# After second deep S2R resume (rtcwake -d rtc1 -m mem -s 20, suspend_stats success=3 fail=0):
pmp_owned=0 voters_ok=1 holds=0 dcs_bw_active=0 cpus_at_min=1 gpu_tracked=1 gpu_busy=0
fabric_active=4 fabric_now=1 dcs_active=6 dcs_now=4 dcs_idle=4

Host verification at 658802454cc5

  • ./tools/testing/kunit/kunit.py run --arch=arm64 --make_options=LLVM=1 --kunitconfig=drivers/soc/apple/apple-pmgr-misc.kunitconfig: 34/34 KUnit cases passed (apple-pmgr-dcs 13/13, apple-pmgr-fabric 21/21; includes pf_t8103_gpu_tracking_and_step_test and pf_dt_floors_test); also 34/34 passed with CONFIG_SUSPEND=n and CONFIG_SUSPEND=y.
  • make W=1 on drivers/soc/apple/apple-pmgr-misc.o (with CONFIG_APPLE_PMGR_MISC_KUNIT_TEST=y) and drivers/gpu/drm/asahi/: 0 warnings.
  • scripts/dtc/apple-dt-check.sh 61e791b30687 658802454cc5: 139/139 DTBs, 0 new warnings, binding ok.
  • scripts/checkpatch.pl --strict --git 61e791b30687..658802454cc5: 0 errors, 0 warnings, 0 checks across all 4 commits.

Document the apple,t8103-pmgr-misc compatible for T8103 fabric-ps and
dcs-ps scaling (keeping interconnect/OPP properties restricted to
T600x) and the optional apple,fabric-min-pstate and
apple,dcs-min-pstate properties carrying board-verified raw floors for
idle and s2idle scaling (apple,dcs-min-pstate is mutually exclusive
with operating-points-v2).

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

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.

- Require BUSY clear and ACTUAL == DESIRED before issuing the first
  step, validate initial state and every intermediate step against
  valid_mask (BIT(3..6) on T8103 DCS; 2->1 resets the SoC while DRAM
  is live), and confirm BUSY/ACTUAL/DESIRED after each step.
- Do not hardcode fabric or DCS floors in T8103 driver match data:
  retain the boot fabric and DCS p-states for idle and s2idle unless
  the board device tree supplies validated apple,fabric-min-pstate
  and/or apple,dcs-min-pstate floors. Narrow dcs_valid_states below
  the board DCS floor, serialize probe publication and parameter
  validation under apple_pmgr_inst_sem, enforce the effective floor in
  both the setter and idle evaluator on all compatibles, ignore both
  properties when PMP owns the rails, and reject invalid values or
  OPP-table conflicts without adding a new DCS module parameter.
- Verify live BUSY/ACTUAL/DESIRED at probe, s2idle resume/rollback,
  and deep resume before marking rails active; leave unconfirmed rails
  unknown so GPU acquisition must confirm them before publishing work.
- Skip suspend_noirq/resume_noirq stepping on non-s2idle sleeps so the
  T8103 deep-sleep engine owns DCS stepping undisturbed; propagate
  prepare-time raise failures before entering sleep 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}() with rwsem-synchronized teardown;
  return -EAGAIN while PMGR owns a sleep transition and require
  confirmed active clocks before returning success.
- Add observational debugfs status and KUnit coverage (34/34 tests,
  passing on arm64 with CONFIG_SUSPEND=y/n).

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, deferring publication via retry
if PMGR still owns a sleep transition (-EAGAIN), 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 without SoC-wide fabric or DCS floors so
boards without measured floors retain their boot fabric and DCS
p-states for idle and s2idle.

Set apple,fabric-min-pstate = <1> and apple,dcs-min-pstate = <4> on
J313 (M1 MacBook Air). Inspection of the J313 ADT (/arm-io/disp0 and
/arm-io/pmgr) confirms neither carries a fabric or display-scanout DCS
floor; interactive visual bisect on the internal 2560x1600@60Hz panel
showed fabric=1 with DCS 6, 5, and 4 keeps scanout clean (~218 mW saved
at idle), while DCS 3 starves and latches disp0 blank. Other T8103
boards (J293, J274, J456, J457) should measure their own safe floors
before adding these properties.

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

Copy link
Copy Markdown
Contributor

658802454cc5 J316s (M1 Pro, T6000, shared apple-pmgr-misc + g14_v27_2 regression; combined guarded one-shot 7.3.0-aurora-pr3468-3494+ with byte-identical PR files on exact default fleet89 cmdline) PASS: apple-pmgr-misc 28e20c000.power-management: PMP manages fabric and DCS p-states (pmp_owned=1 voters_ok=1 holds=0 dcs_bw_active=0 gpu_tracked=0 gpu_busy=0, fabric_active=7 fabric_now=7 dcs_active=9 dcs_now=9 dcs_idle=0); fabric_ps/dcs_ps 0x00000bbb/0x00000777 under GPU load (deqp-vk) -> 0x00000333/0x00000666 settled idle & post-sleep (matches fleet89 baseline); s2idle 2/2 (15s /dev/rtc1; mem_sleep=[s2idle], deep not exposed on T6000); Borealis VK api.smoke 8/8 pre- and post-sleep; Enforcing, 0 AVC denials, 0 failed systemd units (systemctl --failed empty), 0 new pmgr-misc/asahi warnings or errors; cleanly restored to saved 7.3.0-aurora-fleet89.

RyanTheTide
RyanTheTide previously approved these changes Nov 28, 2026

@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 6588024: approve. Mark it ready for review when you're happy with it, and I'll merge it once CI is green.

Blockers: none.

Checked:

  • No chip or board gates. T8103 behaviour comes from the apple,t8103-pmgr-misc match data (single-step stepping, the DCS valid-state mask). The floors come only from the optional apple,fabric-min-pstate / apple,dcs-min-pstate DT properties. Boards without them stay at boot clocks, which is the safe default. The only strcmp on a compatible string is in the KUnit test.
  • No new module parameter. idle_fabric_pstate was already on main.
  • The fabric/DCS writes use single-step apple_pmgr_step_to() and mark the rail unknown (U32_MAX) on failure, so the next hold re-raises it. The raise paths confirm with readl_poll_timeout on the actual state.
  • GPU busy hook (g14_v27_2.rs): ensure_gpu_busy() runs before the firmware can see a new producer, and every staging/push error path releases it (release_gpu_busy_if_idle). Stop drops a held reference and calls pmgr_gpu_tracking_stop(). The -EAGAIN from apple_pmgr_gpu_busy_get() during sleep goes to notify.retry(). Lock order is state -> pmgr_misc, and the C side takes only its own mutex.
  • The instance pointer is now guarded by apple_pmgr_inst_sem in the hold/release/busy/tracking entry points.

Covers your Not yet: the T6000 live re-test and the qualifying regression run are on our M1 Pro (J316s, T6000) at this exact head: #3468 (comment) (SELinux Enforcing, 0 AVC, 0 failed units, s2idle 2/2, VK smoke 8/8 before and after sleep, fabric/DCS 0xbbb/0x777 under load -> 0x333/0x666 idle). The floors for the other T8103 boards are DT data that can follow later; they don't block this PR.

Non-blocking (follow-ups if you agree):

  • apple_pmgr_voters_active() assumes vote slot 0 is the GPU (i == 0 && gpu_tracked). A short comment, or keying it off the voter's identity, would keep this from breaking if the voter table order changes.
  • In the single-step branch of apple_pmgr_sys_dev_set_pstate(), suspend_state == active_state returns 0 without writing. Worth a one-line comment that this means "rail not managed in sleep".

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Keeping 658802454cc5 unchanged so the approval and the J316s, J313, and J716c hardware rows remain at the exact head SHA. Thanks for running the T6000 J316s SELinux-enforcing regression row; I updated the PR body to record it under Tested / Evidence (preserving the prior #3222 J316s row at d9326f973d88 in Evidence and dropping the trial kernel release string), narrow Not yet, and add Revert.

I will address both non-blocking follow-ups (apple_pmgr_voters_active() voter-slot assumption and the suspend_state == active_state sleep-skip comment in apple_pmgr_sys_dev_set_pstate()) in a separate follow-up once this lands. Also added smoke coverage of the shared stack from the 2026-11-28 J716c (T6050) batched run (3545ebecb76f, #3468 + stacked #3508, clean smoke and 0 pmgr/display-power errors; include/linux/soc/apple/pmgr-misc.h is the sole byte-identical file, drivers/gpu/drm/asahi/g14_v27_2.rs and Documentation/devicetree/bindings/soc/apple/apple,t6000-pmgr-misc.yaml have PR hunks present, and the 4 other PR files were further modified by #3508) alongside the separate standalone J716c row, and noted that stacked PRs #3508 and #3332 will be retargeted to main before #3468 merges. Ready to mark ready for review and merge once pr-readiness completes.

erikwb added a commit that referenced this pull request Nov 28, 2026
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]>
Resolve the conflict in drivers/gpu/drm/asahi/g14_v27_2.rs with main's
PublishError: the -EAGAIN this branch retries (fabric/DCS bandwidth not
available while the system sleeps) becomes PublishError::Error(EAGAIN),
and clears the UAT bind wait like the other non-bind outcomes. The stage
error paths this branch added convert their Error into PublishError.

Signed-off-by: Erik Bourget <[email protected]>
The try-bind host test from main extracts publish_compute(),
publish_render() and stop() from g14_v27_2.rs, which on this branch call
the apple-pmgr-misc busy hooks and track gpu_busy_held. Extract the hook
wrappers (their apple-pmgr-misc calls are configured out on the host),
add the State field, and define EAGAIN so the pump's retry arm matches
the error instead of binding every error. Add a case that an EAGAIN
publication stays pending and arms a retry.

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

Copy link
Copy Markdown
Contributor

Readiness passed at 6588024 (https://github.com/aurora-silicon/linux/actions/runs/46163144991); the pending run is a duplicate still in the Actions queue, and it doesn't gate anything. All other checks are green. Once #3508 and #3332 are retargeted to main, mark this ready and I'll merge it.

@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 73f43ca: approve again. This head merges main in. The PR's own changes match 6588024, except the GPU hook in g14_v27_2.rs is adapted to main's PublishError, and the try-bind harness builds the new hooks.

Blockers: none.

Checked:

  • Err(PublishError::Error(EAGAIN)) clears waiting_bind before notify.retry(), the same way main's EBUSY arm does, so a sleep-time EAGAIN doesn't leave a stale bind timestamp behind.
  • The staging and push error paths still release the busy reference (release_gpu_busy_if_idle(), now err.into()).
  • tools/asahi/g14-v27-2-try-bind-tests.py builds the hooks with the pmgr-misc calls configured out on the host, and asserts waiting_bind is cleared.

Still needed before merge: the hardware rows were taken at 6588024, and the GPU publish path changed with main. We'll re-run our M1 Pro (J316s) row at 73f43ca. Then it merges once CI is green and this is marked ready.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The host-tests failure at 73f43ca doesn't come from this PR. tools/asahi/g17-compute-owed-stamp-tests.py:129 still has the old note_retired() stub, while g17/queue/compute.rs calls it with an argument; main has since fixed the stub to note_retired(_published: u64) (current main 2193115). Could you merge main once more? I'll re-review the merge, get our M1 Pro row at that head, and merge once CI is green and this is marked ready.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Forward-merged main (42169a0) at e1c20cd, as I offered yesterday. It's a fast-forward on top of 73f43ca (no force push) with no conflicts, and the PR's own changes are byte-identical to 73f43ca (1371 changed lines). That clears the stale host-test stub: run-host-tests.py 846/846, g17-compute-owed-stamp 50/50, g14-v27-2-try-bind 11/11. Our M1 Pro (J316s) row will follow at e1c20cd. Once #3508 and #3332 are retargeted to main and you mark this ready, I'll merge it on green CI.

RyanTheTide
RyanTheTide previously approved these changes Nov 30, 2026

@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 e1c20cd: approve. This is a main-only forward merge; the PR's changes are byte-identical to 73f43ca, which I approved earlier (rv3468b). Blockers: none. Still needed: the J316s row at e1c20cd, the ready-for-review click, and #3508/#3332 retargeted to main.

@erikwb
erikwb marked this pull request as ready for review November 30, 2026 20:08
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 30, 2026 20:08
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at e1c20cd7: not ready yet

Check Detail
CI at head running running: KUnit isp, KUnit jpeg, KUnit prores, KUnit scaler, KUnit macsmc, KUnit clpc
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head no no line with the head SHA e1c20cd7, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: one-way · apple,t6000-pmgr-misc.yaml DT binding (apple,t8103-pmgr-misc, apple,fabric-min-pstate, apple,dcs-min-pstate), T8103 (J313 enabled; other T8103 boards retain boot clocks), T6000/T6020 (apple-pmgr-misc), G13/G14 (g14v272 GPU tracking). Revert: git revert -m 1 <merge-commit> (or revert the 4 commits); note the DT binding (apple,t6000-pmgr-misc.yaml) and t8103.dtsi/t8103-j313.dts schema/property additions are once released in DTBs/bindings, while driver/GPU scaling reverts cleanly with no persistent disk or firmware state written.

Areas: area:gpu, area:platform

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

erikwb added a commit that referenced this pull request Dec 1, 2026
…-disp-ps

Take #3468's current head, which this display perf-state work is built on, so the two merge cleanly in order. The one conflict is #3468's comment on the EAGAIN retry in g14_v27_2.rs, kept as in #3468.

Signed-off-by: Erik Bourget <[email protected]>
erikwb added a commit that referenced this pull request Dec 1, 2026
…power-off

Take #3468 so the two merge cleanly in order. Both add runtime state to the G14 27.2 backend: keep #3468's fabric/DCS busy reference and this branch's idle power-off permission. Model the latter in the try-bind host harness's State, which the extracted sleep and restart paths now read.

Signed-off-by: Erik Bourget <[email protected]>
erikwb added a commit that referenced this pull request Dec 1, 2026
…7-2-gfx-auto-pm

Take #3218's current head, which now carries #3468, so this stack merges cleanly after both. Keep #3468's fabric/DCS busy reference next to this branch's ps_gfx auto-PM state. The try-bind host harness models the backend's State: give it the auto-PM state, from the real AutoPmState in g14_v27_2_abi.rs, and a host stub of set_gpu_auto_pm() like its fabric/DCS hooks, as the extracted sleep and restart paths now use both.

Signed-off-by: Erik Bourget <[email protected]>
On T8103 the deep-sleep commit can leave a rail settled below its active
state: on the J313 the fabric reads 0x333 (p-state 3 of 4) after the
wake. resume_noirq then marks it unconfirmed, and with the fabric's
suspend state equal to its active state the raise only polled for
p-state 4, which nothing ever writes. apple_pmgr_gpu_busy_get() failed
with -ETIMEDOUT on every GPU publication from the wake on, and the GPU
was lost until a reboot. The DCS raise without a DCS floor had the same
poll-only path.

Raise a rail that has settled below its active state with writes. The
poll stays for a rail that is still moving (busy, or actual != desired),
where the hardware is expected to land on the active state itself.

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

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

New commit af5e4d84: the GPU was lost after every deep sleep on the J313. Fixed.

On the J313 (M1 Air, T8103), a kernel carrying this PR at e1c20cd7 (main 45648c63 plus the other open J313 PRs) loses the GPU after a deep sleep. From the wake on, apple_pmgr_gpu_busy_get() returns -ETIMEDOUT for every GPU publication (GPU: command publication failed ETIMEDOUT), and every Vulkan client gets a lost device.

The cause: after the wake the fabric word reads 0x333, settled at p-state 3 while its active state is 4. resume_noirq marks it unconfirmed. Because the fabric's suspend state equals its active state, apple_pmgr_raise_fabric() only polls for p-state 4 and never writes it, so every acquisition times out (debugfs status after the wake: fabric_now=4294967295). The DCS raise without a DCS floor has the same poll-only path.

af5e4d84 raises a rail that has settled below its active state with writes, and keeps the poll for a rail that is still moving. KUnit apple-pmgr-misc 34/34 and the J313 config build are clean at af5e4d84.

Evidence

J313, docked on a TS5, rtcwake -d rtc1 -m mem -s 30, Vulkan CTS dEQP-VK.ssbo.* (12,225 cases) as the GPU check:

Build before sleep after one deep sleep
this PR at e1c20cd7, no fix 12,162 Pass, 0 GPU errors lost device from the wake on; fabric_now=4294967295; 34 GPU error lines
this PR at e1c20cd7 + the same change (with #3508's display rail too) 12,162 Pass, 0 GPU errors 12,162 Pass, 0 GPU errors; fabric_now=4 dcs_now=6; 0 failed units

These rows ran on a combined build (main 45648c63 plus 19 J313 PRs), and the fixed one carried this change together with the same edit to #3508's display rail. They were not run at af5e4d84 itself. A J313 run at this head is still needed.

@erikwb

erikwb commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

J313 row at af5e4d84: pass.

J313 (M1 MacBook Air, T8103), fleet candidate 7.3.0-j313daily13+: main 45648c63 plus 19 open J313 PRs. It contains this PR's head af5e4d84 unchanged, plus one local commit outside this PR that applies the same raise change to #3508's display rail. Default kernel command line, docked on a TS5 with an external display on DP-2.

  • Boot: 0 failed units (system and user), eDP-1 and DP-2 connected, Wi-Fi and Bluetooth up, 0 Oops/BUG/WARN/SError. Floors read from DT: fabric_active=4 dcs_active=6. Both rails are held at their active states by the external display (holds=1), so idle lowering to the J313 floors (1/4) was not exercised in this docked run.
  • GPU: Vulkan CTS dEQP-VK.ssbo.* (12,225 cases) gives 12,162 Pass / 63 NotSupported, 0 GPU errors.
  • Deep sleep (rtcwake -d rtc1 -m mem -s 30): entered and woke on the RTC after 31 s. After the wake: fabric_now=4 dcs_now=6, ssbo.* 12,162 Pass with 0 GPU errors, 0 failed units, both displays and Wi-Fi back. The same build without this fix loses the GPU from the wake on (fabric_now=4294967295, command publication failed ETIMEDOUT).
  • Kernel errors: no new ones. The err set after the wake is the candidate's usual set: the DCP AV-service admission, DT IRQ parsing for the dock's PCIe devices, and the Wi-Fi/BT D3hot resume lines, which also appear on the previous daily without this PR's change. SELinux: n/a (Arch ARM).

@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 at af5e4d84, the new commit (the rest was approved at e1c20cd7). A rail that a deep sleep left settled below its active state, with no step in progress and actual equal to desired, is now raised with writes instead of polling for a state nothing will write. A rail still stepping keeps the poll. The change only reaches the resume path that until now failed every GPU publication with -ETIMEDOUT, so it can't break a wake that works today. It merges once CI is green; please confirm on the J313 after the merge that the GPU publishes after a deep-sleep wake.

@DjDeveloperr
DjDeveloperr merged commit a29e700 into main Dec 1, 2026
11 of 40 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/pmgr-fabric-dcs branch December 1, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants