All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver
@ 2016-04-14 13:28 ` Wan Zongshun
  0 siblings, 0 replies; 6+ messages in thread
From: Wan Zongshun @ 2016-04-14 13:28 UTC (permalink / raw)
  To: Joerg Roedel, iommu; +Cc: vw, mcuos.com, linux-kernel, Wan Zongshun

From: Wan Zongshun <Vincent.Wan@amd.com>

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 <Vincent.Wan@amd.com>
---
 drivers/iommu/amd_iommu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index c430c10..547cdd4 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -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;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver
@ 2016-04-14 13:28 ` Wan Zongshun
  0 siblings, 0 replies; 6+ messages in thread
From: Wan Zongshun @ 2016-04-14 13:28 UTC (permalink / raw)
  To: Joerg Roedel, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Wan Zongshun, linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Wan Zongshun <Vincent.Wan-5C7GfCeVMHo@public.gmane.org>

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 <Vincent.Wan-5C7GfCeVMHo@public.gmane.org>
---
 drivers/iommu/amd_iommu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index c430c10..547cdd4 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -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;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver
  2016-04-14 13:28 ` Wan Zongshun
  (?)
@ 2016-05-09 10:20 ` Joerg Roedel
  2016-05-09 12:17   ` Wan Zongshun
  -1 siblings, 1 reply; 6+ messages in thread
From: Joerg Roedel @ 2016-05-09 10:20 UTC (permalink / raw)
  To: Wan Zongshun; +Cc: iommu, vw, mcuos.com, linux-kernel

On Thu, Apr 14, 2016 at 09:28:53AM -0400, Wan Zongshun wrote:
> From: Wan Zongshun <Vincent.Wan@amd.com>
> 
> 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 <Vincent.Wan@amd.com>
> ---
>  drivers/iommu/amd_iommu.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index c430c10..547cdd4 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -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;

Is the platform_bus_type always defined or does this code needs to be
guarded by another ifdef?



	Joerg

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver
  2016-05-09 10:20 ` Joerg Roedel
@ 2016-05-09 12:17   ` Wan Zongshun
  2016-05-09 16:16       ` Joerg Roedel
  0 siblings, 1 reply; 6+ messages in thread
From: Wan Zongshun @ 2016-05-09 12:17 UTC (permalink / raw)
  To: Joerg Roedel, Wan Zongshun; +Cc: iommu, mcuos.com, linux-kernel



-------- Original Message --------
> On Thu, Apr 14, 2016 at 09:28:53AM -0400, Wan Zongshun wrote:
>> From: Wan Zongshun <Vincent.Wan@amd.com>
>>
>> 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 <Vincent.Wan@amd.com>
>> ---
>>  drivers/iommu/amd_iommu.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>> index c430c10..547cdd4 100644
>> --- a/drivers/iommu/amd_iommu.c
>> +++ b/drivers/iommu/amd_iommu.c
>> @@ -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;
>
> 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.

>
>
>
> 	Joerg
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver
@ 2016-05-09 16:16       ` Joerg Roedel
  0 siblings, 0 replies; 6+ messages in thread
From: Joerg Roedel @ 2016-05-09 16:16 UTC (permalink / raw)
  To: Wan Zongshun; +Cc: Wan Zongshun, iommu, mcuos.com, linux-kernel

On Mon, May 09, 2016 at 08:17:12PM +0800, Wan Zongshun wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver
@ 2016-05-09 16:16       ` Joerg Roedel
  0 siblings, 0 replies; 6+ messages in thread
From: Joerg Roedel @ 2016-05-09 16:16 UTC (permalink / raw)
  To: Wan Zongshun
  Cc: Wan Zongshun, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, May 09, 2016 at 08:17:12PM +0800, Wan Zongshun wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-09 16:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 13:28 [PATCH] iommu/amd: Set AMD iommu callbacks for platform bus driver Wan Zongshun
2016-04-14 13:28 ` Wan Zongshun
2016-05-09 10:20 ` Joerg Roedel
2016-05-09 12:17   ` Wan Zongshun
2016-05-09 16:16     ` Joerg Roedel
2016-05-09 16:16       ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.