]> git.baikalelectronics.ru Git - kernel.git/commit
media: cx231xx: Use snd_card_free_when_closed() instead of snd_card_free().
authorZebediah Figura <zfigura@codeweavers.com>
Tue, 10 Nov 2020 03:04:03 +0000 (04:04 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 17 Nov 2020 06:12:45 +0000 (07:12 +0100)
commitb31499b089d6cd2bad789e5f045e060ae55c86d4
tree9cb116e2bd10e41267e8f82176c659c572fe34c0
parent1a66dae2017bf7f53a3c6a0054391bad742b0a99
media: cx231xx: Use snd_card_free_when_closed() instead of snd_card_free().

cx231xx_close_extension and hence cx231xx_audio_fini() are called with the
cx231xx device lock held, but snd_cx231xx_pcm_close() also grabs that mutex
when closing the file on behalf of arecord. There seems to be no reason to
wait for sound card resources to be released, so let the release be
asynchronous.

Tested with a Hauppauge 955Q (2040:b123) and Linux 5.9.6; the hang
described in the bug no longer occurs and disconnecting the device
correctly terminates arecord with ENODEV.

Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=204087
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/cx231xx/cx231xx-audio.c