Skip to content

drm/asahi: g16: use zone telemetry when the PMP supplies none - #3907

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/g16-pmp-no-gpu-telemetry
Dec 2, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/g16-pmp-no-gpu-telemetry

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What: On main the J516s GPU (292400000.gpu) never probes once the display gate has started the PMP. The G16 cooling helper waits on apple_pmp_gpu_get() for any available apple,pmp node, but the PMP registers a telemetry provider only on T8132, so on T6030 that call keeps returning -EPROBE_DEFER forever. The provider now exports its own check (apple_pmp_telemetry_supported()), and the cooling helper treats a PMP that fails it like a disabled one: the GPU probes and the thermal-zone backstop drives cooling.

Tested: no hardware run yet. pc build of the changed objects (asahi profile, arm64, LLVM=1) passes with no new warnings. checkpatch --strict is clean, and the asahi-m4 host tests (26/26) and tools/asahi/g15-display-order-tests.py pass.

Risk: two-way · M3 Pro J516s (T6030) and the T8122 Airs: their linked GPU now probes on zone telemetry instead of deferring forever.

Not yet: J516s target row: GPU probes after the PMP starts, a GPU smoke run with 0 faults, and one s2idle cycle with GPU work after it. J773g control row: the GPU probes and its cooling device registers on PMP telemetry exactly as on main.

Details

Root cause. On T6030 the display gate adds apple,pmp to the GPU node (gate_gpu_pmp_link(), selected by DRM_ASAHI_G15) and enables /soc/pmp@350500000 (apple,t6030-pmp-v2) when the display driver first asks for it. From then on, of_device_is_available() on the PMP node is true. apple_pmp_telemetry_register() returns 0 without adding a provider for any PMP but apple,t8132-pmp-v2 (it has been keyed on that compatible since 6a44e13). asahi_g16_cooling_register() only checked availability (36f28ca), so it called apple_pmp_gpu_get(), which keeps returning -EPROBE_DEFER because no provider for that node ever joins the list. Only a GPU that probed before the PMP started took the zone path, so the outcome depended on probe order.

Fix. The provider's existing compatible check becomes apple_pmp_telemetry_supported(np). apple_pmp_telemetry_register() calls it in place of the inline check, and the G16 cooling helper adds it to the existing "disabled node" condition. A PMP that will never register telemetry is then handled like one that never probes, and both callers share one source of truth. I picked this over returning -ENODEV from apple_pmp_gpu_get() because it needs no new error path in glue.c, and apple_pmp_gpu_get(), apple_pmp_telemetry_get_hotspot() and the lease code stay unchanged. There are no new SoC or board gates and no parameters or constants. It also does not touch the files #3812 changes (pmp-export.c, pmp.rs, the T6030 DTS and overlays).

Per SoC:

  • T8132 (J773g): apple_pmp_telemetry_supported() is true for its PMP, so the condition and the register path take the same branches as before. The GPU still defers until the provider registers, then samples PMP telemetry.
  • T6030 (J516s): the GPU no longer waits on a provider that never comes, and cooling starts from the fail-closed zone backstop (macsmc_soc_die), as it already did whenever the GPU probed before the PMP started.
  • T8122 (J613/J615 25G83 DT, where the GPU carries apple,pmp): same fallback as T6030. These Macs are not in the lab.
  • T6050, T8140, T8142: their GPUs bind other backends and never call asahi_g16_cooling_register(). Their PMPs registered no telemetry before and still register none.
Evidence
  • Base: main ddcf51678a63. The bug was first measured by the M3 lead on main 2225082e1d18.
  • Build (pc, x86_64 → arm64, LLVM=1, asahi profile): linux-build/build kernel --profile asahi <wt> -- modules_prepare drivers/soc/apple/ drivers/gpu/drm/asahi/ drivers/thermal/ finished with rc 0 in 324 s on head 63347385beb4, with no diagnostics from the changed files. A W=1 rebuild of pmp-telemetry.o and glue.o is clean. glue.o imports apple_pmp_telemetry_supported and pmp-telemetry.o exports it (GPL). The Rust asahi_core.o, whose bindings include the changed header, and aurora.o also built.
  • git diff | scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
  • tools/testing/selftests/drivers/gpu/asahi-m4/run-host-tests.py --source <wt>: 26/26 ok, including test-thermal-policy.py and test-thermal-sensor.py.
  • tools/asahi/g15-display-order-tests.py: PASS (5 static checks, 10 C scenarios, 14 C mutants, 2 admit() mutants).

On T6030 the display gate links the GPU node to the PMP through
apple,pmp, and the PMP node becomes available once the display driver
starts it. apple_pmp_telemetry_register() registers a provider only for
an "apple,t8132-pmp-v2" PMP and returns 0 for any other, so on T6030
apple_pmp_gpu_get() keeps returning -EPROBE_DEFER and the GPU never
probes. Only a GPU that probes before the PMP starts gets the thermal-zone
path, so whether the GPU comes up depends on probe order.

Export the provider's own check as apple_pmp_telemetry_supported() and
have the G16 cooling helper treat a PMP it rejects like a disabled one:
the fail-closed thermal-zone backstop drives cooling, as it already does
when the PMP node is disabled. A supported PMP that has not probed yet
still defers.

T8132 is unchanged: its PMP is supported, so the GPU still waits for the
provider and then samples it. A T8122 GPU linked to its PMP falls back
the same way as T6030. The T6050, T8140 and T8142 GPUs do not use
the G16 cooling helper, and their PMPs register no telemetry before or
after this change.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 2, 2026 09:09

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 63347385beb4
Blockers:

  1. Missing exact-head hardware rows at 63347385beb4 (J516s target row and J773g control row, noted as queued/not yet run; readiness is still queued and the PR body mentions 63347385beb4 in the cross-compile Evidence section, so posting as a comment rather than approving ahead of the rows), plus let the queued CI jobs (apple-build, host-tests, KUnit, pr-text) finish green.

Checked: no Apple material, no AI attribution, no new SoC/board/firmware gates, DCO trailer clean, full +19/-3 diff audited across all 3 files against drivers/gpu/drm/asahi/Kconfig, drivers/soc/apple/Makefile, pmp-telemetry.c, and asahi_g16_cooling_register() / unregister() / sample(); CI jobs currently queued.

Evidence
  • drivers/soc/apple/pmp-telemetry.c & include/linux/soc/apple/pmp-telemetry.h: extracts the existing of_device_is_compatible(np, "apple,t8132-pmp-v2") predicate into apple_pmp_telemetry_supported() (EXPORT_SYMBOL_GPL) so apple_pmp_telemetry_register() and asahi_g16_cooling_register() share a single source of truth. of_device_is_compatible() is NULL-safe, apple-pmp-y always links pmp-telemetry.o, and DRM_ASAHI already depends on APPLE_PMP=y || (APPLE_PMP=m && DRM_ASAHI=m) (matching the existing unconditional apple_pmp_gpu_get() call in glue.c).
  • drivers/gpu/drm/asahi/g16/glue.c:277-281: drops cooling->pmp_node (of_node_put + NULL) when !of_device_is_available(cooling->pmp_node) || !apple_pmp_telemetry_supported(cooling->pmp_node). That cleanly routes T6030 (apple,t6030-pmp-v2) and T8122 (apple,t8122-pmp-v2) onto the existing fail-closed thermal-zone backstop (atomic_set(&cooling->state, 0), zone_poll queued immediately, asahi_g16_cooling_has_pmp() == false, cancel_delayed_work_sync() on unregister) instead of infinite -EPROBE_DEFER once PMP becomes available, while keeping T8132 (apple,t8132-pmp-v2) byte-for-byte unchanged.
  • Code is clean and ready to approve with no changes once the J516s target and J773g control rows at 63347385beb4 are posted and CI finishes green.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s (M3 Pro, T6030, G15S B1) exact-head hardware row: PASS

  • Head tested: 63347385beb43e1e489ac48a08001f2b949fbec8 (7.3.0-m3-pr3907+, stock boot.bin, default cmdline, boot_id=e8a74976-0e66-4edf-9a2f-9cfc2923f6ee)
  • PMP + GPU probe: /soc/pmp@350500000 (350500000.pmp) bound to apple_pmp (PMP started at 5.084 s); 292400000.gpu probed cleanly onto aurora-g16 at 6.156 s (18 cores enabled, 26B123 G15S READY at 6.456 s, devices_deferred empty, 0 'PMP telemetry ... unavailable' defer hits).
  • Cooling device on thermal-zone telemetry: cooling_device0 (type=aurora-g16g, cur=0, max=8) registered on thermal-zone telemetry (M4 cooling: sample_ns=Some(6521606548) mc=51324 sensor=None governor=0 power=0 backstop=8 limit=S1; thermal_zone0 macsmc_soc_die 51453 mC).
  • Pre-sleep GPU smoke (gpubench-vk): all CRCs valid (compute.uber d4 9963f56c, render.postfx d1/d2 4707efa8, render.bindless_ubo d2 57e7bedd, render.deferred tile MSAA4 d2 5e4130ce, render.heavy d1/d4 ok, transfer.ops d1/d4 55a4e6b1).
  • s2idle cycle + post-wake GPU smoke: 1x rtcwake -m freeze -s 15 (suspend_stats: success=0->1, fail=0); post-wake compute.uber (9963f56c), render.postfx d1/d2 (4707efa8), render.deferred (5e4130ce), and transfer.ops d1/d4 (55a4e6b1) all matched expected CRCs.
  • Health & errors: jobs=35644, job_cmds=43696, recoveries=0, hang_kills=0, clustered=0, health: failed 0 degraded 0, gpu_fault_lines=0, failed_units=0, 0 new GPU/PMP kernel errors.

@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.

Reviewed the shared telemetry support predicate and G16 fallback against the base. The T8132 provider path keeps the same gate and the J516s exact-head row shows the GPU binding after PMP, zone telemetry, and clean GPU work across s2idle. The standard T8122 display gate can also supply this GPU phandle, so the J615 row is relevant to the Edge cut.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 63347385: not ready yet

Check Detail
CI at head running running: apple-build, host-tests, KUnit plan
Review ok approved by RyanTheTide
Requested changes no review verdict FINISH at 63347385
Hardware row at head no no line with the head SHA 63347385, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M3 Pro J516s (T6030) and the T8122 Airs: their linked GPU now probes on zone telemetry instead of deferring forever.

Areas: area:gpu, area:platform

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

@RyanTheTide

Copy link
Copy Markdown
Contributor

J615 (M3 Air, T8122) at 63347385: PASS. Kernel = main 1b2c3613 + this head; one-shot boot with Stage 2 aura 1.0.0b18 and the same tree's t8122-j615.dtb. The G16 GPU binds (render node present, no PMP telemetry ... unavailable deferral), 0 oops/AVC/DART/GPU faults, both DCPs bound, s2idle 2/2.

Control on the same Mac and Stage 2: main 1b2c3613 without this PR never binds the GPU (it defers on PMP telemetry on every probe, glmark2 falls back to software); reverting #2682 or using the older J615 DTB doesn't change that. Saved boot restored afterwards.

@RyanTheTide
RyanTheTide merged commit 1155f13 into main Dec 2, 2026
7 of 11 checks passed
@RyanTheTide
RyanTheTide deleted the fix/g16-pmp-no-gpu-telemetry branch December 2, 2026 10:26
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:m3 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-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