linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver
@ 2019-10-09 14:30 Lukasz Majewski
  2019-10-09 14:40 ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Majewski @ 2019-10-09 14:30 UTC (permalink / raw)
  To: linux-kernel, Shawn Guo
  Cc: Mark Rutland, devicetree, Sascha Hauer, Lukasz Majewski,
	Stefan Agner, Rob Herring, Pengutronix Kernel Team,
	linux-arm-kernel

This change disables the DMA support (RX/TX) on the NXP's fsl_lpuart
driver - the PIO mode is used instead. This change is necessary for better
robustness of BK4's device use cases with many potentially interrupted
short serial transfers.

Without it the driver hangs when some distortion happens on UART lines.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/vf610-bk4.dts b/arch/arm/boot/dts/vf610-bk4.dts
index 0f3870d3b099..ad20f3442d40 100644
--- a/arch/arm/boot/dts/vf610-bk4.dts
+++ b/arch/arm/boot/dts/vf610-bk4.dts
@@ -259,24 +259,28 @@
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart0>;
+	dma-names = "","";
 	status = "okay";
 };
 
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
+	dma-names = "","";
 	status = "okay";
 };
 
 &uart2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart2>;
+	dma-names = "","";
 	status = "okay";
 };
 
 &uart3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart3>;
+	dma-names = "","";
 	status = "okay";
 };
 
-- 
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] dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver
  2019-10-09 14:30 [PATCH] dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver Lukasz Majewski
@ 2019-10-09 14:40 ` Robin Murphy
  2019-10-09 14:44   ` Lukasz Majewski
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2019-10-09 14:40 UTC (permalink / raw)
  To: Lukasz Majewski, linux-kernel, Shawn Guo
  Cc: Mark Rutland, devicetree, Sascha Hauer, Stefan Agner,
	Rob Herring, Pengutronix Kernel Team, linux-arm-kernel

On 09/10/2019 15:30, Lukasz Majewski wrote:
> This change disables the DMA support (RX/TX) on the NXP's fsl_lpuart
> driver - the PIO mode is used instead. This change is necessary for better
> robustness of BK4's device use cases with many potentially interrupted
> short serial transfers.
> 
> Without it the driver hangs when some distortion happens on UART lines.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
>   arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/vf610-bk4.dts b/arch/arm/boot/dts/vf610-bk4.dts
> index 0f3870d3b099..ad20f3442d40 100644
> --- a/arch/arm/boot/dts/vf610-bk4.dts
> +++ b/arch/arm/boot/dts/vf610-bk4.dts
> @@ -259,24 +259,28 @@
>   &uart0 {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&pinctrl_uart0>;
> +	dma-names = "","";

This looks like a horrible hack - is there any reason not to just strip 
things at compile-time, i.e. "/delete-property/ dmas;"?

Robin.

>   	status = "okay";
>   };
>   
>   &uart1 {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&pinctrl_uart1>;
> +	dma-names = "","";
>   	status = "okay";
>   };
>   
>   &uart2 {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&pinctrl_uart2>;
> +	dma-names = "","";
>   	status = "okay";
>   };
>   
>   &uart3 {
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&pinctrl_uart3>;
> +	dma-names = "","";
>   	status = "okay";
>   };
>   
> 

_______________________________________________
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

* Re: [PATCH] dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver
  2019-10-09 14:40 ` Robin Murphy
@ 2019-10-09 14:44   ` Lukasz Majewski
  2019-10-09 15:15     ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Lukasz Majewski @ 2019-10-09 14:44 UTC (permalink / raw)
  To: Robin Murphy
  Cc: Mark Rutland, devicetree, Sascha Hauer, linux-kernel,
	Stefan Agner, Rob Herring, Pengutronix Kernel Team, Shawn Guo,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2106 bytes --]

Hi Robin,

> On 09/10/2019 15:30, Lukasz Majewski wrote:
> > This change disables the DMA support (RX/TX) on the NXP's fsl_lpuart
> > driver - the PIO mode is used instead. This change is necessary for
> > better robustness of BK4's device use cases with many potentially
> > interrupted short serial transfers.
> > 
> > Without it the driver hangs when some distortion happens on UART
> > lines.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >   arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/vf610-bk4.dts
> > b/arch/arm/boot/dts/vf610-bk4.dts index 0f3870d3b099..ad20f3442d40
> > 100644 --- a/arch/arm/boot/dts/vf610-bk4.dts
> > +++ b/arch/arm/boot/dts/vf610-bk4.dts
> > @@ -259,24 +259,28 @@
> >   &uart0 {
> >   	pinctrl-names = "default";
> >   	pinctrl-0 = <&pinctrl_uart0>;
> > +	dma-names = "","";  
> 
> This looks like a horrible hack - is there any reason not to just
> strip things at compile-time, i.e. "/delete-property/ dmas;"?

I don't want to strip the dma-names property globally. I just want to
adjust this particular driver mode from DMA to PIO.

For my use cases - as written in the commit message - the PIO mode is
more suitable (and reliable). 

> 
> Robin.
> 
> >   	status = "okay";
> >   };
> >   
> >   &uart1 {
> >   	pinctrl-names = "default";
> >   	pinctrl-0 = <&pinctrl_uart1>;
> > +	dma-names = "","";
> >   	status = "okay";
> >   };
> >   
> >   &uart2 {
> >   	pinctrl-names = "default";
> >   	pinctrl-0 = <&pinctrl_uart2>;
> > +	dma-names = "","";
> >   	status = "okay";
> >   };
> >   
> >   &uart3 {
> >   	pinctrl-names = "default";
> >   	pinctrl-0 = <&pinctrl_uart3>;
> > +	dma-names = "","";
> >   	status = "okay";
> >   };
> >   
> >   




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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

* Re: [PATCH] dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver
  2019-10-09 14:44   ` Lukasz Majewski
@ 2019-10-09 15:15     ` Robin Murphy
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Murphy @ 2019-10-09 15:15 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Mark Rutland, devicetree, Sascha Hauer, linux-kernel,
	Stefan Agner, Rob Herring, Pengutronix Kernel Team, Shawn Guo,
	linux-arm-kernel

On 09/10/2019 15:44, Lukasz Majewski wrote:
> Hi Robin,
> 
>> On 09/10/2019 15:30, Lukasz Majewski wrote:
>>> This change disables the DMA support (RX/TX) on the NXP's fsl_lpuart
>>> driver - the PIO mode is used instead. This change is necessary for
>>> better robustness of BK4's device use cases with many potentially
>>> interrupted short serial transfers.
>>>
>>> Without it the driver hangs when some distortion happens on UART
>>> lines.
>>>
>>> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>>> ---
>>>    arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/vf610-bk4.dts
>>> b/arch/arm/boot/dts/vf610-bk4.dts index 0f3870d3b099..ad20f3442d40
>>> 100644 --- a/arch/arm/boot/dts/vf610-bk4.dts
>>> +++ b/arch/arm/boot/dts/vf610-bk4.dts
>>> @@ -259,24 +259,28 @@
>>>    &uart0 {
>>>    	pinctrl-names = "default";
>>>    	pinctrl-0 = <&pinctrl_uart0>;
>>> +	dma-names = "","";
>>
>> This looks like a horrible hack - is there any reason not to just
>> strip things at compile-time, i.e. "/delete-property/ dmas;"?
> 
> I don't want to strip the dma-names property globally. I just want to
> adjust this particular driver mode from DMA to PIO.

What do you mean by "globally"? The /delete-property/ operator just 
removes a previously-defined property from the node in which it appears.
> For my use cases - as written in the commit message - the PIO mode is
> more suitable (and reliable).

Right, and having invalid "dma-names" properties for this board is what 
happens to trick Linux into not using DMA mode via 
of_dma_request_slave_channel() failing, yes? What I'm saying is that if 
the underlying justification is that it's not worth using DMA mode at 
all on this board, then suppressing the actual "dmas" property it its 
DTS such that there's no dependency on a particular driver behaviour is 
a lot more robust.

Robin.

>>>    	status = "okay";
>>>    };
>>>    
>>>    &uart1 {
>>>    	pinctrl-names = "default";
>>>    	pinctrl-0 = <&pinctrl_uart1>;
>>> +	dma-names = "","";
>>>    	status = "okay";
>>>    };
>>>    
>>>    &uart2 {
>>>    	pinctrl-names = "default";
>>>    	pinctrl-0 = <&pinctrl_uart2>;
>>> +	dma-names = "","";
>>>    	status = "okay";
>>>    };
>>>    
>>>    &uart3 {
>>>    	pinctrl-names = "default";
>>>    	pinctrl-0 = <&pinctrl_uart3>;
>>> +	dma-names = "","";
>>>    	status = "okay";
>>>    };
>>>    
>>>    
> 
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
> 

_______________________________________________
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-09 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 14:30 [PATCH] dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver Lukasz Majewski
2019-10-09 14:40 ` Robin Murphy
2019-10-09 14:44   ` Lukasz Majewski
2019-10-09 15:15     ` Robin Murphy

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