On Mon, Aug 06, 2018 at 09:21:40AM -0700, Wesley Terpstra wrote: > On Mon, Aug 6, 2018 at 5:35 AM, Christoph Hellwig <hch@xxxxxx> wrote: > > Note that we already have the mechanism for firmware directed dma limits > > in place, it is called the dma-ranges DT property. If we can get the > > SiFive firmware to set it up properly the RISC-V swiotlb code will > > just do the right thing. > > Does this mean we only need to set the dma-ranges property inside the > pci DTS node? No changes to the driver needed? The code looks at the DT parent of the PCI bridge device. Take a look at drivers/pci/pci-driver.c:pci_dma_configure() and drivers/of/device.c:of_dma_configure() in 4.18-rc (for older kernels the involved functions are slightly different, but the functionality is the same).