mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-10 15:08:06 +09:00
ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion
[ Upstream commit 13a6c8328e ]
Testing EP_FLAG_RUNNING in snd_complete_urb() before running the completion
logic allows us to save a few cpu cycles by returning early, skipping the
pending urb in case the stream was stopped; the stop logic handles the urb
and sets the completion callbacks to NULL.
Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8ced91a2e9
commit
cab7c045f5
@@ -384,6 +384,9 @@ static void snd_complete_urb(struct urb *urb)
|
||||
if (unlikely(atomic_read(&ep->chip->shutdown)))
|
||||
goto exit_clear;
|
||||
|
||||
if (unlikely(!test_bit(EP_FLAG_RUNNING, &ep->flags)))
|
||||
goto exit_clear;
|
||||
|
||||
if (usb_pipeout(ep->pipe)) {
|
||||
retire_outbound_urb(ep, ctx);
|
||||
/* can be stopped during retire callback */
|
||||
|
||||
Reference in New Issue
Block a user