Repository navigation
drm/asahi: retain bounded utilisation and diagnose G16S zero samples - #661
Closed
RyanTheTide wants to merge 9 commits into
Closed
RyanTheTide wants to merge 9 commits into
RyanTheTide wants to merge 9 commits into
Conversation
Core gating can occur after a burst finishes but before its utilisation packet is drained. Invalidating the entire snapshot and discarding that batch loses completed work; a later idle packet can then become a fresh zero. Separate pstate invalidation and admission from utilisation, retaining the existing age limits and full firmware-epoch invalidation. Exercise both firmware graphs, queued nonzero intervals followed by idle zero, pstate reacquisition, suspend/restart and mutation controls. Fixes: fdcf196 ("drm/asahi: Export qualified G16S and G17P statistics") Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Stage 2 supplies the live DT independently of installed kernel DTBs. A bound PMP report provider can therefore have no DRAM metadata after a kernel-only upgrade. Use the already documented T6000, T8112, T6040 and T8140 interface classes when all metadata is absent, requiring both the root SoC and matching PMP report compatible. Complete DT descriptions take precedence. Preserve validation errors, unknown-SoC behaviour and the separation from measured current rates. Exercise probe registration, root/report mismatches, DT precedence and errors with six new mutation controls. Fixes: e2fc1e3 ("pmdomain: apple: report DT DRAM classes through the PMP provider") Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Build and link an ARM64 Image with the Asahi and PMP report drivers enabled as built-ins, and run the DRAM property-parser KUnit suite under UML. Keep the build config and compiler log for review. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Reuse the statistics build workflow from the existing dispatchable host-test workflow. The extra kernel jobs are opt-in for manual runs, allowing a new statistics workflow to be validated before it is present on the default branch. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Use LLVM/libclang 22 with Rust 1.97.1 and bindgen 0.73.2, as in the previous driver builds, and install rustfmt for binding generation. Enable SCHEDSTATS as distribution configurations do: bindgen cannot represent the empty cacheline-aligned sched_statistics layout from defconfig. Keep all generated layout assertions enabled. The failed LLVM 18/minimal-configuration build stopped in unchanged Rust scheduler bindings before compiling the drivers. No production kernel change or layout-check waiver is needed. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Fetch the exact event SHA through the public source archive API and retain its commit ID and archive digest with build evidence. Kernel archive builds do not need Git history. The previous runner spent ten minutes fetching Git objects before its full Image build was interrupted by runner shutdown. Use the runner CPU count for compilation while retaining the same Asahi configuration and full kernel link checks. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Keep DRAM support driven by the boot device tree. Missing properties must leave the dram group absent; repair the Stage 2 DT payload at its source instead. Restore the existing host-test workflow and remove the one-off statistics workflow; validation runs live on a separate ci branch. This reverts 33482c0, ebdab7c, 1c88bf6, 470dfb3 and 77b5395 without rewriting published history. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Contributor
Author
|
fleet12 hardware result (7.3.0-aurora-fleet12, this PR merged in): on the Neo (G17P), agx_stats reads utilisation_status valid with util_renderer and util_device at 55% under glmark2. On the J616s (G16S), the target of this fix, it still reads valid but 0% renderer and device for the whole 30 s glmark2 terrain run, sampled every 5 s. That's the same as fleet11. No regression anywhere, but the G16S zero is not fixed, so I'm leaving this unmerged. Evidence is in the fleet12 rollout report on the Aurora host. 🤖 Generated with Claude Code |
A valid zero utilisation value does not distinguish a firmware record with zero fields from a stream whose useful records were never admitted. Make the shared statistics diagnostic report its device identity, live cursors for the selected firmware roles, quarantine and epoch admission state, and per-tag admitted counts alongside the complete raw words. Preserve the offending copy when an unknown tag stops a statistics ring. This is diagnostic support for the remaining G16S utilisation failure; it does not change the qualified decoder, core-gating policy or channel configuration. Test the production raw-report store in the host receiver fixture, including rejected epochs and unknown tags on either role. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The kernel directory build caught the CStr/Core Display mismatch in the new diagnostic identity line. Borrow the device name as a str without allocating, and retain a marker for names which are not UTF-8. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The G16S zero-utilisation-under-load failure is still unresolved.
031c80d1fixes utilisation admission across core gating, but it is not evidence for the remaining G16S cause. Keep this PR draft until a paired raw-statistics/load capture establishes that cause and a candidate passes the same capture.The retained core-gating fix separates pstate from utilisation: completed utilisation intervals keep their bounded 16/32 ms age policy, while pstate needs a new observation after gating. Suspend, restart, quarantine and teardown still end both capabilities.
6dc719d3c21c215c6885bdb97f1c6d3dddc13ff5adds a minimal diagnostic to the shared backend./sys/kernel/debug/asahi-g17/firmware_reportsnow identifies its platform device and firmware graph, shows live cursors only for the graph's actual roles, and prints quarantine, suspension, queued-record discard and core-power admission state. Each raw tag has its transport-admitted count and last-admission decision. Unknown tags retain their complete offending copy before the existing quarantine takes effect. Qualified values appear beside their validity status. The fast-forward correctionb6465f7ab5c2f8b6ca09c93f62008cd34eb9d52eformats the device CStr as a borrowed UTF-8 string for the core formatter. These additions change no decoder field mapping, channel setup or admission policy; there are no new module parameters or SoC switches.The source path already gives T6040/G16S one V25G83 firmware instance, initializes its statistics-channel pointers from that instance's status area, and drains the primary role through the common event service. Sysfs retains the same session Arc as the receiver. In the current code, a zero core-power observation gates pstate only. A valid numeric zero must be checked against the admitted tag-0x13 words and the bounded integer mean; a missing or expired sample is unavailable/stale. None of these source checks proves what G16S firmware publishes during the failing workload.
Validation for the diagnostic: the focused host gate passes 11/11 runs. Its receiver control executes 12 production Rust cases, including the raw-report store, plus 512 byte-identical legacy C formatter fixtures. All nine negative controls compile and are killed by their intended assertion/panic. Standalone decoder tests also pass, and rustfmt is clean. The initial kernel directory build caught the CStr/core Display mismatch in the diagnostic identity line; the correction above fixes it without allocating. The corrected head passes the controller buildbox check with defconfig + asahi.config, CONFIG_RUST=y, LLVM 22.1.6, Rust 1.97.1, bindgen 0.73.2, modules_prepare and -j8 W=1 Asahi/PMP directory builds. Both required objects and the configuration were recovered and their SHA256 values verified. The only W=1 warnings are unchanged pmc.c kernel-doc for has_pending. This is a directory build, not an Image link or target boot. No new target runtime pass is claimed.
The existing fast-forward revert
0764ba4630dbcontinues to remove the rejected DRAM fallback and one-off CI changes. PMP parsing remains driven by DT: absent metadata produces nodram/group. The separate DRAM root cause is an embedded Stage 2 DTB set older than the matching kernel DTS, so an Image/modules or/boot/dtbupdate cannot supply those properties. aura#28 contains the Stage 2 packaging fix and is unchanged by this diagnostic; its deployment remains with the lead. No kernel fallback is reintroduced.Exact verification after separate controller approval for the explicitly named device (and, for the new diagnostic, a lead-installed candidate with the existing bootguard fallback):
Require an Apple hardware renderer and a workload that survives the full interval. Preserve all three phases and the workload exit status. Correlate tag counts/cursor progress, transport admission, raw words 3/4/6 of tag 0x13, and the qualified mean/status. Unknown tags or nonzero alternative fields require firmware-layout evidence before changing the decoder. A
last_admitted=falserecord must be explained by the printed admission state. For the eventual fix, require fresh nonzero device utilisation under load, a higher load distribution than idle, and independent pstate invalidation across gating. Stale/unsupported samples are not zeros; do not change power policy to make the test pass.After the separately reviewed Stage 2 refresh, CONFIG_APPLE_PMP_REPORT and the bound apple-pmp-report driver should expose these static interface classes (not measured current clocks):
Rates are transfers/s/pin; bandwidth is decimal bytes/s. This PR does not deploy Stage 2 or modify either target.