linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] serial: stm32: fix a recursive locking in stm32_config_rs485
@ 2019-06-06 10:19 Borut Seljak
  2019-06-06 15:48 ` Erwan LE RAY
  0 siblings, 1 reply; 3+ messages in thread
From: Borut Seljak @ 2019-06-06 10:19 UTC (permalink / raw)
  To: erwan.leray
  Cc: Maxime Coquelin, Alexandre Torgue, Greg Kroah-Hartman,
	linux-kernel, borut.seljak, linux-serial, Jiri Slaby,
	linux-stm32, linux-arm-kernel

Remove spin_lock_irqsave in stm32_config_rs485, it cause recursive locking.
Already locked in uart_set_rs485_config.

fixes: 1bcda09d291081 ("serial: stm32: add support for RS485 hardware control mode")

Signed-off-by: Borut Seljak <borut.seljak@t-2.net>
---
 drivers/tty/serial/stm32-usart.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index e8d7a7bb4339..5d072ec61071 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -105,9 +105,7 @@ static int stm32_config_rs485(struct uart_port *port,
 	struct stm32_usart_config *cfg = &stm32_port->info->cfg;
 	u32 usartdiv, baud, cr1, cr3;
 	bool over8;
-	unsigned long flags;
 
-	spin_lock_irqsave(&port->lock, flags);
 	stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
 
 	port->rs485 = *rs485conf;
@@ -147,7 +145,6 @@ static int stm32_config_rs485(struct uart_port *port,
 	}
 
 	stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
-	spin_unlock_irqrestore(&port->lock, flags);
 
 	return 0;
 }
-- 
2.17.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] 3+ messages in thread

* Re: [PATCH v3] serial: stm32: fix a recursive locking in stm32_config_rs485
  2019-06-06 10:19 [PATCH v3] serial: stm32: fix a recursive locking in stm32_config_rs485 Borut Seljak
@ 2019-06-06 15:48 ` Erwan LE RAY
  2019-06-07 10:53   ` [PATCH v4] " Borut Seljak
  0 siblings, 1 reply; 3+ messages in thread
From: Erwan LE RAY @ 2019-06-06 15:48 UTC (permalink / raw)
  To: Borut Seljak
  Cc: Maxime Coquelin, Alexandre TORGUE, Greg Kroah-Hartman,
	linux-kernel, linux-serial, Jiri Slaby, linux-stm32,
	linux-arm-kernel


On 6/6/19 12:19 PM, Borut Seljak wrote:
> Remove spin_lock_irqsave in stm32_config_rs485, it cause recursive locking.
> Already locked in uart_set_rs485_config.
>
> fixes: 1bcda09d291081 ("serial: stm32: add support for RS485 hardware control mode")
>
> Signed-off-by: Borut Seljak <borut.seljak@t-2.net>

Hi Borut,

Thanks for your patch.

Acked-by: Erwan Le Ray <erwan.leray@st.com>

Please correct a typo in commit message: "Fixes" instead "fixes"

Erwan.

> ---
>   drivers/tty/serial/stm32-usart.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
> index e8d7a7bb4339..5d072ec61071 100644
> --- a/drivers/tty/serial/stm32-usart.c
> +++ b/drivers/tty/serial/stm32-usart.c
> @@ -105,9 +105,7 @@ static int stm32_config_rs485(struct uart_port *port,
>   	struct stm32_usart_config *cfg = &stm32_port->info->cfg;
>   	u32 usartdiv, baud, cr1, cr3;
>   	bool over8;
> -	unsigned long flags;
>   
> -	spin_lock_irqsave(&port->lock, flags);
>   	stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
>   
>   	port->rs485 = *rs485conf;
> @@ -147,7 +145,6 @@ static int stm32_config_rs485(struct uart_port *port,
>   	}
>   
>   	stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
> -	spin_unlock_irqrestore(&port->lock, flags);
>   
>   	return 0;
>   }
_______________________________________________
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] 3+ messages in thread

* [PATCH v4] serial: stm32: fix a recursive locking in stm32_config_rs485
  2019-06-06 15:48 ` Erwan LE RAY
@ 2019-06-07 10:53   ` Borut Seljak
  0 siblings, 0 replies; 3+ messages in thread
From: Borut Seljak @ 2019-06-07 10:53 UTC (permalink / raw)
  To: erwan.leray
  Cc: Maxime Coquelin, Alexandre Torgue, Greg Kroah-Hartman,
	linux-kernel, borut.seljak, linux-serial, Jiri Slaby,
	linux-stm32, linux-arm-kernel

Remove spin_lock_irqsave in stm32_config_rs485, it cause recursive locking.
Already locked in uart_set_rs485_config.

Fixes: 1bcda09d291081 ("serial: stm32: add support for RS485 hardware control mode")

Signed-off-by: Borut Seljak <borut.seljak@t-2.net>
---
 drivers/tty/serial/stm32-usart.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index e8d7a7bb4339..5d072ec61071 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -105,9 +105,7 @@ static int stm32_config_rs485(struct uart_port *port,
 	struct stm32_usart_config *cfg = &stm32_port->info->cfg;
 	u32 usartdiv, baud, cr1, cr3;
 	bool over8;
-	unsigned long flags;
 
-	spin_lock_irqsave(&port->lock, flags);
 	stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
 
 	port->rs485 = *rs485conf;
@@ -147,7 +145,6 @@ static int stm32_config_rs485(struct uart_port *port,
 	}
 
 	stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
-	spin_unlock_irqrestore(&port->lock, flags);
 
 	return 0;
 }
-- 
2.17.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] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 10:19 [PATCH v3] serial: stm32: fix a recursive locking in stm32_config_rs485 Borut Seljak
2019-06-06 15:48 ` Erwan LE RAY
2019-06-07 10:53   ` [PATCH v4] " Borut Seljak

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