]> git.itanic.dy.fi Git - linux-stable/commit
ASoC: soc-pcm: Move debugfs removal out of spinlock
authorTakashi Iwai <tiwai@suse.de>
Wed, 19 Jan 2022 15:52:49 +0000 (16:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:26 +0000 (11:50 +0200)
commit44b685c4bab3ce82388b2c885a80249fe6bc7931
tree45be3a7106ff33a70455c7ae89d901d9a6a800f5
parent0d5017dea0c6e8e90d756b62b62b8d7c489e6694
ASoC: soc-pcm: Move debugfs removal out of spinlock

commit 9f620684c1ef5a002b6622ecc7b5818e81252f48 upstream.

The recent fix for DPCM locking also covered the loop in
dpcm_be_disconnect() with the FE stream lock.  This caused an
unexpected side effect, thought: calling debugfs_remove_recursive() in
the spinlock may lead to lockdep splats as the code there assumes the
SOFTIRQ-safe context.

For avoiding the problem, this patch changes the disconnection
procedure to two phases: at first, the matching entries are removed
from the linked list, then the resources are freed outside the lock.

Fixes: b7898396f4bb ("ASoC: soc-pcm: Fix and cleanup DPCM locking")
Reported-and-tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220119155249.26754-3-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/soc-pcm.c