Repository navigation
drm/asahi: g16: use zone telemetry when the PMP supplies none - #3907
Conversation
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>
satchlj
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 63347385beb4
Blockers:
- Missing exact-head hardware rows at
63347385beb4(J516s target row and J773g control row, noted as queued/not yet run;readinessis still queued and the PR body mentions63347385beb4in 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 existingof_device_is_compatible(np, "apple,t8132-pmp-v2")predicate intoapple_pmp_telemetry_supported()(EXPORT_SYMBOL_GPL) soapple_pmp_telemetry_register()andasahi_g16_cooling_register()share a single source of truth.of_device_is_compatible()is NULL-safe,apple-pmp-yalways linkspmp-telemetry.o, andDRM_ASAHIalready depends onAPPLE_PMP=y || (APPLE_PMP=m && DRM_ASAHI=m)(matching the existing unconditionalapple_pmp_gpu_get()call inglue.c).drivers/gpu/drm/asahi/g16/glue.c:277-281: dropscooling->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_pollqueued immediately,asahi_g16_cooling_has_pmp() == false,cancel_delayed_work_sync()on unregister) instead of infinite-EPROBE_DEFERonce 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
63347385beb4are posted and CI finishes green.
|
J516s (M3 Pro,
|
RyanTheTide
left a comment
There was a problem hiding this comment.
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.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J615 (M3 Air, T8122) at Control on the same Mac and Stage 2: main |
What: On main the J516s GPU (
292400000.gpu) never probes once the display gate has started the PMP. The G16 cooling helper waits onapple_pmp_gpu_get()for any availableapple,pmpnode, 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.pypass.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,pmpto the GPU node (gate_gpu_pmp_link(), selected byDRM_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 butapple,t8132-pmp-v2(it has been keyed on that compatible since 6a44e13).asahi_g16_cooling_register()only checked availability (36f28ca), so it calledapple_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 fromapple_pmp_gpu_get()because it needs no new error path inglue.c, andapple_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:
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.macsmc_soc_die), as it already did whenever the GPU probed before the PMP started.apple,pmp): same fallback as T6030. These Macs are not in the lab.asahi_g16_cooling_register(). Their PMPs registered no telemetry before and still register none.Evidence
ddcf51678a63. The bug was first measured by the M3 lead on main2225082e1d18.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 head63347385beb4, with no diagnostics from the changed files. AW=1rebuild ofpmp-telemetry.oandglue.ois clean.glue.oimportsapple_pmp_telemetry_supportedandpmp-telemetry.oexports it (GPL). The Rustasahi_core.o, whose bindings include the changed header, andaurora.oalso 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).