OpenCloudOS-Kernel/drivers/media/usb/usbtv
Maxim Mikityanskiy 8a7e27fd5c media: usbtv: Fix deadlock on suspend
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>
2021-03-11 11:40:28 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
usbtv-audio.c media: usbtv: Fix deadlock on suspend 2021-03-11 11:40:28 +01:00
usbtv-core.c media: usbtv: Fix refcounting mixup 2020-10-08 09:08:20 +02:00
usbtv-video.c media: media/usb: use vb2_video_unregister_device() 2020-08-28 15:02:52 +02:00
usbtv.h media: usbtv: Add SECAM support 2018-05-04 06:48:49 -04:00