stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion" has been added to the 4.9-stable tree
@ 2017-08-04 22:33 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-04 22:33 UTC (permalink / raw)
  To: adi, alexander.levin, gregkh, tiwai; +Cc: stable, stable-commits


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 <stable@vger.kernel.org> know about it.


>From foo@baz Fri Aug  4 15:30:10 PDT 2017
From: Ioan-Adrian Ratiu <adi@adirat.com>
Date: Thu, 5 Jan 2017 00:37:47 +0200
Subject: ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion

From: Ioan-Adrian Ratiu <adi@adirat.com>


[ 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.

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>
---
 sound/usb/endpoint.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -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 adi@adirat.com are

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-04 22:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-04 22:33 Patch "ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).