non-coherence DMA run-time detection

Matwey V. Kornilov matwey.kornilov at gmail.com
Sat Apr 14 09:53:58 EDT 2018


Hi,

I am suffering from performance issue similar to that is supposed to be
fixed by

    3e0ac6717b0a ("[media] media: Fix a UVC performance problem on
systems with non-coherent DMA")
https://github.com/torvalds/linux/commit/3e0ac6717b0a2593243ef3850025a42cb199880f

The patch operates with CONFIG_DMA_NONCOHERENT compile-time option which
is present only for mips and sh architectures. At the same time, some
ARM platforms are also DMA non-coherent that leads to the similar
memcpy() performance issues as mentioned in the patch. However, we learn
whether we run with coherent or non-coherent DMA at run-time while
parsing FDT in case of ARM platforms. This happens in of_dma_configure()
function.

I would like to find a way to re-implement the patch for the case of ARM
platforms, but unfortunately I could not find preferred way to check DMA
coherency in run-time. Could you please advice?


p.s. Frankly speaking, the patch looks to be redundant for me. I have no
idea why DMA coherency could be really required for USB Isochronous
input buffer. At the host side there is only reading operation, that
means that single barrier would have been sufficient here.




More information about the Kernelnewbies mailing list