From: Greg Kroah-Hartman Date: Fri, 12 Mar 2021 14:10:20 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.262~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0907d310ddb3b379bbfcbb4ffc8c9a8db68b9f1;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: media-usbtv-fix-deadlock-on-suspend.patch --- diff --git a/queue-4.14/media-usbtv-fix-deadlock-on-suspend.patch b/queue-4.14/media-usbtv-fix-deadlock-on-suspend.patch new file mode 100644 index 00000000000..00faa709295 --- /dev/null +++ b/queue-4.14/media-usbtv-fix-deadlock-on-suspend.patch @@ -0,0 +1,42 @@ +From 8a7e27fd5cd696ba564a3f62cedef7269cfd0723 Mon Sep 17 00:00:00 2001 +From: Maxim Mikityanskiy +Date: Fri, 5 Feb 2021 23:51:39 +0100 +Subject: media: usbtv: Fix deadlock on suspend + +From: Maxim Mikityanskiy + +commit 8a7e27fd5cd696ba564a3f62cedef7269cfd0723 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: 63ddf68de52e ("[media] usbtv: add audio support") +Signed-off-by: Maxim Mikityanskiy +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/usbtv/usbtv-audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/media/usb/usbtv/usbtv-audio.c ++++ b/drivers/media/usb/usbtv/usbtv-audio.c +@@ -398,7 +398,7 @@ void usbtv_audio_free(struct usbtv *usbt + cancel_work_sync(&usbtv->snd_trigger); + + if (usbtv->snd && usbtv->udev) { +- snd_card_free(usbtv->snd); ++ snd_card_free_when_closed(usbtv->snd); + usbtv->snd = NULL; + } + } diff --git a/queue-4.14/series b/queue-4.14/series index 1c979326198..73ded868c23 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -27,3 +27,4 @@ s390-cio-return-efault-if-copy_to_user-fails.patch drm-compat-clear-bounce-structures.patch drm-meson_drv-add-shutdown-function.patch s390-cio-return-efault-if-copy_to_user-fails-take-2.patch +media-usbtv-fix-deadlock-on-suspend.patch