Re: [PATCH v6 2/5] dmaengine: arm-dma350: Add slave and cyclic transfer support

From: Jelly Jia

Date: Mon Nov 16 2026 - 05:05:44 EST


Hi Frank,

Thanks for the review.

> Use seperate patch to fix existing problem.

> use new patch for memcpy and memset change.

I'll separate the existing fixes and preparatory changes from the new
slave/cyclic support. The revised DMA series will contain ten patches:

1. Source-trigger bit fix.
2. DMA mask setup error handling.
3. Channel coherency initialization.
4. IRQ, error-state, termination and resource-release lifecycle fixes.
5. Submitted-descriptor status reporting fix.
6. Managed DMA device registration.
7. Explicit descriptor length bookkeeping for memcpy/memset.
8. Slave SG and cyclic support, including managed OF DMA registration.
9. CIX Sky1 binding.
10. Integration clock/reset support.

I'll keep the IRQ/termination changes together so the descriptor lifetime
and channel-state transitions can be reviewed as a whole. The coherency
initialization also affects existing memcpy/memset, so it will be a
separate fix.

> can you use enum/define/struct to avoid hardcode

> convert direct at d350_fill_slave_cmd(), most likely cpu_to_le32() do
> nothingh, to avoid additional data copy

> feel like, needn't save length informaiton, you can get such informaiton
> from cmds

I'll name the command fields, fill the pool commands directly while
preserving the existing little-endian format, and derive SG lengths from
the saved command fields instead of keeping cmd_len[]. I'll also use
scoped guard and the d350_device_config()/d350_device_caps() names.

> Suppose should update it after other field ready. and need dma_wmb() to
> make sure other cmd already written to memory.

> Needn't do memory barrier here, suppose there are issue_transfer() have
> register write, writel() will do that.

The header is a register-update bitmap, not an OWN/VALID flag (TRM 5.7.1).
These are newly prepared commands, fully built before submission; we do
not update an active chain. The first command is loaded through MMIO and
the channel starts with a non-relaxed writel(CH_CMD_ENABLE, ...).

I'll remove the prep-time dma_wmb() and rely on that final writel() for
ordering, without adding a separate header-publication barrier. The
command refactoring will preserve CPU-endian values for MMIO loading.

> Generally, access peripheral register space needn't map, does your hardware
> go through iommu when dma engine access register FIFO?
>
> If yes, I think it should map at set_config to avoid map it every time
> at prepare sg.

There is no IOMMU on this DMA path. However, Sky1's RCSU remaps peripheral
addresses, so the DMA bus address differs from the CPU physical address.
The dma-ranges property describes this, and dma_map_resource() performs
the translation through the direct DMA path.

I'd retain descriptor-owned mappings rather than move them into config,
so their lifetime stays tied to queued/reusable descriptors rather than
subsequent configuration updates. This maps once per descriptor, not once
per SG entry.

> why previous check CH_STAT_INTR_DONE, here use CH_STAT_DONE, suppose it
> is w1c register?

Yes. In CH_STATUS, INTR_DONE/ERR (bits 0/1) are read-only, while
STAT_DONE/ERR (bits 16/17) are W1C. Clearing STAT also clears the matching
INTR flag (TRM 6.5.1.2, Table 6-8). I'll retain that distinction and clarify
it in the patch. ERRINFO is read before clearing STAT_ERR, since clearing
STAT_ERR also clears ERRINFO.

Best regards,
Jelly