iommu/amd: Set AMD iommu callbacks for platform bus driver
PATCH 1/1 iommu/amd: Set AMD iommu callbacks for platform bus driver
From: Wan Zongshun <[email protected]>
AMD has more drivers will use ACPI to platform bus driver later, all those devices need iommu support, such as eMMC acpi driver.
--- drivers/iommu/amd_iommu.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/iommu/amd_iommu.c +4 -0
@@ -21,6 +21,7 @@#include <linux/pci.h> #include <linux/acpi.h> #include <linux/amba/bus.h> +#include <linux/platform_device.h> #include <linux/pci-ats.h> #include <linux/bitmap.h> #include <linux/slab.h>
@@ -2980,6 +2981,9 @@ int __init amd_iommu_init_api(void)if (err)return err;#endif + err =bus_set_iommu (&platform_bus_type, &amd_iommu_ops); +if (err) +return err;return 0 ; }
Signature · 1 line
1.9.1
Joerg Roedel
maintainerQuoted 23 lines · Wan Zongshun
From: Wan Zongshun <[email protected]>
AMD has more drivers will use ACPI to platform bus driver later, all those devices need iommu support, such as eMMC acpi driver.
Signed-off-by Wan Zongshun <[email protected]>--- drivers/iommu/amd_iommu.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/iommu/amd_iommu.c +1
-0@@ -21,6 +21,7 @@#include <linux/pci.h> #include <linux/acpi.h> #include <linux/amba/bus.h> +#include <linux/platform_device.h> #include <linux/pci-ats.h> #include <linux/bitmap.h> #include <linux/slab.h>
drivers/iommu/amd_iommu.c int __init amd_iommu_init_api(void) · line 2986
Quoted 6 lines
drivers/iommu/amd_iommu.c +3
-0@@ -2980,6 +2981,9 @@ int __init amd_iommu_init_api(void)if (err)return err;#endif + err =bus_set_iommu (&platform_bus_type, &amd_iommu_ops); +if (err) +return err;
Is the platform_bus_type always defined or does this code needs to be guarded by another ifdef?
Joerg
-------- Original Message --------
Quoted 25 lines · Wan Zongshun
Quoted 24 lines
From: Wan Zongshun <[email protected]>
AMD has more drivers will use ACPI to platform bus driver later, all those devices need iommu support, such as eMMC acpi driver.
Signed-off-by Wan Zongshun <[email protected]>--- drivers/iommu/amd_iommu.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/iommu/amd_iommu.c +1
-0@@ -21,6 +21,7 @@#include <linux/pci.h> #include <linux/acpi.h> #include <linux/amba/bus.h> +#include <linux/platform_device.h> #include <linux/pci-ats.h> #include <linux/bitmap.h> #include <linux/slab.h> @@ -2980,6 +2981,9 @@ int __init amd_iommu_init_api(void)if (err)
Quoted 8 lines
drivers/iommu/amd_iommu.c int __init amd_iommu_init_api(void) · line 2986
Quoted 5 lines
drivers/iommu/amd_iommu.c +3
-0return err;#endif + err =bus_set_iommu (&platform_bus_type, &amd_iommu_ops); +if (err) +return err;Is the
platform_bus_typealways defined or does this code needs to be guarded by another ifdef?
Joerg,
Currently, Only New eMMC driver will rely on this sdhci-acpi.c, but I could not find a suitable ifdef XXX micro to limit this platform_bus_type here like AMBA bus type before.
Do you think this MMC_SDHCI_ACPI is ok?
Vincent.
Quoted 5 lines
Joerg
Joerg Roedel
maintainerQuoted 5 lines · Wan Zongshun
Currently, Only New eMMC driver will rely on this
sdhci-acpi.c, but I could not find a suitable ifdef XXX micro to limit thisplatform_bus_typehere like AMBA bus type before.Do you think this
MMC_SDHCI_ACPIis ok?
Okay, looks like platform_bus_type does not depend on any config-symbol. So the patch is fine, but please add a comment why the iommu-ops are needed on the platform bus.
Joerg