Skip to contentSkip to conversation

dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver

PATCH Superseded Lukasz Majewski 2 participants 4 messages Oct 9, 2019 Device tree bindings

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dts: Disable DMA support on the BK4 vf610 device's fsl_lpuart driver

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.

---
 arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/vf610-bk4.dts +4 -0
index 0f3870d3b099..ad20f3442d40 100644
@@ -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";
 };
 
Signature · 1 line
2.20.1
#1 lore raw
Quoted 17 lines · Lukasz Majewski

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.

---
  arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
  1 file changed, 4 insertions(+)
arch/arm/boot/dts/vf610-bk4.dts +0 -0
index 0f3870d3b099..ad20f3442d40 100644

arch/arm/boot/dts/vf610-bk4.dts line 262

Quoted 4 lines
arch/arm/boot/dts/vf610-bk4.dts +1 -0
@@ -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.

Quoted 25 lines
arch/arm/boot/dts/vf610-bk4.dts +3 -0
  	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 lore raw

Hi Robin,

Quoted 14 lines · Lukasz Majewski
Quoted 13 lines

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.

---
  arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
  1 file changed, 4 insertions(+)
Quoted 12 lines

arch/arm/boot/dts/vf610-bk4.dts line 262

Quoted 9 lines
(quoted diff) +0 -0

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

arch/arm/boot/dts/vf610-bk4.dts +1 -0
@@ -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).

Quoted 20 lines

Robin.

Quoted 17 lines
arch/arm/boot/dts/vf610-bk4.dts +2 -0
  	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";
  };
 
Quoted 8 lines

arch/arm/boot/dts/vf610-bk4.dts line 286

Quoted 8 lines
arch/arm/boot/dts/vf610-bk4.dts +1 -0
  &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: [email protected]

#3 lore raw
Quoted 29 lines · Lukasz Majewski

Hi Robin,

Quoted 14 lines · Lukasz Majewski
Quoted 13 lines

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.

---
   arch/arm/boot/dts/vf610-bk4.dts | 4 ++++
   1 file changed, 4 insertions(+)
Quoted 12 lines

arch/arm/boot/dts/vf610-bk4.dts line 262

Quoted 9 lines
(quoted diff) +0 -0

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

arch/arm/boot/dts/vf610-bk4.dts +1 -0
@@ -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;"?

Quoted 2 lines

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.

Quoted 2 lines

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.

Quoted 39 lines
Quoted 17 lines
Quoted 17 lines
arch/arm/boot/dts/vf610-bk4.dts +2 -0
   	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";
   };
 
Quoted 8 lines

arch/arm/boot/dts/vf610-bk4.dts line 286

Quoted 8 lines
arch/arm/boot/dts/vf610-bk4.dts +1 -0
   &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: [email protected]