]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iommu/arm-smmu: Support SMMU module probing from the IORT
authorArd Biesheuvel <ardb@kernel.org>
Thu, 19 Dec 2019 12:03:48 +0000 (12:03 +0000)
committerJoerg Roedel <jroedel@suse.de>
Mon, 23 Dec 2019 13:06:05 +0000 (14:06 +0100)
Add support for SMMU drivers built as modules to the ACPI/IORT device
probing path, by deferring the probe of the master if the SMMU driver is
known to exist but has not been loaded yet. Given that the IORT code
registers a platform device for each SMMU that it discovers, we can
easily trigger the udev based autoloading of the SMMU drivers by making
the platform device identifier part of the module alias.

Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tested-by: John Garry <john.garry@huawei.com> # only manual smmu ko loading
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Tested-by: John Garry <john.garry@huawei.com> # smmu v3
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/acpi/arm64/iort.c
drivers/iommu/arm-smmu-v3.c
drivers/iommu/arm-smmu.c

index 33f71983e001758ab0c4be5c2caf40f24c9b293d..4a560fdf738649710fd9c9e02571f6decfa90c34 100644 (file)
@@ -850,9 +850,9 @@ static inline bool iort_iommu_driver_enabled(u8 type)
 {
        switch (type) {
        case ACPI_IORT_NODE_SMMU_V3:
-               return IS_BUILTIN(CONFIG_ARM_SMMU_V3);
+               return IS_ENABLED(CONFIG_ARM_SMMU_V3);
        case ACPI_IORT_NODE_SMMU:
-               return IS_BUILTIN(CONFIG_ARM_SMMU);
+               return IS_ENABLED(CONFIG_ARM_SMMU);
        default:
                pr_warn("IORT node type %u does not describe an SMMU\n", type);
                return false;
index 46160a2fec3ef893675e523489b2db7c02a8b7ea..da9474a02668675e9bf0e1b676694ac33cc73930 100644 (file)
@@ -3734,4 +3734,5 @@ module_platform_driver(arm_smmu_driver);
 
 MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
 MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
+MODULE_ALIAS("platform:arm-smmu-v3");
 MODULE_LICENSE("GPL v2");
index 5cbee88a3b83550faf87e6ba13dc4d60b2dd1b69..5d2f60bb9e50db9a124c8056ad798ae2c8ab1996 100644 (file)
@@ -2281,4 +2281,5 @@ module_platform_driver(arm_smmu_driver);
 
 MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
 MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
+MODULE_ALIAS("platform:arm-smmu");
 MODULE_LICENSE("GPL v2");