]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu: dma: Use of_iommu_get_resv_regions()
authorThierry Reding <treding@nvidia.com>
Fri, 20 Jan 2023 17:42:51 +0000 (18:42 +0100)
committerJoerg Roedel <jroedel@suse.de>
Wed, 25 Jan 2023 10:48:29 +0000 (11:48 +0100)
For device tree nodes, use the standard of_iommu_get_resv_regions()
implementation to obtain the reserved memory regions associated with a
device.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230120174251.4004100-5-thierry.reding@gmail.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c

index f798c44e0903373fbfc973923ca8432c54a1b5f7..8e023f032b7639907795d8e6929bbc4b531f960a 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/memremap.h>
 #include <linux/mm.h>
 #include <linux/mutex.h>
+#include <linux/of_iommu.h>
 #include <linux/pci.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
@@ -391,6 +392,8 @@ void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
        if (!is_of_node(dev_iommu_fwspec_get(dev)->iommu_fwnode))
                iort_iommu_get_resv_regions(dev, list);
 
+       if (dev->of_node)
+               of_iommu_get_resv_regions(dev, list);
 }
 EXPORT_SYMBOL(iommu_dma_get_resv_regions);