On Fri, Jun 7, 2024 at 6:17 PM Peter Maydell <peter.mayd...@linaro.org> wrote: > > On Thu, 6 Jun 2024 at 22:18, Robin Murphy <robin.mur...@arm.com> wrote: > > > > On 2024-06-06 6:13 pm, Jonathan Cameron wrote: > > > On Thu, 6 Jun 2024 12:56:59 +0100 > > > Peter Maydell <peter.mayd...@linaro.org> wrote: > > > > > >> On Thu, 6 Jun 2024 at 11:48, Zhenyu Zhang <zheny...@redhat.com> wrote: > > >>> In Linux, a check is applied to every device which is exposed through > > >>> device-tree > > >>> node. The warning message is raised when the device isn't DMA coherent > > >>> and the > > >>> cache line size is larger than ARCH_DMA_MINALIGN (128 bytes). The cache > > >>> line is > > >>> sorted from CTR_EL0[CWG], which corresponds to 256 bytes on the guest > > >>> CPUs. > > >>> The DMA coherent capability is claimed through 'dma-coherent' in their > > >>> device-tree nodes. > > >> > > >> For QEMU emulated all our DMA is always coherent, so where we > > >> have DMA-capable devices we should definitely tell the kernel > > >> that that DMA is coherent. > > > > The trick for that is to put the "dma-coherent" property right in the > > root of the DT so it plausibly communicates "the whole platform is > > coherent", and is then inherited by all devices, even those which > > shouldn't technically need it. > > Ah, cool -- that's a pretty small change and it makes sense, and > avoids us having potential bugs in future where we forget to > mark a really-does-do-DMA device as dma-coherent. I like that > a lot better than adding incorrect dma-coherent tags to lots > of device nodes that aren't for DMA-capable devices. Hi Robin, Peter, and Jonathan,
Thanks for your suggestions, it helps me a lot! I will submit a v2 patch that puts the "dma-coherent" property right in the root of the DT so it plausibly communicates. Yes, these discussions make sense. I will modify and test it again on Fujitsu host. Thanks again Zhenyu > > thanks > -- PMM >