Home
last modified time | relevance | path

Searched hist:"436 c97936001776f16153771ee887f125443e974" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/tty/serial/
H A Dstm32-usart.cdiff 436c97936001776f16153771ee887f125443e974 Thu Mar 04 10:23:02 CST 2021 Erwan Le Ray <erwan.leray@foss.st.com> serial: stm32: fix a deadlock in set_termios

CTS/RTS GPIOs support that has been added recently to STM32 UART driver has
introduced scheduled code in a set_termios part protected by a spin lock.
This generates a potential deadlock scenario:

Chain exists of:
&irq_desc_lock_class --> console_owner --> &port_lock_key

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&port_lock_key);
lock(console_owner);
lock(&port_lock_key);
lock(&irq_desc_lock_class);

*** DEADLOCK ***
4 locks held by stty/766:

Move the scheduled code after the spinlock.

Fixes: 6cf61b9bd7cc ("tty: serial: Add modem control gpio support for STM32 UART")
Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Link: https://lore.kernel.org/r/20210304162308.8984-8-erwan.leray@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>