All of lore.kernel.org
 help / color / mirror / Atom feed
* various dma_mask fixups
@ 2018-08-29  6:23 ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:23 UTC (permalink / raw)
  To: iommu
  Cc: Robin Murphy, Meelis Roos, Guenter Roeck, Linus Walleij,
	sparclinux, linux-kernel

Fix warnings and regressions from requiring a dma mask.

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

* various dma_mask fixups
@ 2018-08-29  6:23 ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:23 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Meelis Roos, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	sparclinux-u79uwXL29TY76Z2rM5mHXA, Robin Murphy, Linus Walleij,
	Guenter Roeck

Fix warnings and regressions from requiring a dma mask.

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

* various dma_mask fixups
@ 2018-08-29  6:23 ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:23 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Meelis Roos, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	sparclinux-u79uwXL29TY76Z2rM5mHXA, Robin Murphy, Linus Walleij,
	Guenter Roeck

Fix warnings and regressions from requiring a dma mask.

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

* [PATCH 1/3] driver core: initialize a default DMA mask for platform device
@ 2018-08-29  6:23   ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:23 UTC (permalink / raw)
  To: iommu
  Cc: Robin Murphy, Meelis Roos, Guenter Roeck, Linus Walleij,
	sparclinux, linux-kernel

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d9dc4883d5fb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	u64		dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0


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

* [PATCH 1/3] driver core: initialize a default DMA mask for platform device
@ 2018-08-29  6:23   ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:23 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Meelis Roos, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	sparclinux-u79uwXL29TY76Z2rM5mHXA, Robin Murphy, Linus Walleij,
	Guenter Roeck

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d9dc4883d5fb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	u64		dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0

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

* [PATCH 1/3] driver core: initialize a default DMA mask for platform device
@ 2018-08-29  6:23   ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:23 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Meelis Roos, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	sparclinux-u79uwXL29TY76Z2rM5mHXA, Robin Murphy, Linus Walleij,
	Guenter Roeck

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Reported-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d9dc4883d5fb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	u64		dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0

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

* [PATCH 2/3] sparc: set a default 32-bit dma mask for OF devices
  2018-08-29  6:23 ` Christoph Hellwig
@ 2018-08-29  6:24   ` Christoph Hellwig
  -1 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:24 UTC (permalink / raw)
  To: iommu
  Cc: Robin Murphy, Meelis Roos, Guenter Roeck, Linus Walleij,
	sparclinux, linux-kernel

This keeps the historic default behavior for devices without a DMA mask,
but removes the warning about a lacking DMA mask for doing DMA without
a mask.

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/sparc/kernel/of_device_32.c | 5 +++++
 arch/sparc/kernel/of_device_64.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..7f3dec7e1e78 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -9,6 +9,7 @@
 #include <linux/irq.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/dma-mapping.h>
 #include <asm/leon.h>
 #include <asm/leon_amba.h>
 
@@ -381,6 +382,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
 
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
+
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
 		       dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..d94c31822da1 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -2,6 +2,7 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/mod_devicetable.h>
@@ -675,6 +676,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		dev_set_name(&op->dev, "root");
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
 
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
-- 
2.18.0


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

* [PATCH 2/3] sparc: set a default 32-bit dma mask for OF devices
@ 2018-08-29  6:24   ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:24 UTC (permalink / raw)
  To: iommu
  Cc: Robin Murphy, Meelis Roos, Guenter Roeck, Linus Walleij,
	sparclinux, linux-kernel

This keeps the historic default behavior for devices without a DMA mask,
but removes the warning about a lacking DMA mask for doing DMA without
a mask.

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/sparc/kernel/of_device_32.c | 5 +++++
 arch/sparc/kernel/of_device_64.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..7f3dec7e1e78 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -9,6 +9,7 @@
 #include <linux/irq.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/dma-mapping.h>
 #include <asm/leon.h>
 #include <asm/leon_amba.h>
 
@@ -381,6 +382,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
 
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
+
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
 		       dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..d94c31822da1 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -2,6 +2,7 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/mod_devicetable.h>
@@ -675,6 +676,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		dev_set_name(&op->dev, "root");
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
 
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
-- 
2.18.0

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

* [PATCH 3/3] of/platform: initialise AMBA default DMA masks
  2018-08-29  6:23 ` Christoph Hellwig
@ 2018-08-29  6:24   ` Christoph Hellwig
  -1 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:24 UTC (permalink / raw)
  To: iommu
  Cc: Robin Murphy, Meelis Roos, Guenter Roeck, Linus Walleij,
	sparclinux, linux-kernel

From: Linus Walleij <linus.walleij@linaro.org>

commit a5516219b102 ("of/platform: Initialise default DMA masks") sets up
the coherent_dma_mask of platform devices created from the device tree,
but fails to do the same for AMBA (PrimeCell) devices.

This leads to a regression in kernel v4.19-rc1 triggering the
WARN_ON_ONCE(dev && !dev->coherent_dma_mask) in dma_alloc_attrs().

This regresses the PL111 DRM driver in drivers/gpu/drm/pl111 that uses
the AMBA PrimeCell to instantiate the frame buffer device, as it cannot
allocate a chunk of coherent memory anymore due to the missing mask.

Fixes: a5516219b102 ("of/platform: Initialise default DMA masks")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[hch: added a comment, and droped a conditional that can't be true]
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/of/platform.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 7ba90c290a42..6c59673933e9 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -241,6 +241,10 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
 	if (!dev)
 		goto err_clear_flag;
 
+	/* AMBA devices only support a single DMA mask */
+	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
+
 	/* setup generic device info */
 	dev->dev.of_node = of_node_get(node);
 	dev->dev.fwnode = &node->fwnode;
-- 
2.18.0


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

* [PATCH 3/3] of/platform: initialise AMBA default DMA masks
@ 2018-08-29  6:24   ` Christoph Hellwig
  0 siblings, 0 replies; 16+ messages in thread
From: Christoph Hellwig @ 2018-08-29  6:24 UTC (permalink / raw)
  To: iommu
  Cc: Robin Murphy, Meelis Roos, Guenter Roeck, Linus Walleij,
	sparclinux, linux-kernel

From: Linus Walleij <linus.walleij@linaro.org>

commit a5516219b102 ("of/platform: Initialise default DMA masks") sets up
the coherent_dma_mask of platform devices created from the device tree,
but fails to do the same for AMBA (PrimeCell) devices.

This leads to a regression in kernel v4.19-rc1 triggering the
WARN_ON_ONCE(dev && !dev->coherent_dma_mask) in dma_alloc_attrs().

This regresses the PL111 DRM driver in drivers/gpu/drm/pl111 that uses
the AMBA PrimeCell to instantiate the frame buffer device, as it cannot
allocate a chunk of coherent memory anymore due to the missing mask.

Fixes: a5516219b102 ("of/platform: Initialise default DMA masks")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
[hch: added a comment, and droped a conditional that can't be true]
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/of/platform.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 7ba90c290a42..6c59673933e9 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -241,6 +241,10 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
 	if (!dev)
 		goto err_clear_flag;
 
+	/* AMBA devices only support a single DMA mask */
+	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
+
 	/* setup generic device info */
 	dev->dev.of_node = of_node_get(node);
 	dev->dev.fwnode = &node->fwnode;
-- 
2.18.0

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

* Re: various dma_mask fixups
  2018-08-29  6:23 ` Christoph Hellwig
@ 2018-08-29  6:59   ` Linus Walleij
  -1 siblings, 0 replies; 16+ messages in thread
From: Linus Walleij @ 2018-08-29  6:59 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Robin Murphy, mroos, Guenter Roeck, sparclinux, linux-kernel

On Wed, Aug 29, 2018 at 8:24 AM Christoph Hellwig <hch@lst.de> wrote:

> Fix warnings and regressions from requiring a dma mask.

Applied all three patches and took a few ARM systems for a test ride:
Tested-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: various dma_mask fixups
@ 2018-08-29  6:59   ` Linus Walleij
  0 siblings, 0 replies; 16+ messages in thread
From: Linus Walleij @ 2018-08-29  6:59 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Robin Murphy, mroos, Guenter Roeck, sparclinux, linux-kernel

On Wed, Aug 29, 2018 at 8:24 AM Christoph Hellwig <hch@lst.de> wrote:

> Fix warnings and regressions from requiring a dma mask.

Applied all three patches and took a few ARM systems for a test ride:
Tested-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: various dma_mask fixups
  2018-08-29  6:23 ` Christoph Hellwig
@ 2018-08-29 22:38   ` Guenter Roeck
  -1 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2018-08-29 22:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Robin Murphy, Meelis Roos, Linus Walleij, sparclinux,
	linux-kernel

On Wed, Aug 29, 2018 at 08:23:58AM +0200, Christoph Hellwig wrote:
> Fix warnings and regressions from requiring a dma mask.

With this series applied, I see the following in my sh4 boot tests.

sb 1-1: new full-speed USB device number 2 using sm501-usb
sm501-usb sm501-usb: OHCI Unrecoverable Error, disabled
sm501-usb sm501-usb: HC died; cleaning up

This is a persistent problem. Reverting upstream commit 2f606da7823
("mfd: sm501: Set coherent_dma_mask when creating subdevices") does not
make a difference.

The problem is gone if I do not apply 'driver core: initialize a default
DMA mask for platform device'.

On the plus side, the sparc warnings are gone.

Guenter

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

* Re: various dma_mask fixups
@ 2018-08-29 22:38   ` Guenter Roeck
  0 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2018-08-29 22:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Robin Murphy, Meelis Roos, Linus Walleij, sparclinux,
	linux-kernel

On Wed, Aug 29, 2018 at 08:23:58AM +0200, Christoph Hellwig wrote:
> Fix warnings and regressions from requiring a dma mask.

With this series applied, I see the following in my sh4 boot tests.

sb 1-1: new full-speed USB device number 2 using sm501-usb
sm501-usb sm501-usb: OHCI Unrecoverable Error, disabled
sm501-usb sm501-usb: HC died; cleaning up

This is a persistent problem. Reverting upstream commit 2f606da7823
("mfd: sm501: Set coherent_dma_mask when creating subdevices") does not
make a difference.

The problem is gone if I do not apply 'driver core: initialize a default
DMA mask for platform device'.

On the plus side, the sparc warnings are gone.

Guenter

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

* Re: various dma_mask fixups
  2018-08-29 22:38   ` Guenter Roeck
@ 2018-08-30 10:40     ` Guenter Roeck
  -1 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2018-08-30 10:40 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Robin Murphy, Meelis Roos, Linus Walleij, sparclinux,
	linux-kernel

On Wed, Aug 29, 2018 at 03:38:21PM -0700, Guenter Roeck wrote:
> On Wed, Aug 29, 2018 at 08:23:58AM +0200, Christoph Hellwig wrote:
> > Fix warnings and regressions from requiring a dma mask.
> 
> With this series applied, I see the following in my sh4 boot tests.
> 
> sb 1-1: new full-speed USB device number 2 using sm501-usb
> sm501-usb sm501-usb: OHCI Unrecoverable Error, disabled
> sm501-usb sm501-usb: HC died; cleaning up
> 
> This is a persistent problem. Reverting upstream commit 2f606da7823
> ("mfd: sm501: Set coherent_dma_mask when creating subdevices") does not
> make a difference.
> 
This failure is now seen in -next.

Guenter

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

* Re: various dma_mask fixups
@ 2018-08-30 10:40     ` Guenter Roeck
  0 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2018-08-30 10:40 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: iommu, Robin Murphy, Meelis Roos, Linus Walleij, sparclinux,
	linux-kernel

On Wed, Aug 29, 2018 at 03:38:21PM -0700, Guenter Roeck wrote:
> On Wed, Aug 29, 2018 at 08:23:58AM +0200, Christoph Hellwig wrote:
> > Fix warnings and regressions from requiring a dma mask.
> 
> With this series applied, I see the following in my sh4 boot tests.
> 
> sb 1-1: new full-speed USB device number 2 using sm501-usb
> sm501-usb sm501-usb: OHCI Unrecoverable Error, disabled
> sm501-usb sm501-usb: HC died; cleaning up
> 
> This is a persistent problem. Reverting upstream commit 2f606da7823
> ("mfd: sm501: Set coherent_dma_mask when creating subdevices") does not
> make a difference.
> 
This failure is now seen in -next.

Guenter

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

end of thread, other threads:[~2018-08-30 10:40 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29  6:23 various dma_mask fixups Christoph Hellwig
2018-08-29  6:23 ` Christoph Hellwig
2018-08-29  6:23 ` Christoph Hellwig
2018-08-29  6:23 ` [PATCH 1/3] driver core: initialize a default DMA mask for platform device Christoph Hellwig
2018-08-29  6:23   ` Christoph Hellwig
2018-08-29  6:23   ` Christoph Hellwig
2018-08-29  6:24 ` [PATCH 2/3] sparc: set a default 32-bit dma mask for OF devices Christoph Hellwig
2018-08-29  6:24   ` Christoph Hellwig
2018-08-29  6:24 ` [PATCH 3/3] of/platform: initialise AMBA default DMA masks Christoph Hellwig
2018-08-29  6:24   ` Christoph Hellwig
2018-08-29  6:59 ` various dma_mask fixups Linus Walleij
2018-08-29  6:59   ` Linus Walleij
2018-08-29 22:38 ` Guenter Roeck
2018-08-29 22:38   ` Guenter Roeck
2018-08-30 10:40   ` Guenter Roeck
2018-08-30 10:40     ` Guenter Roeck

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.