Repository navigation
dmaengine: apple-admac: T8132/T6041 split channel banks, no register access at probe, fail cyclic transfers on errors - #379
Merged
RyanTheTide merged 4 commits intoOct 23, 2026
Conversation
Add the T8132 compatible and describe its separate TX/RX register banks while preserving logical channel numbering. Select the channel register base, SRAM layout, transfer configuration and 42-bit DMA mask for this variant. Keep the existing register layout and configuration for earlier hardware. Validation: the affected object builds with the development arm64 configuration; binding schema validation passed. Assisted-By: OpenAI Codex (GPT-6 Astra) Assisted-By: Claude Code (Claude Fable 5.1) Signed-off-by: Niklas Sheth <[email protected]> Link: niklassheth/linux@3f7b289 [jg: ported onto integration/aurora. The channel blocks use aurora's evolved (T8140) register layout, which places them where this patch did, and aurora already sets the 42-bit DMA mask for every variant; what remains is the T8132 compatible, the SRAM size mask, the reserved first SRAM block, the channel config/burst/enable writes and the global CTL write.] Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The ADMACs behind the M4 Pro/Max (T6040/T6041) AOP have the T8132 register layout. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
On the T6040 (M4 Pro) the ADMACs of the AOP audio paths sit in a power domain that the AOP firmware manages. They are powered only once the AOP audio driver has requested an audio power state, which it does right before its first channel request; a register access before that faults. Move the one-time CTL write of the split-bank controllers from probe to the first channel allocation, done once under the carveout allocation lock before the first SRAM carveout access. Write the T603x UNK_28/UNK_2C values only after the slave config has been validated, so that a refused config touches no register. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
A channel error interrupt is cleared and logged, but the cyclic transfer carries on as if nothing happened, and the completion path turns whatever the report FIFO says into period callbacks. A stalled or confused channel then shows up as a PCM that keeps advancing over data that was never moved. Track failures per transfer instead: - prep_dma_cyclic refuses zero or non-dividing period lengths, buffers of 4 GiB or more (the residue is a u32) and a buffer that wraps the DMA address space; - every descriptor written to the ring is counted, and a report for more periods than are outstanding, or a failed ring refill, marks the transfer failed and stops the channel; - a channel error interrupt marks the running transfer failed and stops the channel; - a failed transfer reports DMA_ERROR from tx_status (with the whole buffer as residue), resume refuses it with -EIO, and the tasklet stops invoking period callbacks once the transfer has failed or has been replaced. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
This was referenced Oct 23, 2026
Merged
Merged
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 ADMACs behind the M4 Pro/Max (T6040/T6041) AOP, which carry the microphones and speakers on the MacBook Pro J616s.
[jg: …]note with what changed in the port and aLink:to his original.apple,t6041-admacwith theapple,t8132-admacfallback (t6041 like the other M4 Pro/Max blocks in dt-bindings: Apple M4 Pro/Max (T6040/T6041) compatibles #372).prep_dma_cyclicrefuses bad period/buffer sizes. Pairs with the pcm_dmaengine XRUN fix in Apple platform: small independent fixes (DART page tables, SMC, PWM, LEDs, SPMI, tipd, AVD, ALSA, tas2764) #368.Hardware tested on: Apple MacBook Pro (16-inch, M4 Pro, 2024), J616s / T6040, booted by our own loader with our private T6040 device tree. The AOP microphones and the speakers stream through these ADMACs daily.
Not tested / limits: the error path was exercised only by forced faults during bring-up; other ADMAC SoCs were not tested (the cyclic error tracking acts on all of them). The AOP audio driver that uses this comes in a later PR.
Base:
integration/aurora(6210b28, Linux 7.3).drivers/dma/apple-admac.obuilds with W=1, no warnings. checkpatch --strict: our three commits are clean; Niklas's commit keeps his own message and trailers (long log line,Assisted-Byspelling, binding and driver in one commit). Hardware testing was done on our daily tree (aurora-wip, Linux 7.1.12), which runs this code.Credits: Niklas Sheth (T8132 split channel banks).
🤖 Generated with Claude Code