Commit 91ae7928 authored by Borut Seljak's avatar Borut Seljak Committed by Greg Kroah-Hartman

serial: stm32: fix a recursive locking in stm32_config_rs485

[ Upstream commit 707aeea1 ]

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

Fixes: 1bcda09d ("serial: stm32: add support for RS485 hardware control mode")
Signed-off-by: default avatarBorut Seljak <borut.seljak@t-2.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5389e1b4
...@@ -105,9 +105,7 @@ static int stm32_config_rs485(struct uart_port *port, ...@@ -105,9 +105,7 @@ static int stm32_config_rs485(struct uart_port *port,
struct stm32_usart_config *cfg = &stm32_port->info->cfg; struct stm32_usart_config *cfg = &stm32_port->info->cfg;
u32 usartdiv, baud, cr1, cr3; u32 usartdiv, baud, cr1, cr3;
bool over8; bool over8;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); stm32_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
port->rs485 = *rs485conf; port->rs485 = *rs485conf;
...@@ -147,7 +145,6 @@ static int stm32_config_rs485(struct uart_port *port, ...@@ -147,7 +145,6 @@ static int stm32_config_rs485(struct uart_port *port,
} }
stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); stm32_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));
spin_unlock_irqrestore(&port->lock, flags);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment