Aw: DMA memory data race?

Uwe geno.de at public-files.de
Sat Sep 25 15:53:27 CEST 2021



> Gesendet: Freitag, 24. September 2021 um 11:06 Uhr
> Von: "Stefan Thöni" <stefan.thoeni at gapfruit.com>
> An: "users" <users at lists.genode.org>
> Betreff: DMA memory data race?
>
> Hello Genodians
> 
> While implementing our driver for the i.MX8 CAAM device, I experience
> some problems with DMA using the following steps:
> 
> a) Allocate DMA memory using alloc_dma_buffer from the platform session.
> b) Fill the DMA memory with some data.
> c) Tell the hardware to work with the data by register write.
> d) Look at the result code provided by the hardware.
> 
> I observe an error result code from the hardware indicating the DMA read
> failed or returned the wrong data, unless I insert some time-consuming
> code (like a call to Genode::log or just a burning cycles) between b)
> and c).
> 
> I think the problem could be a data race between the CPU filling the RAM
> and the device reading it by DMA. On the other hand, I provide the
> UNCACHED argument to alloc_dma_buffer which should, if my understanding
> is correct, be reflected in the page table disabling the cache thus
> avoiding this problem.
> 
> What am I missing?
Youre missing this proverb: Never debug DMA problems on a linux kernel!
> 
> Kind regards
> Stefan
> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users



More information about the users mailing list