summaryrefslogtreecommitdiff
path: root/drivers/of/device.c
diff options
context:
space:
mode:
authorClaire Chang <tientzu@chromium.org>2021-06-19 06:40:43 +0300
committerKonrad Rzeszutek Wilk <konrad@kernel.org>2021-07-14 03:04:53 +0300
commitfec9b625095f7308e52a6922619cd4abaa9534a8 (patch)
treebc5495ba83cb96359a1b802e33d317127d7bb3b9 /drivers/of/device.c
parentb12fe999545cf3fd89e1a178ee4e541a9331da82 (diff)
downloadlinux-fec9b625095f7308e52a6922619cd4abaa9534a8.tar.xz
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.c3
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);