]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s
authorRobin Murphy <robin.murphy@arm.com>
Thu, 3 Nov 2016 17:39:07 +0000 (17:39 +0000)
committerJoerg Roedel <jroedel@suse.de>
Tue, 8 Nov 2016 13:46:41 +0000 (14:46 +0100)
commit77558e995199908eabb4525564180879f72b8a87
treeba64026a7ea18e1036634a9664d05782d1f85a81
parent2b3d5cd56f3e9790db1eb8f88aea0a78ab5b4cf5
iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s

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: d3af4bdc0eee ("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: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/arm-smmu-v3.c