Skip to contentSkip to conversation

Patch "ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Aug 4, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
alsa-usb-audio-test-ep_flag_running-at-urb-completion.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Aug 4 15:30:10 PDT 2017

From: Ioan-Adrian Ratiu <[email protected]>
Date: Thu, 5 Jan 2017 00:37:47 +0200
Subject: ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion

From: Ioan-Adrian Ratiu <[email protected]>

[ Upstream commit 13a6c8328e6056932dc680e447d4c5e8ad9add17 ]

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.

---
 sound/usb/endpoint.c |    3 +++
 1 file changed, 3 insertions(+)
sound/usb/endpoint.c +3 -0
@@ -384,6 +384,9 @@ static void snd_complete_urb(struct 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 */

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/alsa-usb-audio-test-ep_flag_running-at-urb-completion.patch