Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: Use iommu_paging_domain_alloc()

Commit <17de3f5fdd35> ("iommu: Retire bus ops") removes iommu ops from
the bus structure. The iommu subsystem no longer relies on bus for
operations. So iommu_domain_alloc() interface is no longer relevant.

Replace iommu_domain_alloc() with iommu_paging_domain_alloc() which takes
the physical device from which the host1x_device virtual device was
instantiated. This physical device is a common parent to all physical
devices that are part of the virtual device.

Suggested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240902014700.66095-4-baolu.lu@linux.intel.com

authored by

Lu Baolu and committed by
Lyude Paul
45c690ae d8c07bee

+3 -2
+3 -2
drivers/gpu/drm/tegra/drm.c
··· 1135 1135 1136 1136 static int host1x_drm_probe(struct host1x_device *dev) 1137 1137 { 1138 + struct device *dma_dev = dev->dev.parent; 1138 1139 struct tegra_drm *tegra; 1139 1140 struct drm_device *drm; 1140 1141 int err; ··· 1150 1149 goto put; 1151 1150 } 1152 1151 1153 - if (host1x_drm_wants_iommu(dev) && iommu_present(&platform_bus_type)) { 1154 - tegra->domain = iommu_domain_alloc(&platform_bus_type); 1152 + if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) { 1153 + tegra->domain = iommu_paging_domain_alloc(dma_dev); 1155 1154 if (!tegra->domain) { 1156 1155 err = -ENOMEM; 1157 1156 goto free;