Skip to contentSkip to conversation

iommu/amd: Set AMD iommu callbacks for platform bus driver

PATCH Superseded Wan Zongshun 3 participants 4 messages Apr 14, 2016 – May 9, 2016 IOMMU

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index c430c10..547cdd4 100644
@@ -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
maintainer
#1 lore raw
Quoted 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.

---
 drivers/iommu/amd_iommu.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iommu/amd_iommu.c +1 -0
index c430c10..547cdd4 100644
@@ -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

#2 lore raw

-------- 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.

---
 drivers/iommu/amd_iommu.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iommu/amd_iommu.c +1 -0
index c430c10..547cdd4 100644
@@ -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 -0
 		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,

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

maintainer
#3 lore raw
Quoted 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 this platform_bus_type here like AMBA bus type before.

Do you think this MMC_SDHCI_ACPI is 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