Re: [PATCH v2] dma: altera-msgdma: Use memcpy_toio for descriptor FIFO writes

From: Vinod Koul

Date: Thu Jun 11 2026 - 01:53:51 EST



On Mon, 25 May 2026 01:37:30 -0700, tze.yee.ng@xxxxxxxxxx wrote:
> The descriptor FIFO requires that all words of a descriptor are written
> in order, with the control word written last to flush it into the DMA
> engine. Using memcpy() with __force to __iomem is not the correct API
> and does not guarantee appropriate MMIO access on all architectures.
>
> Replace the descriptor body copy with memcpy_toio(), using
> offsetof(struct msgdma_extended_desc, control) to exclude the control
> word. This matches the previous sizeof(desc->hw_desc) - sizeof(u32)
> length only when control is the last struct member; add a static_assert
> to enforce that layout so a future field after control cannot silently
> break FIFO ordering.
>
> [...]

Applied, thanks!

[1/1] dma: altera-msgdma: Use memcpy_toio for descriptor FIFO writes
commit: 94963138cce29f85605d76c94fa1d43a0335ead9

Best regards,
--
~Vinod