linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6 v2] Introduce device_iommu_mapped() function
@ 2018-12-11 13:43 Joerg Roedel
  2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

Hi,

here is the second version of this patch-set. It replaces
the various (dev->iommu_group) checks with a function call
which better expresses their intend.

Changes to the first version are the added patch for
rcar-dmac, a driver I missed before. I also added all
Acked-By's I received on the first version.

Please review and provide Acks, if there are no objections.
I have some iommu patches that depend on these, so I'd like
to carry this patch-set in the IOMMU tree.

Regards,

	Joerg

Joerg Roedel (6):
  driver core: Introduce device_iommu_mapped() function
  iommu/of: Use device_iommu_mapped()
  ACPI/IORT: Use device_iommu_mapped()
  powerpc/iommu: Use device_iommu_mapped()
  xhci: Use device_iommu_mapped()
  dmaengine: sh: rcar-dmac: Use device_iommu_mapped()

 arch/powerpc/kernel/eeh.c   |  2 +-
 arch/powerpc/kernel/iommu.c |  6 +++---
 drivers/acpi/arm64/iort.c   |  2 +-
 drivers/dma/sh/rcar-dmac.c  |  2 +-
 drivers/iommu/of_iommu.c    |  2 +-
 drivers/usb/host/xhci.c     |  2 +-
 include/linux/device.h      | 10 ++++++++++
 7 files changed, 18 insertions(+), 8 deletions(-)

-- 
2.17.1


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

* [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
@ 2018-12-11 13:43 ` Joerg Roedel
  2018-12-11 14:59   ` Sergei Shtylyov
                     ` (2 more replies)
  2018-12-11 13:43 ` [PATCH 2/6] iommu/of: Use device_iommu_mapped() Joerg Roedel
                   ` (4 subsequent siblings)
  5 siblings, 3 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

From: Joerg Roedel <jroedel@suse.de>

Some places in the kernel check the iommu_group pointer in
'struct device' in order to find ot whether a device is
mapped by an IOMMU.

This is not good way to make this check, as the pointer will
be moved to 'struct dev_iommu_data'. This way to make the
check is also not very readable.

Introduce an explicit function to perform this check.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 include/linux/device.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 1b25c7a43f4c..6cb4640b6160 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1058,6 +1058,16 @@ static inline struct device *kobj_to_dev(struct kobject *kobj)
 	return container_of(kobj, struct device, kobj);
 }
 
+/**
+ * device_iommu_mapped - Returns true when the device DMA is translated
+ *			 by an IOMMU
+ * @dev: Device to perform the check on
+ */
+static inline bool device_iommu_mapped(struct device *dev)
+{
+	return (dev->iommu_group != NULL);
+}
+
 /* Get the wakeup routines, which depend on struct device */
 #include <linux/pm_wakeup.h>
 
-- 
2.17.1


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

* [PATCH 2/6] iommu/of: Use device_iommu_mapped()
  2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
  2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
@ 2018-12-11 13:43 ` Joerg Roedel
  2018-12-11 13:43 ` [PATCH 3/6] ACPI/IORT: " Joerg Roedel
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

From: Joerg Roedel <jroedel@suse.de>

Use Use device_iommu_mapped() to check if the device is
already mapped by an IOMMU.

Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/of_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index c5dd63072529..bfcf139503f0 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -220,7 +220,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
 	 * If we have reason to believe the IOMMU driver missed the initial
 	 * add_device callback for dev, replay it to get things in order.
 	 */
-	if (ops && ops->add_device && dev->bus && !dev->iommu_group)
+	if (ops && ops->add_device && dev->bus && !device_iommu_mapped(dev))
 		err = ops->add_device(dev);
 
 	/* Ignore all other errors apart from EPROBE_DEFER */
-- 
2.17.1


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

* [PATCH 3/6] ACPI/IORT: Use device_iommu_mapped()
  2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
  2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
  2018-12-11 13:43 ` [PATCH 2/6] iommu/of: Use device_iommu_mapped() Joerg Roedel
@ 2018-12-11 13:43 ` Joerg Roedel
  2018-12-17  9:21   ` Hanjun Guo
  2018-12-11 13:43 ` [PATCH 4/6] powerpc/iommu: " Joerg Roedel
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

From: Joerg Roedel <jroedel@suse.de>

Replace the iommu-check with a proper and readable function
call.

Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 70f4e80b9246..0125c8eb9e81 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -805,7 +805,7 @@ static inline int iort_add_device_replay(const struct iommu_ops *ops,
 {
 	int err = 0;
 
-	if (ops->add_device && dev->bus && !dev->iommu_group)
+	if (ops->add_device && dev->bus && !device_iommu_mapped(dev))
 		err = ops->add_device(dev);
 
 	return err;
-- 
2.17.1


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

* [PATCH 4/6] powerpc/iommu: Use device_iommu_mapped()
  2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
                   ` (2 preceding siblings ...)
  2018-12-11 13:43 ` [PATCH 3/6] ACPI/IORT: " Joerg Roedel
@ 2018-12-11 13:43 ` Joerg Roedel
  2018-12-11 13:43 ` [PATCH 5/6] xhci: " Joerg Roedel
  2018-12-11 13:43 ` [PATCH 6/6] dmaengine: sh: rcar-dmac: " Joerg Roedel
  5 siblings, 0 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

From: Joerg Roedel <jroedel@suse.de>

Use the new function to replace the open-coded iommu check.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell Currey <ruscur@russell.cc>
Cc: Sam Bobroff <sbobroff@linux.ibm.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 arch/powerpc/kernel/eeh.c   | 2 +-
 arch/powerpc/kernel/iommu.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 6cae6b56ffd6..23fe62f11486 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -1472,7 +1472,7 @@ static int dev_has_iommu_table(struct device *dev, void *data)
 	if (!dev)
 		return 0;
 
-	if (dev->iommu_group) {
+	if (device_iommu_mapped(dev)) {
 		*ppdev = pdev;
 		return 1;
 	}
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index f0dc680e659a..48d58d1dcac2 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -1086,7 +1086,7 @@ int iommu_add_device(struct device *dev)
 	if (!device_is_registered(dev))
 		return -ENOENT;
 
-	if (dev->iommu_group) {
+	if (device_iommu_mapped(dev)) {
 		pr_debug("%s: Skipping device %s with iommu group %d\n",
 			 __func__, dev_name(dev),
 			 iommu_group_id(dev->iommu_group));
@@ -1129,7 +1129,7 @@ void iommu_del_device(struct device *dev)
 	 * and we needn't detach them from the associated
 	 * IOMMU groups
 	 */
-	if (!dev->iommu_group) {
+	if (!device_iommu_mapped(dev)) {
 		pr_debug("iommu_tce: skipping device %s with no tbl\n",
 			 dev_name(dev));
 		return;
@@ -1148,7 +1148,7 @@ static int tce_iommu_bus_notifier(struct notifier_block *nb,
         case BUS_NOTIFY_ADD_DEVICE:
                 return iommu_add_device(dev);
         case BUS_NOTIFY_DEL_DEVICE:
-                if (dev->iommu_group)
+                if (device_iommu_mapped(dev))
                         iommu_del_device(dev);
                 return 0;
         default:
-- 
2.17.1


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

* [PATCH 5/6] xhci: Use device_iommu_mapped()
  2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
                   ` (3 preceding siblings ...)
  2018-12-11 13:43 ` [PATCH 4/6] powerpc/iommu: " Joerg Roedel
@ 2018-12-11 13:43 ` Joerg Roedel
  2018-12-17 11:21   ` Mathias Nyman
  2018-12-11 13:43 ` [PATCH 6/6] dmaengine: sh: rcar-dmac: " Joerg Roedel
  5 siblings, 1 reply; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

From: Joerg Roedel <jroedel@suse.de>

Replace the dev->iommu_group check with a proper function
call that better reprensents its purpose.

Cc: Mathias Nyman <mathias.nyman@intel.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/usb/host/xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index dae3be1b9c8f..8eacd2ed412b 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -244,7 +244,7 @@ static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
 	 * an iommu. Doing anything when there is no iommu is definitely
 	 * unsafe...
 	 */
-	if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !dev->iommu_group)
+	if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !device_iommu_mapped(dev))
 		return;
 
 	xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");
-- 
2.17.1


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

* [PATCH 6/6] dmaengine: sh: rcar-dmac: Use device_iommu_mapped()
  2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
                   ` (4 preceding siblings ...)
  2018-12-11 13:43 ` [PATCH 5/6] xhci: " Joerg Roedel
@ 2018-12-11 13:43 ` Joerg Roedel
  2018-12-17  6:11   ` Vinod Koul
  5 siblings, 1 reply; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 13:43 UTC (permalink / raw)
  To: iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, Joerg Roedel, jroedel,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

From: Joerg Roedel <jroedel@suse.de>

Use Use device_iommu_mapped() to check if the device is
already mapped by an IOMMU.

Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/dma/sh/rcar-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 74fa2b1a6a86..2b4f25698169 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1809,7 +1809,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
 	 * level we can't disable it selectively, so ignore channel 0 for now if
 	 * the device is part of an IOMMU group.
 	 */
-	if (pdev->dev.iommu_group) {
+	if (device_iommu_mapped(&pdev->dev)) {
 		dmac->n_channels--;
 		channels_offset = 1;
 	}
-- 
2.17.1


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

* Re: [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
@ 2018-12-11 14:59   ` Sergei Shtylyov
  2018-12-11 15:18     ` Joerg Roedel
  2018-12-12 11:04   ` Greg Kroah-Hartman
  2018-12-17  6:11   ` Vinod Koul
  2 siblings, 1 reply; 16+ messages in thread
From: Sergei Shtylyov @ 2018-12-11 14:59 UTC (permalink / raw)
  To: Joerg Roedel, iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, jroedel, Mathias Nyman,
	Greg Kroah-Hartman, linux-kernel, linux-acpi, dmaengine,
	linux-usb

Hello!

On 12/11/2018 04:43 PM, Joerg Roedel wrote:

> From: Joerg Roedel <jroedel@suse.de>
> 
> Some places in the kernel check the iommu_group pointer in
> 'struct device' in order to find ot whether a device is
> mapped by an IOMMU.
> 
> This is not good way to make this check, as the pointer will
> be moved to 'struct dev_iommu_data'. This way to make the
> check is also not very readable.
> 
> Introduce an explicit function to perform this check.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  include/linux/device.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 1b25c7a43f4c..6cb4640b6160 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -1058,6 +1058,16 @@ static inline struct device *kobj_to_dev(struct kobject *kobj)
>  	return container_of(kobj, struct device, kobj);
>  }
>  
> +/**
> + * device_iommu_mapped - Returns true when the device DMA is translated
> + *			 by an IOMMU
> + * @dev: Device to perform the check on
> + */
> +static inline bool device_iommu_mapped(struct device *dev)
> +{
> +	return (dev->iommu_group != NULL);

   You know that parens are unnecessary here, right? :-)

> +}
> +
>  /* Get the wakeup routines, which depend on struct device */
>  #include <linux/pm_wakeup.h>
>  

MBR, Sergei


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

* Re: [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-11 14:59   ` Sergei Shtylyov
@ 2018-12-11 15:18     ` Joerg Roedel
  0 siblings, 0 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-11 15:18 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: iommu, Russell Currey, Sam Bobroff, oohall,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Dan Williams,
	Vinod Koul, jroedel, Mathias Nyman, Greg Kroah-Hartman,
	linux-kernel, linux-acpi, dmaengine, linux-usb

On Tue, Dec 11, 2018 at 05:59:33PM +0300, Sergei Shtylyov wrote:
> > +static inline bool device_iommu_mapped(struct device *dev)
> > +{
> > +	return (dev->iommu_group != NULL);
> 
>    You know that parens are unnecessary here, right? :-)

Yes, I know, but it feels incomplete to me without them :-)

	Joerg

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

* Re: [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
  2018-12-11 14:59   ` Sergei Shtylyov
@ 2018-12-12 11:04   ` Greg Kroah-Hartman
  2018-12-12 11:07     ` Joerg Roedel
  2018-12-17  6:11   ` Vinod Koul
  2 siblings, 1 reply; 16+ messages in thread
From: Greg Kroah-Hartman @ 2018-12-12 11:04 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, Russell Currey, Sam Bobroff, oohall,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Dan Williams,
	Vinod Koul, jroedel, Mathias Nyman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

On Tue, Dec 11, 2018 at 02:43:38PM +0100, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Some places in the kernel check the iommu_group pointer in
> 'struct device' in order to find ot whether a device is
> mapped by an IOMMU.
> 
> This is not good way to make this check, as the pointer will
> be moved to 'struct dev_iommu_data'. This way to make the
> check is also not very readable.
> 
> Introduce an explicit function to perform this check.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

No need to have a cc: line if I have already acked it :)

thanks,

greg k-h

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

* Re: [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-12 11:04   ` Greg Kroah-Hartman
@ 2018-12-12 11:07     ` Joerg Roedel
  0 siblings, 0 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-12 11:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Joerg Roedel, iommu, Russell Currey, Sam Bobroff, oohall,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Dan Williams,
	Vinod Koul, Mathias Nyman, linux-kernel, linux-acpi, dmaengine,
	linux-usb

On Wed, Dec 12, 2018 at 12:04:35PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Dec 11, 2018 at 02:43:38PM +0100, Joerg Roedel wrote:
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> No need to have a cc: line if I have already acked it :)

Right, I'll remove it, sorry for the noise.

Regards,

	Joerg

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

* Re: [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
  2018-12-11 14:59   ` Sergei Shtylyov
  2018-12-12 11:04   ` Greg Kroah-Hartman
@ 2018-12-17  6:11   ` Vinod Koul
  2018-12-17  9:31     ` Joerg Roedel
  2 siblings, 1 reply; 16+ messages in thread
From: Vinod Koul @ 2018-12-17  6:11 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, Russell Currey, Sam Bobroff, oohall,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Dan Williams,
	jroedel, Mathias Nyman, Greg Kroah-Hartman, linux-kernel,
	linux-acpi, dmaengine, linux-usb

On 11-12-18, 14:43, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Some places in the kernel check the iommu_group pointer in
> 'struct device' in order to find ot whether a device is
                                   ^^
Typo
-- 
~Vinod

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

* Re: [PATCH 6/6] dmaengine: sh: rcar-dmac: Use device_iommu_mapped()
  2018-12-11 13:43 ` [PATCH 6/6] dmaengine: sh: rcar-dmac: " Joerg Roedel
@ 2018-12-17  6:11   ` Vinod Koul
  0 siblings, 0 replies; 16+ messages in thread
From: Vinod Koul @ 2018-12-17  6:11 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu, Russell Currey, Sam Bobroff, oohall,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Dan Williams,
	jroedel, Mathias Nyman, Greg Kroah-Hartman, linux-kernel,
	linux-acpi, dmaengine, linux-usb

On 11-12-18, 14:43, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Use Use device_iommu_mapped() to check if the device is
> already mapped by an IOMMU.

Acked-by: Vinod Koul <vkoul@kernel.org>

-- 
~Vinod

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

* Re: [PATCH 3/6] ACPI/IORT: Use device_iommu_mapped()
  2018-12-11 13:43 ` [PATCH 3/6] ACPI/IORT: " Joerg Roedel
@ 2018-12-17  9:21   ` Hanjun Guo
  0 siblings, 0 replies; 16+ messages in thread
From: Hanjun Guo @ 2018-12-17  9:21 UTC (permalink / raw)
  To: Joerg Roedel, iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, jroedel, Mathias Nyman,
	Greg Kroah-Hartman, linux-kernel, linux-acpi, dmaengine,
	linux-usb

On 2018/12/11 21:43, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Replace the iommu-check with a proper and readable function
> call.
> 
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Acked-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>

Acked-by: Hanjun Guo <hanjun.guo@linaro.org>

Thanks
Hanjun


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

* Re: [PATCH 1/6] driver core: Introduce device_iommu_mapped() function
  2018-12-17  6:11   ` Vinod Koul
@ 2018-12-17  9:31     ` Joerg Roedel
  0 siblings, 0 replies; 16+ messages in thread
From: Joerg Roedel @ 2018-12-17  9:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Joerg Roedel, iommu, Russell Currey, Sam Bobroff, oohall,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Dan Williams,
	Mathias Nyman, Greg Kroah-Hartman, linux-kernel, linux-acpi,
	dmaengine, linux-usb

On Mon, Dec 17, 2018 at 11:41:10AM +0530, Vinod Koul wrote:
> On 11-12-18, 14:43, Joerg Roedel wrote:
> > From: Joerg Roedel <jroedel@suse.de>
> > 
> > Some places in the kernel check the iommu_group pointer in
> > 'struct device' in order to find ot whether a device is
>                                    ^^
> Typo

Right, fixed now, thanks.

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

* Re: [PATCH 5/6] xhci: Use device_iommu_mapped()
  2018-12-11 13:43 ` [PATCH 5/6] xhci: " Joerg Roedel
@ 2018-12-17 11:21   ` Mathias Nyman
  0 siblings, 0 replies; 16+ messages in thread
From: Mathias Nyman @ 2018-12-17 11:21 UTC (permalink / raw)
  To: Joerg Roedel, iommu
  Cc: Russell Currey, Sam Bobroff, oohall, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Lorenzo Pieralisi, Hanjun Guo,
	Sudeep Holla, Dan Williams, Vinod Koul, jroedel, Mathias Nyman,
	Greg Kroah-Hartman, linux-kernel, linux-acpi, dmaengine,
	linux-usb

On 11.12.2018 15:43, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Replace the dev->iommu_group check with a proper function
> call that better reprensents its purpose.
> 
> Cc: Mathias Nyman <mathias.nyman@intel.com>
> Acked-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>   drivers/usb/host/xhci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index dae3be1b9c8f..8eacd2ed412b 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -244,7 +244,7 @@ static void xhci_zero_64b_regs(struct xhci_hcd *xhci)
>   	 * an iommu. Doing anything when there is no iommu is definitely
>   	 * unsafe...
>   	 */
> -	if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !dev->iommu_group)
> +	if (!(xhci->quirks & XHCI_ZERO_64B_REGS) || !device_iommu_mapped(dev))
>   		return;
>   
>   	xhci_info(xhci, "Zeroing 64bit base registers, expecting fault\n");
> 

Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>

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

end of thread, other threads:[~2018-12-17 11:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 13:43 [PATCH 0/6 v2] Introduce device_iommu_mapped() function Joerg Roedel
2018-12-11 13:43 ` [PATCH 1/6] driver core: " Joerg Roedel
2018-12-11 14:59   ` Sergei Shtylyov
2018-12-11 15:18     ` Joerg Roedel
2018-12-12 11:04   ` Greg Kroah-Hartman
2018-12-12 11:07     ` Joerg Roedel
2018-12-17  6:11   ` Vinod Koul
2018-12-17  9:31     ` Joerg Roedel
2018-12-11 13:43 ` [PATCH 2/6] iommu/of: Use device_iommu_mapped() Joerg Roedel
2018-12-11 13:43 ` [PATCH 3/6] ACPI/IORT: " Joerg Roedel
2018-12-17  9:21   ` Hanjun Guo
2018-12-11 13:43 ` [PATCH 4/6] powerpc/iommu: " Joerg Roedel
2018-12-11 13:43 ` [PATCH 5/6] xhci: " Joerg Roedel
2018-12-17 11:21   ` Mathias Nyman
2018-12-11 13:43 ` [PATCH 6/6] dmaengine: sh: rcar-dmac: " Joerg Roedel
2018-12-17  6:11   ` Vinod Koul

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