Skip to content

Commit

Permalink
serial: stm32: fix a recursive locking in stm32_config_rs485
Browse files Browse the repository at this point in the history
Remove spin_lock_irqsave in stm32_config_rs485, it cause recursive locking.
Already locked in uart_set_rs485_config.

Fixes: 1bcda09 ("serial: stm32: add support for RS485 hardware control mode")
Signed-off-by: Borut Seljak <borut.seljak@t-2.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Borut Seljak authored and Greg Kroah-Hartman committed Jun 10, 2019
1 parent 87bb008 commit 707aeea
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/tty/serial/stm32-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 707aeea

Please sign in to comment.