Repository navigation
drm/asahi: g14_v27_2: retry ring-full EBUSY and isolate packet publication errors - #3249
AxxzyWasTaken wants to merge 1 commit into
Conversation
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
6cf0457 to
a247885
Compare
There was a problem hiding this comment.
Verdict: MERGE at a247885573aaabc43d87594295a2c01a8a0f5689 once hardware evidence is complete.
Blockers: No code blocker found. Keep the PR unarmed until exact-head firmware 27.2 ring-pressure tests on the affected G13G/G14G paths demonstrate progress and confirm another VM keeps running after the rejected packet.
Checked: Read the staging and publication changes. The precheck does not advance producer state, repeat staging revalidates the ring, the retry deadline is cleared when the blocked front advances or is withdrawn, and partially published packets retain their guard through retirement. The exact-head extracted host harness passed all 13 cases and the head CI is green. No DT, per-board gating, private material, or attribution added.
|
Heads-up from a batch row: this PR and #3238 both rework the same pump error paths in |
|
#3238 is merged now ( |
|
Rebased onto |
a247885 to
a5be6ed
Compare
There was a problem hiding this comment.
Verdict: HOLD at a5be6ed1
Blockers:
- Queued hosted CI at
a5be6ed1(0P/0F/1Q): Wait for hostedapple-build,host-tests, and KUnit checks to complete green on the rebased head. - Exact-head firmware-27.2 hardware rows (
a5be6ed1): Ready for the plannedJ473+J316sbatch/one-shot hardware run ata5be6ed1verifying ring-pressure progress and isolated per-packet failure recovery (confirming unrelated VMs keep running after a rejected packet).
Checked:
- Audited full Rust production diff (
drivers/gpu/drm/asahi/g14_v27_2.rs,drivers/gpu/drm/asahi/gpu/v27_2.rs) after rebasing past#3238(maind71f3b2101e15):waiting_bind(#3238) andwaiting_ring(this PR) compose cleanly with no interference: both are reset on front removal, empty queue,fail_all, VM failure,free_slotsempty,Ok(()), non-EBUSYpublication error, cancel, recovery restart, and sleep/wake/restart, and each clears the other when switching betweenBindBusyandEBUSY.RootV27_2::check_compute()andcheck_render()run beforetry_bind_vm()without advancing producer state, avoiding unnecessary VM-bind churn while a ring is full.fail_publication()and deferredpublication_errorroute throughpacket.fail_packet(err)withg14_v27_2_abi::guard_releasable()checks so isolated packet publication failures do not poison unrelated VMs.- Author verified both
g14-v27-2-try-bind(10/10 PASS) andg14-v27-2-pump-ebusy(9/9 PASS, all 8 negative-control mutations killed) locally ata5be6ed1.
Evidence
- Head commit:
a5be6ed180c0ba755497fbac49d6fa35617604e3(MERGEABLEintomain). - Diff summary:
+1898/-22acrossg14_v27_2.rs,gpu/v27_2.rs,g14-v27-2-pump-ebusy-tests.py,g14-v27-2-try-bind-tests.py,run-host-tests.py.
|
I checked a5be6ed with an independent host fixture that switches the same front packet from a VM-bind wait to a ring wait and back before it publishes. The previous deadline cleared on both transitions. All 14 ring cases and 10 bind cases passed against the four verified source blobs from this head. The J473 and J316s hardware rows remain. |
There was a problem hiding this comment.
Verdict: MERGE at a5be6ed180c0
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited full Rust production diff (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/gpu/v27_2.rs) after rebasing past #3238 (main d71f3b2101e15):
waiting_bind(#3238) andwaiting_ring(this PR) compose cleanly with no interference: both are reset on front removal, empty queue,fail_all, VM failure,free_slotsempty,Ok(()), non-EBUSYpublication error, cancel, recovery restart, and sleep/wake/restart, and each clears the other when switching betweenBindBusyandEBUSY.RootV27_2::check_compute()andcheck_render()run beforetry_bind_vm()without advancing producer state, avoiding unnecessary VM-bind churn while a ring is full.fail_publication()and deferredpublication_errorroute throughpacket.fail_packet(err)withg14_v27_2_abi::guard_releasable()checks so isolated packet publication failures do not poison unrelated VMs.- Author verified both
g14-v27-2-try-bind(10/10 PASS) andg14-v27-2-pump-ebusy(9/9 PASS, all 8 negative-control mutations killed) locally ata5be6ed1.
Follow-ups (not blocking): queued CI; J473/J316s ring-pressure rows
…ication errors Runtime::pump() on the G14 firmware 27.2 backend has two error-handling bugs: 1. publish_render() is only entered when !state.running(), so the `Err(EBUSY) if state.running() => return` arm in Runtime::pump() is unreachable for renders. When firmware retires a prior render or compute command slightly before advancing the submission-ring consumer cursor `r`, stage_render() or stage_compute() returns EBUSY while !state.running() and pump() immediately fails a healthy packet. Even when state.running() is true on the compute path, returning without arming a delayed retry can stall if consumer lag outlives the final completion IRQ. 2. State::fail_publication() (and the deferred publication_error retirement path in Runtime::service_locked()) called packet.finish(Err(err)) (fail_vm = true), which permanently poisons the client's VmStatus even when the failing command was never published to firmware and any earlier commands of the same packet retired cleanly. Fix both defects: - Factor submission-ring and queue-head validation in RootV27_2 into check_work() and expose check_render() / check_compute(), calling them before QueueRender::prepare(), UAT binding, and pool encoding so transient ring consumer lag does not churn scene allocations or pool buffers on retry. Even if stage_render() still returns EBUSY after QueueRender::prepare() succeeds, Prep/Scene unwinds cleanly without calling queue.published() or advancing CommandPool spare buffers. - Track submission-ring EBUSY waits in State::waiting_ring using FirmwareWait::kick_due(), kicking the relevant doorbell(s) at most once per RESOURCE_RETRY_MS and arming Notify::retry() regardless of state.running(). Clear waiting_ring on publication, non-EBUSY errors, slot-unlink waits, render-boundary waits, front withdraw() (waking service for a successor or notifying idle when empty), fail_all(), sleep_prepare(), and sleep_complete(). After COMMAND_TIMEOUT_MS, fail the blocked packet via State::fail_publication(packet, EBUSY) so VmStatus and the healthy runtime remain intact. - Switch both State::fail_publication() (when no command of the packet is in flight) and Runtime::service_locked()'s deferred done.publication_error completion (once the published prefix retires cleanly) from packet.finish(Err(err)) to packet.fail_packet(err), matching the M3 runtime's VM isolation semantics while keeping real device-loss errors (EIO/ETIMEDOUT/ENODEV) and firmware hangs fatal to VmStatus. Add a standalone host test harness under tools/asahi/ extracting and compiling the production G14 27.2 runtime state machine across 13 positive scenarios and 8 negative-control mutations, and register it in tools/asahi/run-host-tests.py. Closes: aurora-silicon#3070 Signed-off-by: AxxzyWasTaken <[email protected]>
|
Rebased onto |
a5be6ed to
15c502a
Compare
What: Fix
g14_v27_2ring-fullEBUSYhandling and isolate per-packet publication failures from device-wideVmStatus:drivers/gpu/drm/asahi/gpu/v27_2.rs): AddRootV27_2::check_work(),check_render(), andcheck_compute()soRuntime::pump()checks submission-ring and per-DM queue headroom before staging, avoiding avoidable staging churn when a ring is temporarily full (buffer-op renders that require a second TA entry still unwind cleanly ifstage_render()returnsEBUSY).EBUSYretry (drivers/gpu/drm/asahi/g14_v27_2.rs): Retry transientEBUSYon both render and compute packets regardless ofstate.running(), bounded byCOMMAND_TIMEOUT_MSviakick_due()so a permanently stalled ring expires cleanly instead of livelocking.fail_publication()and deferredpublication_errorhandling throughfail_packet(err)so an isolated packet publication error fails only that packet's fences and does not poison unrelated contexts'VmStatus, while preservingrecord_if_device_lossforEIO/ETIMEDOUT/ENODEV.tools/asahi/g14-v27-2-pump-ebusy-tests.py): Registered intools/asahi/run-host-tests.pycovering render/computeEBUSYretry, timeout expiry,VmStatusisolation, and 8 negative-control mutations.Tested:
python3 tools/asahi/run-host-tests.py --only g14-v27-2-pump-ebusy: 9/9 PASS (8/8 negative-control mutations killed).ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/aurora.o) withCONFIG_DRM_ASAHI_G14_V27_2=y(CONFIG_APPLE_SOC_SLEEP=yand=n) andCONFIG_DRM_ASAHI_G14_V27_2=n: PASS, 0 warnings in touched files.git diff --checkclean;scripts/checkpatch.pl --strict: 0 errors, 0 code warnings.Not yet: On-hardware G13G (T8103) / G14G (T8112) firmware 27.2 saturation test exercising live ring-full
EBUSYretries.Risk: two-way · G13G (T8103) and G14G (T8112) GPUs running the
g14_v27_2firmware 27.2 backend; legacy 12.x/13.5 and G15/G16/G17/G18 paths are untouched.Closes: #3070