Skip to content

media/dts: apple: enable the T6000 AVE DMA fault reporter with runtime PM - #1861

Closed
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dtgaps8/ave-dma-runtime-pm
Closed

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dtgaps8/ave-dma-runtime-pm

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

The AVE auxiliary DMA fault reporter (dma-controller@40d020000, apple,t6000-ave-dma) already
has a driver in tree, but its DT node ships disabled on T6000, so the reporter never binds and AVE
DMA faults go unreported. Enabling the node as it stands would pin ps_venc_sys on: the driver only
requested its shared fault interrupt and never touched runtime PM, so once the device bound genpd
counted it as active and kept the encoder's power domain up for good, losing the AVE idle power
saving.

Two commits:

  1. media: apple/ave: enable runtime PM in the reporter and leave it runtime-suspended, the same
    way the codec DARTs it shares venc_sys (and the fault interrupt) with already behave, so genpd
    can gate the domain again. A DMA fault can only be raised, and the shared interrupt only asserted,
    while the encoder is running and the domain is powered, so the fault handler always reads
    registers in a powered domain. The domain is live at bind, so the probe starts active and drops
    the vote once the handler is installed.

  2. arm64: dts: apple: t6000: enable dma-controller@40d020000 next to the video encoder and the
    DARTs it sits alongside in venc_sys. T6001 and T6002 keep theirs disabled until the binding is
    proven on that hardware.

Tests

  • CI: dt-checks (incl. apple,ave-dma.yaml) and host-tests pass.
  • M1 Pro (j316s, T6000), test kernel 7.3.0-aurora-fleet72dg8 = this branch on integration/aurora,
    one-shot boots: clean to multi-user + Wi-Fi, s2idle 3/3, 0 AVC / SError / oops, 0 DMA fault:
    lines; H.264 encode unaffected (1080p 129 fps, High-B 146 fps, 4K 38.8 fps, 0 decode errors).
    The runtime-PM change is inert while the node is disabled (the driver never probes), so this
    confirms no regression from carrying it.
  • genpd on that kernel shows the gating the reporter joins: venc_sys is off at idle with its
    children (venc_dma, venc_pipe4/5, venc_me0/1) and the codec devices all suspended. The fix
    mirrors the apple-dart runtime-PM pattern those DARTs already use in the same domain.

Node-bind row: pending a Stage 2 DTB refresh

Proving the reporter actually binds the enabled node needs ave0_dma enabled in the DTB the Mac
loads at boot, i.e. a Stage 2 DTB refresh — the same step #1687 and #1760 need on their Macs to
go live. The two lighter mechanisms don't apply here: a runtime DT overlay can't re-trigger
platform-device creation on a status flip of a base node, and the M1 Pro aura-try reproduce guard
can't match because this Mac's committed boot.bin is stale against its current update-m1n1
config (built before the m1n1/u-boot bumps, not refreshed at the fleet72 promotion). Staying draft
until the row runs on a refreshed M1 Pro Stage 2 DTB.

Assisted-by: LLM (Claude:Opus 5.5)

The AVE auxiliary DMA fault reporter lives in the venc_sys power domain,
which the encoder and its DARTs gate whenever the codec is idle. The
driver requested its shared fault interrupt but never touched runtime PM,
so once the device bound genpd counted it as active and kept ps_venc_sys
powered for good, defeating the encoder's idle power saving.

Enable runtime PM and leave the reporter runtime-suspended. A DMA fault
can only be raised, and the interrupt it shares with the codec DARTs only
asserted, while the encoder is running and the domain is therefore
powered, so the fault handler always reads registers in a powered domain.
The domain is live at bind (the codec DARTs are already up), so start
active and drop the vote once the handler is installed, letting genpd
gate venc_sys with the rest of the encoder.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Now that apple-ave-dma participates in runtime PM and no longer pins
ps_venc_sys, enable the auxiliary DMA fault reporter on T6000 alongside
the video encoder and the DARTs it shares the venc_sys domain and fault
interrupt with. T6001 and T6002 keep theirs disabled until the binding is
proven on that hardware.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 2.

  1. The change is not proven at all yet. The M1 Pro row ran with ave0_dma still disabled in the loaded DTB, so apple_ave_dma_probe() never ran and the new runtime-PM code (apple-ave-dma.c:70-98) was never executed. The claim this PR exists for (reporter bound, venc_sys still gates at idle, encode unaffected) has no row. Keep it draft until the Stage 2 DTB row below has run.
  2. Both commits carry an Assisted-by: LLM trailer. Commits should carry only the human Signed-off-by; the Assisted-by line belongs at the end of the PR body (already there). Reword both commits.
  3. arch/arm64/boot/dts/apple/t6000.dtsi:188 enables the node on T6000 only. The node in t6001-peripherals.dtsi:141 and t6002-peripherals.dtsi:257 is identical (same compatible, reg, IRQ 1028, ps_venc_sys), so the driver change applies there unchanged. Splitting it by SoC means M1 Max/Ultra keep missing fault reports with nothing that differs in the hardware description. Enable all three and ask for an M1 Max (and, if one is available, M1 Ultra) bind row rather than leaving them off.
  4. Minor: with CONFIG_DEBUG_SHIRQ, __free_irq() calls the handler of a shared line once during unbind. The devm unwind frees the IRQ while the device is runtime-suspended, so apple_ave_dma_irq() reads AVE_DMA_ERROR_STATUS (apple-ave-dma.c:30) in a domain that may be off. To avoid that, add a devm action, registered after devm_request_irq(), that calls pm_runtime_get_sync() so the domain is up when free_irq() runs.

HW row: M1 Pro (T6000) and M1 Max (T6001) on this head with a refreshed Stage 2 DTB. Pass criteria: the reporter binds (/sys/bus/platform/drivers/apple-ave-dma/ lists it); venc_sys is off at idle in genpd_summary both before and after an encode; the H.264 encode numbers match the current ones; module unbind/rebind is clean; 3x s2idle; 0 DMA fault: lines; 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #2811: the same changes with the commit trailers fixed, on the current integration/aurora.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant