]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Make sure to stop endpoints before closing EPs
authorTakashi Iwai <tiwai@suse.de>
Mon, 2 Jan 2023 17:07:57 +0000 (18:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:24 +0000 (11:58 +0100)
commit249952baa44e696780aacf6fe9c0cf10651ee321
tree40341a3fc3e3ac1b906773411558cedc94d1b505
parent779f4f43522b30a422aa491e6629c60a76db34d0
ALSA: usb-audio: Make sure to stop endpoints before closing EPs

[ Upstream commit f1f620766baf1fbb01977e3d7a83d9af318cc250 ]

At the PCM hw params, we may re-configure the endpoints and it's done
by a temporary EP close followed by re-open.  A potential problem
there is that the EP might be already running internally at the PCM
prepare stage; it's seen typically in the playback stream with the
implicit feedback sync.  As this stream start isn't tracked by the
core PCM layer, we'd need to stop it explicitly, and that's the
missing piece.

This patch adds the stop_endpoints() call at snd_usb_hw_params() to
assure the stream stop before closing the EPs.

Fixes: fecaab990375 ("ALSA: usb-audio: Refactor endpoint management")
Link: https://lore.kernel.org/r/4e509aea-e563-e592-e652-ba44af6733fe@veniogames.com
Link: https://lore.kernel.org/r/20230102170759.29610-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/pcm.c