linux-stable/drivers/media/usb
Maxim Mikityanskiy c29dcb253a media: usbtv: Fix deadlock on suspend
commit 8a7e27fd5c upstream.

usbtv doesn't support power management, so on system suspend the
.disconnect callback of the driver is called. The teardown sequence
includes a call to snd_card_free. Its implementation waits until the
refcount of the sound card device drops to zero, however, if its file is
open, snd_card_file_add takes a reference, which can't be dropped during
the suspend, because the userspace processes are already frozen at this
point. snd_card_free waits for completion forever, leading to a hang on
suspend.

This commit fixes this deadlock condition by replacing snd_card_free
with snd_card_free_when_closed, that doesn't wait until all references
are released, allowing suspend to progress.

Fixes: 63ddf68de5 ("[media] usbtv: add audio support")
Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-17 17:06:20 +01:00
..
airspy media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
as102 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118 2019-05-24 17:39:02 +02:00
au0828 media: rc: harmonize infrared durations to microseconds 2020-09-03 16:18:55 +02:00
b2c2 media: flexcop-usb: remove needless check before usb_free_coherent() 2020-09-27 11:25:11 +02:00
cpia2 treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cx231xx Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
dvb-usb media: gp8psk: initialize stats at power control logic 2021-01-06 14:56:52 +01:00
dvb-usb-v2 media: lmedm04: Fix misuse of comma 2021-03-04 11:37:43 +01:00
em28xx media: em28xx: Fix use-after-free in em28xx_alloc_urbs 2021-03-04 11:37:39 +01:00
go7007 media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
gspca media: gspca: Fix memory leak in probe 2020-12-30 11:54:03 +01:00
hackrf Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
hdpvr media: usb: hdpvr: convert to use i2c_new_client_device() 2020-04-14 11:31:48 +02:00
msi2500 media: msi2500: assign SPI bus number dynamically 2020-12-26 16:02:45 +01:00
pvrusb2 media: pvrusb2: fix parsing error 2020-08-26 18:50:11 +02:00
pwc media: pwc: Use correct device for DMA 2021-02-23 15:53:25 +01:00
s2255 media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
siano media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
stk1160 media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
stkwebcam media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
tm6000 media: tm6000: Fix memleak in tm6000_start_stream 2021-03-04 11:37:40 +01:00
ttusb-budget media: dvb-ttusb-budget: cleanup printk logic 2020-09-03 11:15:47 +02:00
ttusb-dec media: ttusb-dec: convert tasklets to use new tasklet_setup() API 2020-08-29 08:14:42 +02:00
usbtv media: usbtv: Fix deadlock on suspend 2021-03-17 17:06:20 +01:00
uvc media: uvcvideo: Allow entities with no pads 2021-03-07 12:34:12 +01:00
zr364xx media: docs: move user-facing docs to the admin guide 2020-04-14 10:34:58 +02:00
Kconfig media: move CEC USB drivers to a separate directory 2020-04-15 12:06:40 +02:00
Makefile media: move CEC USB drivers to a separate directory 2020-04-15 12:06:40 +02:00