[PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set

Christoph Hellwig hch at lst.de
Fri Dec 22 07:04:17 PST 2023


On Fri, Dec 22, 2023 at 02:54:19PM +0000, Conor Dooley wrote:
> > of_dma_is_coherent() affects only DT devices. And we can override it with
> > "dma-coherent"/"dma-noncoherent". ACPI devices can specify by
> > "attr == DEV_DMA_COHERENT". But all other devices (platform_device, usb,
> 
> I would have expected that usb devices "inherit" the value from the usb
> controller whose bus they are on. Similarly, platform devices are on a
> bus that should be marked as non-coherent if that is the case.
> Christoph certainly knows better how things operate here however.

usb is not a DMAable devices, you need to use the USB layer helpers
that call the DMA API on the host controller's device.  platform_device
must have a device tree and the dma-noncoherent attribute somewhere in
the hierarchy.



More information about the linux-riscv mailing list