From mboxrd@z Thu Jan 1 00:00:00 1970 From: hch@lst.de (Christoph Hellwig) Date: Mon, 6 Aug 2018 18:34:16 +0200 Subject: [PATCH 2/3] PCI/xilinx: Work-around for hardware DMA limit (32 bits) In-Reply-To: References: <20180804101402.10022-1-hch@lst.de> <20180804101402.10022-3-hch@lst.de> <20180806123527.GB6997@lst.de> Message-ID: <20180806163416.GA18429@lst.de> To: linux-riscv@lists.infradead.org List-Id: linux-riscv.lists.infradead.org On Mon, Aug 06, 2018 at 09:21:40AM -0700, Wesley Terpstra wrote: > On Mon, Aug 6, 2018 at 5:35 AM, Christoph Hellwig 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).