Skip to content

Commit f38338c

Browse files
thierryredingjoergroedel
authored andcommitted
iommu: Do not probe devices on IOMMU-less busses
The host1x bus implemented on Tegra SoCs is primarily an abstraction to create logical device from multiple platform devices. Since the devices in such a setup are typically hierarchical, DMA setup still needs to be done so that DMA masks can be properly inherited, but we don't actually want to attach the host1x logical devices to any IOMMU. The platform devices that make up the logical device are responsible for memory bus transactions, so it is them that will need to be attached to the IOMMU. Add a check to __iommu_probe_device() that aborts IOMMU setup early for busses that don't have the IOMMU operations pointer set since they will cause a crash otherwise. Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent cfcccbe commit f38338c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/iommu/iommu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list
195195
struct iommu_group *group;
196196
int ret;
197197

198+
if (!ops)
199+
return -ENODEV;
200+
198201
if (!dev_iommu_get(dev))
199202
return -ENOMEM;
200203

0 commit comments

Comments
 (0)