Re: [PATCH v2] serial: stm32: optimize spin lock usage

2021-04-15 Thread Erwan LE RAY
in_trylock_irqsave(), spin_unlock_irqrestore() in process context. This doesn't make much sense as console_write can be called in any context. And where's the deadlock you claim to be fixing here? remove unused local_irq_save/restore call. Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Gerald B

[PATCH v2 1/4] dt-bindings: serial: add RX and TX FIFO properties

2021-04-13 Thread Erwan Le Ray
Add two optional DT properties to configure RX and TX FIFO thresholds: - rx-threshold - tx-threshold Signed-off-by: Erwan Le Ray diff --git a/Documentation/devicetree/bindings/serial/serial.yaml b/Documentation/devicetree/bindings/serial/serial.yaml index 65e75d040521..f368d58e8086 100644

[PATCH v2 3/4] dt-bindings: serial: 8250: update TX FIFO trigger level

2021-04-13 Thread Erwan Le Ray
Remove data type from tx-threshold trigger level as defined now as a serial generic property. Signed-off-by: Erwan Le Ray diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml index c0e292cdaa6b..ff0fa9b2a390 100644

[PATCH v2 0/4] stm32 usart add fifo threshold configuration

2021-04-13 Thread Erwan Le Ray
and factorize it in serial.yaml as proposed by Rob Herring. Erwan Le Ray (3): dt-bindings: serial: add RX and TX FIFO properties dt-bindings: serial: stm32: override FIFO threshold properties dt-bindings: serial: 8250: update TX FIFO trigger level Fabrice Gasnier (1): serial: stm32: add FIFO

[PATCH v2 2/4] dt-bindings: serial: stm32: override FIFO threshold properties

2021-04-13 Thread Erwan Le Ray
Override rx-threshold and tx-threshold properties: - extend description - provide default and expected values Signed-off-by: Fabrice Gasnier Signed-off-by: Erwan Le Ray Changes in v2: Change added properties naming and factorize it in serial.yaml as proposed by Rob Herring. diff --git

[PATCH v2 4/4] serial: stm32: add FIFO threshold configuration

2021-04-13 Thread Erwan Le Ray
Signed-off-by: Erwan Le Ray Changes in v2: Change added properties naming as proposed by Rob Herring. diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 4d277804c63e..409cfd15a933 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c

Re: [Linux-stm32] [PATCH] serial: stm32: optimize spin lock usage

2021-04-12 Thread Erwan LE RAY
Hi Dillon, Thanks for your patch. Could you please elaborate the use case in your commit message ? Best Regards, Erwan. On 4/12/21 10:54 AM, dillon min wrote: Hi Greg, On Mon, Apr 12, 2021 at 4:25 PM Greg KH wrote: On Mon, Apr 12, 2021 at 02:50:20PM +0800, dillon min wrote: Hi Greg,

[irqchip: irq/irqchip-next] irqchip/stm32: Add usart instances exti direct event support

2021-04-07 Thread irqchip-bot for Erwan Le Ray
The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: e12c455055e9abc7403ce532616c0124a9d85ee7 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/e12c455055e9abc7403ce532616c0124a9d85ee7 Author:Erwan Le Ray

[PATCH 2/2] serial: stm32: add fifo threshold configuration

2021-04-06 Thread Erwan Le Ray
-off-by: Fabrice Gasnier Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 4d277804c63e..1be5b69ee567 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -312,7 +312,7 @@ static void

[PATCH 1/2] dt-bindings: serial: stm32: add fifo threshold configuration

2021-04-06 Thread Erwan Le Ray
Add two optional DT properties, to configure RX and TX fifo threshold: - st,rx-fifo-threshold-bytes - st,tx-fifo-threshold-bytes This patch depends on patch ("dt-bindings: serial: Add rx-tx-swap to stm32-usart"). Signed-off-by: Fabrice Gasnier Signed-off-by: Erwan Le Ray

[PATCH 0/2] stm32 usart add fifo threshold configuration

2021-04-06 Thread Erwan Le Ray
This series adds the support for two optional DT properties, to configure RX and TX FIFO thresholds: - st,rx-fifo-threshold-bytes - st,tx-fifo-threshold-bytes This replaces hard-coded 8 bytes threshold. No functional change expected if unspecified (keep 8 as default). Erwan Le Ray (1): dt

[PATCH 5/5] ARM: dts: stm32: Add wakeup management on stm32mp15x UART nodes

2021-03-19 Thread Erwan Le Ray
Le Ray diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi index 4b8031782555..e242d7211059 100644 --- a/arch/arm/boot/dts/stm32mp151.dtsi +++ b/arch/arm/boot/dts/stm32mp151.dtsi @@ -452,32 +452,36 @@ usart2: serial@4000e000

[PATCH 1/5] serial: stm32: rework wakeup management

2021-03-19 Thread Erwan Le Ray
-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9db6708e3d9f..11656b6b7c0f 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1534,7 +1534,7 @@ static int __maybe_unused stm32_usart_serial_suspend(struct

[PATCH 3/5] irqchip/stm32: add usart instances exti direct event support

2021-03-19 Thread Erwan Le Ray
) is mapped to GIC 82 - exti 33 (UART8) is mapped to GIC 83 Signed-off-by: Erwan Le Ray diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index 8662d7b7b262..b9db90c4aa56 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c @@ -193,7 +193,14

[PATCH 4/5] serial: stm32: update wakeup IRQ management

2021-03-19 Thread Erwan Le Ray
-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index cc054f07bd83..cba4f4ddf164 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -924,7 +924,7 @@ static void stm32_usart_set_termios(struct uart_port *port

[PATCH 0/5] stm32 usart wakeup rework

2021-03-19 Thread Erwan Le Ray
This series reworks stm32 usart wakeup management. Alexandre Torgue (1): serial: stm32: update wakeup IRQ management Erwan Le Ray (4): serial: stm32: rework wakeup management serial: stm32: clean wakeup handling in serial_suspend irqchip/stm32: add usart instances exti direct event

[PATCH 2/5] serial: stm32: clean wakeup handling in serial_suspend

2021-03-19 Thread Erwan Le Ray
when usart is wakeup source. Signed-off-by: Alexandre Torgue Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 11656b6b7c0f..cc054f07bd83 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1536

[PATCH v2 12/13] serial: stm32: fix tx_empty condition

2021-03-04 Thread Erwan Le Ray
uld return TIOCSER_TEMT instead of TC value. Cleans the USART_CR_TC TCCF register define (transmission complete clear flag) as it is duplicate of USART_ICR_TCCF. Fixes: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/se

[PATCH v2 08/13] serial: stm32: fix tx dma completion, release channel

2021-03-04 Thread Erwan Le Ray
This patch add a proper release of dma channels when completing dma tx. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index a381ee52168a..74046ae3a412 100644 ---

[PATCH v2 13/13] serial: stm32: add support for "flush_buffer" ops

2021-03-04 Thread Erwan Le Ray
Add the support for "flush_buffer" ops in order to flush any write buffers, reset any DMA state and stop any ongoing DMA transfers when the port->state->xmit circular buffer is cleared. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/seri

[PATCH v2 05/13] serial: stm32: fix a deadlock condition with wakeup event

2021-03-04 Thread Erwan Le Ray
dd STM32 USART Driver") Signed-off-by: Erwan Le Ray Signed-off-by: Fabrice Gasnier diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 223cec70c57c..370141445780 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -214,13 +21

[PATCH v2 09/13] serial: stm32: call stm32_transmit_chars locked

2021-03-04 Thread Erwan Le Ray
stm32_transmit_chars should be called under lock also in tx DMA callback. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray Signed-off-by: Fabrice Gasnier diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 74

[PATCH v2 06/13] serial: stm32: fix wake-up flag handling

2021-03-04 Thread Erwan Le Ray
Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 370141445780..326f300dd410 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -218,9 +218,6 @@ static void stm32_usart_receive_chars(struct uart_p

[PATCH v2 11/13] serial: stm32: add FIFO flush when port is closed

2021-03-04 Thread Erwan Le Ray
, so the error isn't printed twice upon next port opening. Fixes: 64c32eab6603 ("serial: stm32: Add support of TC bit status check") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 183c76ddb165..d205fce1950a 100644 --- a/d

[PATCH v2 10/13] serial: stm32: fix FIFO flush in startup and set_termios

2021-03-04 Thread Erwan Le Ray
stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 2bdd04a47f91..183c76ddb165 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -657,7 +657,7 @@

[PATCH v2 02/13] serial: stm32: fix startup by enabling usart for reception

2021-03-04 Thread Erwan Le Ray
RX is configured, but usart is not enabled in startup function. Kernel documentation specifies that startup should enable the port for reception. Fix the startup by enabling usart for reception. Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le

[PATCH v2 03/13] serial: stm32: fix incorrect characters on console

2021-03-04 Thread Erwan Le Ray
: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index c6ca8f964c69..eae54b8cf5e2 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm

[PATCH v2 01/13] serial: stm32: fix probe and remove order for dma

2021-03-04 Thread Erwan Le Ray
erial: stm32: adding dma support") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index b3675cf25a69..3d58824ac2af 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1252,10 +1252,6 @@

[PATCH v2 07/13] serial: stm32: fix a deadlock in set_termios

2021-03-04 Thread Erwan Le Ray
Fixes: 6cf61b9bd7cc ("tty: serial: Add modem control gpio support for STM32 UART") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 326f300dd410..a381ee52168a 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/

[PATCH v2 00/13] stm32 usart various fixes

2021-03-04 Thread Erwan Le Ray
Changes in v2: Rebase on latest 5.12-rc1 requested by maintainer because of merge conflict. Erwan Le Ray (13): serial: stm32: fix probe and remove order for dma serial: stm32: fix startup by enabling usart for reception serial: stm32: fix incorrect characters on console serial: stm32: fix

[PATCH v2 04/13] serial: stm32: fix TX and RX FIFO thresholds

2021-03-04 Thread Erwan Le Ray
(where UE is set) is requested firstly for console enabling, before the startup. Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index eae54b8cf5e2..223cec70c

[PATCH 13/13] serial: stm32: add support for "flush_buffer" ops

2021-02-19 Thread Erwan Le Ray
Add the support for "flush_buffer" ops in order to flush any write buffers, reset any DMA state and stop any ongoing DMA transfers when the port->state->xmit circular buffer is cleared. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/seri

[PATCH 11/13] serial: stm32: add FIFO flush when port is closed

2021-02-19 Thread Erwan Le Ray
, so the error isn't printed twice upon next port opening. Fixes: 64c32eab6603 ("serial: stm32: Add support of TC bit status check") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 45203648172b..dcc309fd5d2f 100644 --- a/d

[PATCH 12/13] serial: stm32: fix tx_empty condition

2021-02-19 Thread Erwan Le Ray
uld return TIOCSER_TEMT instead of TC value. Cleans the USART_CR_TC TCCF register define (transmission complete clear flag) as it is duplicate of USART_ICR_TCCF. Fixes: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/se

[PATCH 10/13] serial: stm32: fix FIFO flush in startup and set_termios

2021-02-19 Thread Erwan Le Ray
stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index bdd7ca490021..45203648172b 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -657,7 +657,7 @@

[PATCH 08/13] serial: stm32: fix tx dma completion, release channel

2021-02-19 Thread Erwan Le Ray
This patch add a proper release of dma channels when completing dma tx. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 4ba164820904..7da16d468b84 100644 ---

[PATCH 01/13] serial: stm32: fix probe and remove order for dma

2021-02-19 Thread Erwan Le Ray
erial: stm32: adding dma support") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index dde6d526362d..c67029ebcac8 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1255,10 +1255,6 @@

[PATCH 07/13] serial: stm32: fix a deadlock in set_termios

2021-02-19 Thread Erwan Le Ray
Fixes: 6cf61b9bd7cc ("tty: serial: Add modem control gpio support for STM32 UART") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 14011183edfe..4ba164820904 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/

[PATCH 09/13] serial: stm32: call stm32_transmit_chars locked

2021-02-19 Thread Erwan Le Ray
stm32_transmit_chars should be called under lock also in tx DMA callback. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray Signed-off-by: Fabrice Gasnier diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 7d

[PATCH 06/13] serial: stm32: fix wake-up flag handling

2021-02-19 Thread Erwan Le Ray
Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 524c55751023..14011183edfe 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -218,9 +218,6 @@ static void stm32_usart_receive_chars(struct uart_p

[PATCH 00/13] stm32 usart various fixes

2021-02-19 Thread Erwan Le Ray
This series brings various fixes to stm32-usart driver. Erwan Le Ray (13): serial: stm32: fix probe and remove order for dma serial: stm32: fix startup by enabling usart for reception serial: stm32: fix incorrect characters on console serial: stm32: fix TX and RX FIFO thresholds serial

[PATCH 02/13] serial: stm32: fix startup by enabling usart for reception

2021-02-19 Thread Erwan Le Ray
RX is configured, but usart is not enabled in startup function. Kernel documentation specifies that startup should enable the port for reception. Fix the startup by enabling usart for reception. Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le

[PATCH 04/13] serial: stm32: fix TX and RX FIFO thresholds

2021-02-19 Thread Erwan Le Ray
(where UE is set) is requested firstly for console enabling, before the startup. Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 7710de947aa3..d409a2380

[PATCH 05/13] serial: stm32: fix a deadlock condition with wakeup event

2021-02-19 Thread Erwan Le Ray
dd STM32 USART Driver") Signed-off-by: Erwan Le Ray Signed-off-by: Fabrice Gasnier diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index d409a23806b1..524c55751023 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -214,13 +21

[PATCH 03/13] serial: stm32: fix incorrect characters on console

2021-02-19 Thread Erwan Le Ray
: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 33a479062948..7710de947aa3 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm

[PATCH 1/1] serial: stm32: improve platform_get_irq condition handling in init_port

2021-01-21 Thread Erwan Le Ray
f "ret" value introduced by a new patch. Suggested-by: Jiri Slaby Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 6a9a5ef5f5ba..dde6d526362d 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm

Re: [PATCH v2 2/8] serial: stm32: fix code cleaning warnings and checks

2021-01-12 Thread Erwan LE RAY
Hello Greg, As the V2 is already in your tty-next branch, how do want me to proceed to deliver the fix for Jiri remark ? Do you expect a V3 or a new fix ? Best Regards, Erwan. On 1/11/21 10:58 AM, Jiri Slaby wrote: On 06. 01. 21, 17:21, Erwan Le Ray wrote: --- a/drivers/tty/serial/stm32

[PATCH v2 7/8] serial: stm32: clean probe and remove port deinit

2021-01-06 Thread Erwan Le Ray
Clean probe and remove port deinit by moving clk_disable_unprepare in a new dedicated deinit_port function. Signed-off-by: Erwan Le Ray Signed-off-by: Etienne Carriere diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 0d6c7f3375f0..9d73f6976586 100644

[PATCH v2 8/8] serial: stm32: update transmission complete error message in shutdown

2021-01-06 Thread Erwan Le Ray
that the transmission is not complete, instead of providing USART_TC bit status. Update the error message and add a comment for better understanding. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9d73f6976586..6a9a5ef5f5ba 100644 --- a/drivers/tty

[PATCH v2 6/8] serial: stm32: update conflicting RTS/CTS config comment

2021-01-06 Thread Erwan Le Ray
th generic and deprecated RTS/CTS properties. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 938d2c4aeaed..0d6c7f3375f0 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1031,7 +1031,10 @@

[PATCH v2 5/8] dt-bindings: serial: stm32: update rts-gpios and cts-gpios

2021-01-06 Thread Erwan Le Ray
' or 'st,hw-flow-ctrl' (deprecated) for making use of any gpio pins for flow control instead of dedicated pins. It should be noted that both cts-gpios/rts-gpios and 'uart-has-rtscts' or 'st,hw-flow-ctrl' (deprecated) properties cannot co-exist in a design. Acked-by: Rob Herring Signed-off-by: Erwan Le

[PATCH v2 3/8] serial: stm32: add "_usart" prefix in functions name

2021-01-06 Thread Erwan Le Ray
filter. Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index a0ef86d71317..717a97759928 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -34,15 +34,15 @@ #include

[PATCH v2 4/8] serial: stm32: add author

2021-01-06 Thread Erwan Le Ray
Update email address add new author in authors list. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 717a97759928..938d2c4aeaed 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -3,7 +3,8

[PATCH v2 2/8] serial: stm32: fix code cleaning warnings and checks

2021-01-06 Thread Erwan Le Ray
don't use multiple blank lines" - checkpatch --strict "Comparison to NULL could be written ..." - visual check code ordering warning Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 6248304a001f..a0ef86d71317 100644

[PATCH 0/7] STM32 uart cleanup and improvements

2021-01-06 Thread Erwan Le Ray
This series brings various fixes, cleanups and improvements to stm32-usart driver. Changes in v2: - delete DMA cookie variables removal from V1 patch as already done by a previous patch - update commit message as DMA cookie variables removal is no more included in this patch Erwan Le Ray (8

[PATCH v2 1/8] serial: stm32: fix DMA initialization error handling

2021-01-06 Thread Erwan Le Ray
descriptor submission This patch depends on '24832ca3ee85 ("tty: serial: stm32-usart: Remove set but unused 'cookie' variables")' which unfortunately doesn't include a "Fixes" tag. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray -

[PATCH 8/8] serial: stm32: update transmission complete error message in shutdown

2020-12-18 Thread Erwan Le Ray
that the transmission is not complete, instead of providing USART_TC bit status. Update the error message and add a comment for better understanding. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9d73f6976586..6a9a5ef5f5ba 100644 --- a/drivers/tty

[PATCH 0/7] STM32 uart cleanup and improvements

2020-12-18 Thread Erwan Le Ray
This series brings various fixes, cleanups and improvements to stm32-usart driver. Erwan Le Ray (8): serial: stm32: fix -Wall W=1 compilation warnings serial: stm32: fix code cleaning warnings and checks serial: stm32: add "_usart" prefix in functions name serial: stm32: add a

[PATCH 2/8] serial: stm32: fix code cleaning warnings and checks

2020-12-18 Thread Erwan Le Ray
don't use multiple blank lines" - checkpatch --strict "Comparison to NULL could be written ..." - visual check code ordering warning Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 6248304a001f..a0ef86d71317 100644

[PATCH 6/8] serial: stm32: update conflicting RTS/CTS config comment

2020-12-18 Thread Erwan Le Ray
th generic and deprecated RTS/CTS properties. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 938d2c4aeaed..0d6c7f3375f0 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1031,7 +1031,10 @@

[PATCH 3/8] serial: stm32: add "_usart" prefix in functions name

2020-12-18 Thread Erwan Le Ray
filter. Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index a0ef86d71317..717a97759928 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -34,15 +34,15 @@ #include

[PATCH 5/8] dt-bindings: serial: stm32: update rts-gpios and cts-gpios

2020-12-18 Thread Erwan Le Ray
' or 'st,hw-flow-ctrl' (deprecated) for making use of any gpio pins for flow control instead of dedicated pins. It should be noted that both cts-gpios/rts-gpios and 'uart-has-rtscts' or 'st,hw-flow-ctrl' (deprecated) properties cannot co-exist in a design. Signed-off-by: Erwan Le Ray diff --git

[PATCH 7/8] serial: stm32: clean probe and remove port deinit

2020-12-18 Thread Erwan Le Ray
Clean probe and remove port deinit by moving clk_disable_unprepare in a new dedicated deinit_port function. Signed-off-by: Erwan Le Ray Signed-off-by: Etienne Carriere diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 0d6c7f3375f0..9d73f6976586 100644

[PATCH 4/8] serial: stm32: add author

2020-12-18 Thread Erwan Le Ray
Update email address add new author in authors list. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 717a97759928..938d2c4aeaed 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -3,7 +3,8

[PATCH 1/8] serial: stm32: fix -Wall W=1 compilation warnings

2020-12-18 Thread Erwan Le Ray
Fix compilations warning detected by -Wall W=1 compilation option: - warning: variable ‘cookie’ set but not used Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usa

Re: [PATCH 1/2] dt-bindings: serial: add generic DT binding for announcing RTS/CTS lines

2020-06-29 Thread Erwan LE RAY
On 6/27/20 4:18 PM, Greg Kroah-Hartman wrote: > On Wed, May 20, 2020 at 03:39:31PM +0200, Erwan Le Ray wrote: >> Add support of generic DT binding for annoucing RTS/CTS lines. The initial >> binding 'st,hw-flow-control' is not needed anymore since generic binding >> is a

[PATCH v2 3/5] ARM: dts: stm32: add usart3 node to stm32mp157c-ev1

2020-06-18 Thread Erwan Le Ray
Adds the usart3 node to stm32mp157c-ev1 board. usart3 pins are connected to GPIO Expansion connector. usart3 is disabled by default. Signed-off-by: Erwan Le Ray Changes in v2: - Add a comment to indicate how to wire USART3_RTS flow control to the GPIO expansion connector on ev1. diff

[PATCH v2 5/5] ARM: dts: stm32: add usart2 node to stm32mp157c-dk2

2020-06-18 Thread Erwan Le Ray
Adds the usart2 node to stm32mp157c-dk2 board. usart2 pins are connected to Bluetooth component. usart2 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157c-dk2.dts b/arch/arm/boot/dts/stm32mp157c-dk2.dts index ffbae4a8753d..045636555ddd 100644

[PATCH v2 2/5] ARM: dts: stm32: add usart3 node to stm32mp15xx-dkx boards

2020-06-18 Thread Erwan Le Ray
Adds usart3 node to stm32mp15xx-dkx and usart3 alias to stm32mp157a-dk1 and stm32mp157c-dk2 boards. usart3 pins are connected to GPIO Expansion connector. usart3 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts

[PATCH v2 0/5] STM32 add usart nodes support

2020-06-18 Thread Erwan Le Ray
Add the support of uart instances available on STM32MP157 boards: - usart3 on stm32mp157c-ev1, stm32mp157a-dk1, and stm32mp157c-dk2 - uart7 on stm32mp157a-dk1 and stm32mp157c-dk2 - usart2 on stm32mp157c-dk2 Erwan Le Ray (5): ARM: dts: stm32: add usart2, usart3 and uart7 pins in stm32mp15

[PATCH v2 4/5] ARM: dts: stm32: add uart7 support to stm32mp15xx-dkx boards

2020-06-18 Thread Erwan Le Ray
Adds uart7 node to stm32mp15xx-dkx and uart7 alias to stm32mp157a-dk1 and stm32mp157c-dk2 boards. uart7 pins are connected to Arduino connector. uart7 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts/stm32mp157a-dk1.dts

[PATCH v2 1/5] ARM: dts: stm32: add usart2, usart3 and uart7 pins in stm32mp15-pinctrl

2020-06-18 Thread Erwan Le Ray
expansion connector on dkx board. - uart7_pins_c pins are connected to Arduino Uno connector on dkx board. Signed-off-by: Erwan Le Ray Changes in v2: - Update UART7 pins comments. Comments indicated "USART" instead of "UART". diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.d

[PATCH 1/5] ARM: dts: stm32: add usart2, usart3 and uart7 pins in stm32mp15-pinctrl

2020-05-28 Thread Erwan Le Ray
expansion connector on dkx board. - uart7_pins_c pins are connected to Arduino Uno connector on dkx board. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi index fb98a66977fe..99e399e4e4c3 100644 --- a/arch/arm/boot/dts

[PATCH 1/2] ARM: dts: stm32: fix uart nodes ordering in stm32mp15-pinctrl

2020-05-28 Thread Erwan Le Ray
Fix usart and uart nodes ordering. Several usart nodes didn't respect expecting ordering. Fixes: 077e0638fc83 ("ARM: dts: stm32: Add alternate pinmux for USART2 pins on stm32mp15") Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts

[PATCH 3/5] ARM: dts: stm32: add usart3 node to stm32mp157c-ev1

2020-05-28 Thread Erwan Le Ray
Adds the usart3 node to stm32mp157c-ev1 board. usart3 pins are connected to GPIO Expansion connector. usart3 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts index b19056557ef0..e56dde8d20f8 100644

[PATCH 4/5] ARM: dts: stm32: add uart7 support to stm32mp15xx-dkx boards

2020-05-28 Thread Erwan Le Ray
Adds uart7 node to stm32mp15xx-dkx and uart7 alias to stm32mp157a-dk1 and stm32mp157c-dk2 boards. uart7 pins are connected to Arduino connector. uart7 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts/stm32mp157a-dk1.dts

[PATCH 2/5] ARM: dts: stm32: add usart3 node to stm32mp15xx-dkx boards

2020-05-28 Thread Erwan Le Ray
Adds usart3 node to stm32mp15xx-dkx and usart3 alias to stm32mp157a-dk1 and stm32mp157c-dk2 boards. usart3 pins are connected to GPIO Expansion connector. usart3 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157a-dk1.dts b/arch/arm/boot/dts

[PATCH 5/5] ARM: dts: stm32: add usart2 node to stm32mp157c-dk2

2020-05-28 Thread Erwan Le Ray
Adds the usart2 node to stm32mp157c-dk2 board. usart2 pins are connected to Bluetooth component. usart2 is disabled by default. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157c-dk2.dts b/arch/arm/boot/dts/stm32mp157c-dk2.dts index ffbae4a8753d..045636555ddd 100644

[PATCH 2/2] ARM: dts: stm32: fix uart7_pins_a comments in stm32mp15-pinctrl

2020-05-28 Thread Erwan Le Ray
Fix uart7_pins_a comments to indicate UART7 pins instead of UART4 pins. Fixes: bf4b5f379fed ("ARM: dts: stm32: Add missing pinctrl definitions for STM32MP157") Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp15-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp15-pinctrl.

[PATCH 0/5] STM32 add usart nodes support

2020-05-28 Thread Erwan Le Ray
Add the support of uart instances available on STM32MP157 boards: - usart3 on stm32mp157c-ev1, stm32mp157a-dk1, and stm32mp157c-dk2 - uart7 on stm32mp157a-dk1 and stm32mp157c-dk2 - usart2 on stm32mp157c-dk2 The aliases are following this order. Erwan Le Ray (5): ARM: dts: stm32: add usart2

[PATCH 0/2] STM32 Fix uart nodes in stm32mp15-pinctrl

2020-05-28 Thread Erwan Le Ray
Fix uart nodes ordering and uart7_pins_a comments in stm32mp15-pinctrl. Erwan Le Ray (2): ARM: dts: stm32: fix uart nodes ordering in stm32mp15-pinctrl ARM: dts: stm32: fix uart7_pins_a comments in stm32mp15-pinctrl arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 130 +++ 1

[PATCH 1/3] ARM: dts: stm32: update uart4 pin configuration for low power on stm32mp157

2020-05-28 Thread Erwan Le Ray
Sleep pin configuration is refined for low power modes: - "sleep" (no wakeup & console suspend enabled): put pins in analog state to optimize power - "idle" (wakeup capability): keep Rx pin in alternate function Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray di

[PATCH 3/3] ARM: dts: stm32: Update UART4 pin states on stm32mp15xx-dkx

2020-05-28 Thread Erwan Le Ray
Add sleep and idle states to uart4 pin configuration. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi b/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi index 70db923a45f7..e5fdbc149bf4 100644 --- a/arch/arm/boot/dts/stm32mp15xx-dkx.dtsi +++ b/arch/arm/boot/dts

[PATCH 2/3] ARM: dts: stm32: Update pin states for uart4 on stm32mp157c-ed1

2020-05-28 Thread Erwan Le Ray
Add sleep and idle states to uart4 pin configuration. Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts index 32ccd50b4144..ca109dc18238 100644 --- a/arch/arm/boot/dts/stm32mp157c-ed1.dts +++ b/arch/arm/boot/dts/stm32mp157c

[PATCH 0/3] STM32 update uart4 pin configuration for low power

2020-05-28 Thread Erwan Le Ray
Update uart4 pin configuration for low power in pinctrl, and for ed/ev and dkx boards. Erwan Le Ray (3): ARM: dts: stm32: update uart4 pin configuration for low power on stm32mp157 ARM: dts: stm32: Update pin states for uart4 on stm32mp157c-ed1 ARM: dts: stm32: Update UART4 pin states

[PATCH 1/2] dt-bindings: serial: add generic DT binding for announcing RTS/CTS lines

2020-05-20 Thread Erwan Le Ray
Add support of generic DT binding for annoucing RTS/CTS lines. The initial binding 'st,hw-flow-control' is not needed anymore since generic binding is available, but is kept for backward compatibility. Signed-off-by: Erwan Le Ray diff --git a/Documentation/devicetree/bindings/serial/st,stm32

[PATCH 0/2] add generic DT binding for RTS/CTS

2020-05-20 Thread Erwan Le Ray
Add support of generic DT binding for annoucing RTS/CTS lines. The initial binding 'st,hw-flow-control' is not needed anymore since generic binding is available, but is kept for backward compatibility. Erwan Le Ray (2): dt-bindings: serial: add generic DT binding for announcing RTS/CTS

[PATCH 2/2] serial: stm32: Use generic DT binding for announcing RTS/CTS lines

2020-05-20 Thread Erwan Le Ray
Add support of generic DT binding for annoucing RTS/CTS lines. The initial binding 'st,hw-flow-control' is not needed anymore since generic binding is available, but is kept for backward compatibility. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty

[PATCH 1/1] serial: stm32: add no_console_suspend support

2020-05-19 Thread Erwan Le Ray
ate has been removed to fit with Rob comment [1], this patch has no more dependancy with any other patch of this series. [1] https://lkml.org/lkml/2019/7/9/451 Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9cfcf355567a.

Re: [Linux-stm32] [PATCH v3 1/2] dt-bindings: serial: Document CTS/RTS gpios in STM32 UART

2020-05-18 Thread Erwan LE RAY
Hi Geert, On 5/18/20 9:04 AM, Geert Uytterhoeven wrote: > Hi Mani, > > On Mon, Apr 20, 2020 at 7:02 PM wrote: >> From: Manivannan Sadhasivam >> >> Document the use of CTS/RTS gpios for flow control in STM32 UART >> controller. These properties can be used instead of 'st,hw-flow-ctrl' >> for

[PATCH] ARM: dts: stm32: fix -Wall W=1 compilation warnings for can1_sleep pinctrl

2019-07-01 Thread Erwan Le Ray
Fix compilations warnings detected by -Wall W=1 compilation option: - node has a unit name, but no reg property Signed-off-by: Erwan Le Ray diff --git a/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi b/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi index 140a983..ce98fd8 100644 --- a/arch/arm/boot/dts

[PATCH 1/5] serial: stm32: add support of timeout interrupt for RX

2019-06-18 Thread Erwan Le Ray
-off-by: Gerald Baeza Signed-off-by: Fabrice Gasnier Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9c2b04e..e1cfb1e 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -437,6 +437,10

[PATCH 0/5] STM32 usart FIFO handling

2019-06-18 Thread Erwan Le Ray
This series delivers RX and TX FIFO features to improve system performances during data transfer. Erwan Le Ray (5): serial: stm32: add support of timeout interrupt for RX serial: stm32: update PIO transmission serial: stm32: add support of TX FIFO threshold serial: stm32: add support

[PATCH 3/5] serial: stm32: add support of TX FIFO threshold

2019-06-18 Thread Erwan Le Ray
be reduced by up to 1/TXCFG, e.g. 1 over 8 with current TXCFG setting. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 8316e19..397d86d 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -298,6

[PATCH 2/5] serial: stm32: update PIO transmission

2019-06-18 Thread Erwan Le Ray
is not empty), and inhibited when there is no more data to send (ie when uart_circ is empty). Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index e1cfb1e..8316e19 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial

[PATCH 4/5] serial: stm32: add support of RX FIFO threshold

2019-06-18 Thread Erwan Le Ray
data for a 16 data depth FIFO) - irq rate may be reduced by up to 1/RXCFG, e.g. 1 over 8 with current RXCFG setting. - Receiver timeout is used to gather chars when FIFO threshold isn't reached. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial

[PATCH 5/5] serial: stm32: add RX and TX FIFO flush

2019-06-18 Thread Erwan Le Ray
TX and RX in set_termios function Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 4083145..21dc380 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -602,11 +602,11 @@ static int stm32_startup

[PATCH v3 05/10] serial: stm32: Use __maybe_unused instead of #if CONFIG_PM_SLEEP

2019-06-13 Thread Erwan Le Ray
Use __maybe_unused for power management related functionsinstead of fixes: 270e5a74fe4c ("serial: stm32: add wakeup mechanism") Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 41898c4..b0fb420 100644 --- a/drivers/

[PATCH v3 06/10] serial: stm32: add support for no_console_suspend

2019-06-13 Thread Erwan Le Ray
In order to display console messages in low power mode, console pins must be kept active after suspend call. Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray Conflicts: drivers/tty/serial/stm32-usart.c diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32

[PATCH v3 00/10] STM32 usart power improvements

2019-06-13 Thread Erwan Le Ray
add optional pinctrl states ARM: dts: stm32: Update pin states for uart4 on stm32mp157c-ed1 ARM: dts: stm32: Update UART4 pin states on stm32mp157a-dk1 Erwan Le Ray (7): dt-bindings: serial: stm32: add wakeup option serial: stm32: select pinctrl state in each suspend/resume function serial: s

  1   2   >