linux-stable/drivers
Erwan Le Ray 436c979360 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: 6cf61b9bd7 ("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>
2021-03-10 09:34:10 +01:00
..
accessibility tty: remove TTY_LDISC_MAGIC 2021-03-10 09:34:06 +01:00
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth tty: remove TTY_LDISC_MAGIC 2021-03-10 09:34:06 +01:00
bus
cdrom
char
clk
clocksource
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc tty: remove TTY_LDISC_MAGIC 2021-03-10 09:34:06 +01:00
mmc
most
mtd
mux
net net: caif: inline register_ldisc 2021-03-10 09:34:07 +01:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps tty: remove TTY_LDISC_MAGIC 2021-03-10 09:34:06 +01:00
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 tty: con3215, remove tty->driver_data casts 2021-03-10 09:34:07 +01:00
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging tty: make everyone's write_room return >= 0 2021-03-10 09:34:09 +01:00
target
tc
tee
thermal
thunderbolt
tty serial: stm32: fix a deadlock in set_termios 2021-03-10 09:34:10 +01:00
uio
usb tty: make everyone's write_room return >= 0 2021-03-10 09:34:09 +01:00
vdpa
vfio
vhost
video vgacon: comment on vga_rolled_over 2021-03-10 09:34:06 +01:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile