From: Greg Kroah-Hartman Date: Fri, 12 Mar 2021 14:10:04 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.4.262~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b41a6ffb2d3a2485f2fc4e5eff07a6ac9e93d5f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: media-usbtv-fix-deadlock-on-suspend.patch --- diff --git a/queue-4.9/media-usbtv-fix-deadlock-on-suspend.patch b/queue-4.9/media-usbtv-fix-deadlock-on-suspend.patch new file mode 100644 index 00000000000..00faa709295 --- /dev/null +++ b/queue-4.9/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.9/series b/queue-4.9/series index 7457cf1e58f..79522ecd50e 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -14,3 +14,4 @@ net-sched-avoid-duplicates-in-classes-dump.patch net-lapbether-remove-netif_start_queue-netif_stop_queue.patch net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch net-davicom-fix-regulator-not-turned-off-on-driver-removal.patch +media-usbtv-fix-deadlock-on-suspend.patch