All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] i.MX GPC DMA warning fixes
@ 2019-09-06 10:33 Lucas Stach
  2019-09-06 10:34 ` [PATCH 1/2] soc: imx: gpc: set DMA mask for PD platform devices Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lucas Stach @ 2019-09-06 10:33 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam
  Cc: kernel, NXP Linux Team, linux-arm-kernel, patchwork-lst

Hi all,

those two patches get rid of an annoying boot warning on all i.MX6+
devices, as the generic OF DMA code tries to forcefully configure the
DMA capabilities for the virtual GPX power domain devices, which will
never do any DMA.

This solution isn't the most elegant, as we are making up a 0 DMA mask
to silence the warning instead of skipping the DMA configuration
completely. A previous submission of this change for just the GPC v1 [1]
was shot down for this reason. But then we haven't made any progress in
fixing this in a better way, as other systems depend on the forceful
OF DMA configuration to work correctly. So we are stuck between a rock
and a hard place here.

IMHO we should accept the slight uglyness of this solution in order to
get rid of the warning now, as it is confusing users into thinking their
kernel configuration or system setup is faulty, while everything is
perfectly in order.

Regards,
Lucas

[1] https://patchwork.kernel.org/patch/10621589/

Lucas Stach (2):
  soc: imx: gpc: set DMA mask for PD platform devices
  soc: imx: gpcv2: set DMA mask for PD platform devices

 drivers/soc/imx/gpc.c   | 1 +
 drivers/soc/imx/gpcv2.c | 1 +
 2 files changed, 2 insertions(+)

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] soc: imx: gpc: set DMA mask for PD platform devices
  2019-09-06 10:33 [PATCH 0/2] i.MX GPC DMA warning fixes Lucas Stach
@ 2019-09-06 10:34 ` Lucas Stach
  2019-09-06 10:34 ` [PATCH 2/2] soc: imx: gpcv2: " Lucas Stach
  2019-10-06  2:06 ` [PATCH 0/2] i.MX GPC DMA warning fixes Shawn Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Lucas Stach @ 2019-09-06 10:34 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam
  Cc: kernel, NXP Linux Team, linux-arm-kernel, patchwork-lst

The PD platform devices aren't DMA capable (as is correctly reflected
in with a zero mask coherent_dma_mask). As they have a of_node attached
they will go through of_dma_configure, which will warn if it finds an
uninitialized DMA mask. Let the driver core know that this isn't a
missing configuration, but a non DMA capable device by pointing the
dma_mask to the coherent_dma_mask.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/soc/imx/gpc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 34d167a8b08a..136d328690fb 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -498,6 +498,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
 
 			pd_pdev->dev.parent = &pdev->dev;
 			pd_pdev->dev.of_node = np;
+			pd_pdev->dev.dma_mask = &pd_pdev->dev.coherent_dma_mask;
 
 			ret = platform_device_add(pd_pdev);
 			if (ret) {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] soc: imx: gpcv2: set DMA mask for PD platform devices
  2019-09-06 10:33 [PATCH 0/2] i.MX GPC DMA warning fixes Lucas Stach
  2019-09-06 10:34 ` [PATCH 1/2] soc: imx: gpc: set DMA mask for PD platform devices Lucas Stach
@ 2019-09-06 10:34 ` Lucas Stach
  2019-10-06  2:06 ` [PATCH 0/2] i.MX GPC DMA warning fixes Shawn Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Lucas Stach @ 2019-09-06 10:34 UTC (permalink / raw)
  To: Shawn Guo, Fabio Estevam
  Cc: kernel, NXP Linux Team, linux-arm-kernel, patchwork-lst

The PD platform devices aren't DMA capable (as is correctly reflected
in with a zero mask coherent_dma_mask). As they have a of_node attached
they will go through of_dma_configure, which will warn if it finds an
uninitialized DMA mask. Let the driver core know that this isn't a
missing configuration, but a non DMA capable device by pointing the
dma_mask to the coherent_dma_mask.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/soc/imx/gpcv2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/imx/gpcv2.c b/drivers/soc/imx/gpcv2.c
index 31b8d002d855..7268f69a8d03 100644
--- a/drivers/soc/imx/gpcv2.c
+++ b/drivers/soc/imx/gpcv2.c
@@ -626,6 +626,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
 
 		pd_pdev->dev.parent = dev;
 		pd_pdev->dev.of_node = np;
+		pd_pdev->dev.dma_mask = &pd_pdev->dev.coherent_dma_mask;
 
 		ret = platform_device_add(pd_pdev);
 		if (ret) {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] i.MX GPC DMA warning fixes
  2019-09-06 10:33 [PATCH 0/2] i.MX GPC DMA warning fixes Lucas Stach
  2019-09-06 10:34 ` [PATCH 1/2] soc: imx: gpc: set DMA mask for PD platform devices Lucas Stach
  2019-09-06 10:34 ` [PATCH 2/2] soc: imx: gpcv2: " Lucas Stach
@ 2019-10-06  2:06 ` Shawn Guo
  2 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2019-10-06  2:06 UTC (permalink / raw)
  To: Lucas Stach
  Cc: kernel, Fabio Estevam, NXP Linux Team, linux-arm-kernel, patchwork-lst

On Fri, Sep 06, 2019 at 12:33:59PM +0200, Lucas Stach wrote:
> Hi all,
> 
> those two patches get rid of an annoying boot warning on all i.MX6+
> devices, as the generic OF DMA code tries to forcefully configure the
> DMA capabilities for the virtual GPX power domain devices, which will
> never do any DMA.
> 
> This solution isn't the most elegant, as we are making up a 0 DMA mask
> to silence the warning instead of skipping the DMA configuration
> completely. A previous submission of this change for just the GPC v1 [1]
> was shot down for this reason. But then we haven't made any progress in
> fixing this in a better way, as other systems depend on the forceful
> OF DMA configuration to work correctly. So we are stuck between a rock
> and a hard place here.
> 
> IMHO we should accept the slight uglyness of this solution in order to
> get rid of the warning now, as it is confusing users into thinking their
> kernel configuration or system setup is faulty, while everything is
> perfectly in order.
> 
> Regards,
> Lucas
> 
> [1] https://patchwork.kernel.org/patch/10621589/
> 
> Lucas Stach (2):
>   soc: imx: gpc: set DMA mask for PD platform devices
>   soc: imx: gpcv2: set DMA mask for PD platform devices

Please copy Arnd for comments.

Shawn

> 
>  drivers/soc/imx/gpc.c   | 1 +
>  drivers/soc/imx/gpcv2.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> -- 
> 2.20.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-10-06  2:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 10:33 [PATCH 0/2] i.MX GPC DMA warning fixes Lucas Stach
2019-09-06 10:34 ` [PATCH 1/2] soc: imx: gpc: set DMA mask for PD platform devices Lucas Stach
2019-09-06 10:34 ` [PATCH 2/2] soc: imx: gpcv2: " Lucas Stach
2019-10-06  2:06 ` [PATCH 0/2] i.MX GPC DMA warning fixes Shawn Guo

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.