• Robin Murphy's avatar
    iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s · ec615f43
    Robin Murphy authored
    We now delay installing our per-bus iommu_ops until we know an SMMU has
    successfully probed, as they don't serve much purpose beforehand, and
    doing so also avoids fights between multiple IOMMU drivers in a single
    kernel. However, the upshot of passing the return value of bus_set_iommu()
    back from our probe function is that if there happens to be more than
    one SMMUv3 device in a system, the second and subsequent probes will
    wind up returning -EBUSY to the driver core and getting torn down again.
    
    Avoid re-setting ops if ours are already installed, so that any genuine
    failures stand out.
    
    Fixes: 08d4ca2a ("iommu/arm-smmu: Support non-PCI devices with SMMUv3")
    CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    CC: Hanjun Guo <hanjun.guo@linaro.org>
    Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    ec615f43
arm-smmu-v3.c 69.6 KB