lkml.org 
[lkml]   [2017]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 86/91] ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    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 */

    \
     
     \ /
      Last update: 2017-08-05 01:45    [W:3.571 / U:0.200 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site