iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: set AMD iommu-callbacks for the amba bus
@ 2015-12-29 16:54 Wan Zongshun
       [not found] ` <1451408093-2802-1-git-send-email-vincent.wan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wan Zongshun @ 2015-12-29 16:54 UTC (permalink / raw)
  To: Joerg Roedel, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Wan Zongshun, Ray Huang, ken.xue-5C7GfCeVMHo,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

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

Since uart dma is using AMD iommu, and it bases on amba bus.
So we need set callbacks for amba bus type firstly.

Signed-off-by: Wan Zongshun <Vincent.Wan-5C7GfCeVMHo@public.gmane.org>
---
 drivers/iommu/amd_iommu.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8b2be1e..9097b11 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -35,6 +35,7 @@
 #include <linux/msi.h>
 #include <linux/dma-contiguous.h>
 #include <linux/irqdomain.h>
+#include <linux/amba/bus.h>
 #include <asm/irq_remapping.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
@@ -2758,7 +2759,17 @@ static struct dma_map_ops amd_iommu_dma_ops = {
 
 int __init amd_iommu_init_api(void)
 {
-	return bus_set_iommu(&pci_bus_type, &amd_iommu_ops);
+	int err = 0;
+
+	err = bus_set_iommu(&pci_bus_type, &amd_iommu_ops);
+	if (err)
+		return err;
+#ifdef CONFIG_ARM_AMBA
+	err = bus_set_iommu(&amba_bustype, &amd_iommu_ops);
+	if (err)
+		return err;
+#endif
+	return 0;
 }
 
 int __init amd_iommu_init_dma_ops(void)
-- 
1.9.1

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

* Re: [PATCH] iommu/amd: set AMD iommu-callbacks for the amba bus
       [not found] ` <1451408093-2802-1-git-send-email-vincent.wan-5C7GfCeVMHo@public.gmane.org>
@ 2016-01-19  1:49   ` Wan ZongShun
       [not found]     ` <CAKT61h8AWzChE7eqiYwDMYPSoHM9HM2EvpWiD0kjkKtR+1-TRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wan ZongShun @ 2016-01-19  1:49 UTC (permalink / raw)
  To: Wan Zongshun, Borislav Petkov, vw-6ukY98dZOFrYtjvyW6yDsg
  Cc: Ray Huang, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	ken.xue-5C7GfCeVMHo, linux-kernel

2015-12-30 0:54 GMT+08:00 Wan Zongshun <vincent.wan-5C7GfCeVMHo@public.gmane.org>:
> From: Wan Zongshun <Vincent.Wan-5C7GfCeVMHo@public.gmane.org>
>
> Since uart dma is using AMD iommu, and it bases on amba bus.
> So we need set callbacks for amba bus type firstly.
>
> Signed-off-by: Wan Zongshun <Vincent.Wan-5C7GfCeVMHo@public.gmane.org>

Joerg,
How about this patch?
It is a separating patch to our acpihid device support patches.

> ---
>  drivers/iommu/amd_iommu.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 8b2be1e..9097b11 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -35,6 +35,7 @@
>  #include <linux/msi.h>
>  #include <linux/dma-contiguous.h>
>  #include <linux/irqdomain.h>
> +#include <linux/amba/bus.h>
>  #include <asm/irq_remapping.h>
>  #include <asm/io_apic.h>
>  #include <asm/apic.h>
> @@ -2758,7 +2759,17 @@ static struct dma_map_ops amd_iommu_dma_ops = {
>
>  int __init amd_iommu_init_api(void)
>  {
> -       return bus_set_iommu(&pci_bus_type, &amd_iommu_ops);
> +       int err = 0;
> +
> +       err = bus_set_iommu(&pci_bus_type, &amd_iommu_ops);
> +       if (err)
> +               return err;
> +#ifdef CONFIG_ARM_AMBA
> +       err = bus_set_iommu(&amba_bustype, &amd_iommu_ops);
> +       if (err)
> +               return err;
> +#endif
> +       return 0;
>  }
>
>  int __init amd_iommu_init_dma_ops(void)
> --
> 1.9.1
>
> _______________________________________________
> iommu mailing list
> iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu



-- 
---
Vincent Wan(Zongshun)
www.mcuos.com

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

* Re: [PATCH] iommu/amd: set AMD iommu-callbacks for the amba bus
       [not found]     ` <CAKT61h8AWzChE7eqiYwDMYPSoHM9HM2EvpWiD0kjkKtR+1-TRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-01-20 11:58       ` Joerg Roedel
  0 siblings, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2016-01-20 11:58 UTC (permalink / raw)
  To: Wan ZongShun
  Cc: linux-kernel, Wan Zongshun,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Ray Huang,
	Borislav Petkov, ken.xue-5C7GfCeVMHo

Hi,

On Tue, Jan 19, 2016 at 09:49:08AM +0800, Wan ZongShun wrote:
> It is a separating patch to our acpihid device support patches.

Please re-submit it after the merge window together with the acpihid
support patches. This stuff can be merged together.

Thanks,

	Joerg

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

end of thread, other threads:[~2016-01-20 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-29 16:54 [PATCH] iommu/amd: set AMD iommu-callbacks for the amba bus Wan Zongshun
     [not found] ` <1451408093-2802-1-git-send-email-vincent.wan-5C7GfCeVMHo@public.gmane.org>
2016-01-19  1:49   ` Wan ZongShun
     [not found]     ` <CAKT61h8AWzChE7eqiYwDMYPSoHM9HM2EvpWiD0kjkKtR+1-TRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-01-20 11:58       ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).