diff options
author | Claire Chang <tientzu@chromium.org> | 2021-06-19 05:40:43 +0200 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad@kernel.org> | 2021-07-14 02:04:53 +0200 |
commit | fec9b625095f7308e52a6922619cd4abaa9534a8 (patch) | |
tree | bc5495ba83cb96359a1b802e33d317127d7bb3b9 /drivers/of/device.c | |
parent | dt-bindings: of: Add restricted DMA pool (diff) | |
download | linux-fec9b625095f7308e52a6922619cd4abaa9534a8.tar.xz linux-fec9b625095f7308e52a6922619cd4abaa9534a8.zip |
of: Add plumbing for restricted DMA pool
If a device is not behind an IOMMU, we look up the device node and set
up the restricted DMA when the restricted-dma-pool is presented.
Signed-off-by: Claire Chang <tientzu@chromium.org>
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Will Deacon <will@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r-- | drivers/of/device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index c5a9473a5fb1..2defdca418ec 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -165,6 +165,9 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, arch_setup_dma_ops(dev, dma_start, size, iommu, coherent); + if (!iommu) + return of_dma_set_restricted_buffer(dev, np); + return 0; } EXPORT_SYMBOL_GPL(of_dma_configure_id); |