Skip to content

Commit 580ee84

Browse files
ambarusvinodkoul
authored andcommitted
dmaengine: at_hdmac: Don't allow CPU to reorder channel enable
at_hdmac uses __raw_writel for register writes. In the absence of a barrier, the CPU may reorder the register operations. Introduce a write memory barrier so that the CPU does not reorder the channel enable, thus the start of the transfer, without making sure that all the pre-required register fields are already written. Fixes: dc78baa ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin <[email protected]> Signed-off-by: Tudor Ambarus <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/lkml/[email protected]/ Acked-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent ef2cb4f commit 580ee84

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/dma/at_hdmac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
256256
ATC_SPIP_BOUNDARY(first->boundary));
257257
channel_writel(atchan, DPIP, ATC_DPIP_HOLE(first->dst_hole) |
258258
ATC_DPIP_BOUNDARY(first->boundary));
259+
/* Don't allow CPU to reorder channel enable. */
260+
wmb();
259261
dma_writel(atdma, CHER, atchan->mask);
260262

261263
vdbg_dump_regs(atchan);

0 commit comments

Comments
 (0)