]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 14:10:20 +0000 (15:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 14:10:20 +0000 (15:10 +0100)
added patches:
media-usbtv-fix-deadlock-on-suspend.patch

queue-4.14/media-usbtv-fix-deadlock-on-suspend.patch [new file with mode: 0644]
queue-4.14/series

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 (file)
index 0000000..00faa70
--- /dev/null
@@ -0,0 +1,42 @@
+From 8a7e27fd5cd696ba564a3f62cedef7269cfd0723 Mon Sep 17 00:00:00 2001
+From: Maxim Mikityanskiy <maxtram95@gmail.com>
+Date: Fri, 5 Feb 2021 23:51:39 +0100
+Subject: media: usbtv: Fix deadlock on suspend
+
+From: Maxim Mikityanskiy <maxtram95@gmail.com>
+
+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 <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>
+---
+ 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;
+       }
+ }
index 1c97932619867a4f26d5a31842165fbfc828172e..73ded868c2379266151ca4d1beddc6cc2595a36f 100644 (file)
@@ -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