lkml.org 
[lkml]   [2013]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 028/106] ALSA: ua101: Fix unlocked snd_pcm_stop() call
    Date
    3.5.7.18 -stable review patch.  If anyone has any objections, please let me know.

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

    From: Takashi Iwai <tiwai@suse.de>

    commit 9538aa46c2427d6782aa10036c4da4c541605e0e upstream.

    snd_pcm_stop() must be called in the PCM substream lock context.

    Acked-by: Clemens Ladisch <clemens@ladisch.de>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    sound/usb/misc/ua101.c | 14 ++++++++++++--
    1 file changed, 12 insertions(+), 2 deletions(-)

    diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
    index 8b81cb5..d97d35d 100644
    --- a/sound/usb/misc/ua101.c
    +++ b/sound/usb/misc/ua101.c
    @@ -613,14 +613,24 @@ static int start_usb_playback(struct ua101 *ua)

    static void abort_alsa_capture(struct ua101 *ua)
    {
    - if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states))
    + unsigned long flags;
    +
    + if (test_bit(ALSA_CAPTURE_RUNNING, &ua->states)) {
    + snd_pcm_stream_lock_irqsave(ua->capture.substream, flags);
    snd_pcm_stop(ua->capture.substream, SNDRV_PCM_STATE_XRUN);
    + snd_pcm_stream_unlock_irqrestore(ua->capture.substream, flags);
    + }
    }

    static void abort_alsa_playback(struct ua101 *ua)
    {
    - if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states))
    + unsigned long flags;
    +
    + if (test_bit(ALSA_PLAYBACK_RUNNING, &ua->states)) {
    + snd_pcm_stream_lock_irqsave(ua->playback.substream, flags);
    snd_pcm_stop(ua->playback.substream, SNDRV_PCM_STATE_XRUN);
    + snd_pcm_stream_unlock_irqrestore(ua->playback.substream, flags);
    + }
    }

    static int set_stream_hw(struct ua101 *ua, struct snd_pcm_substream *substream,
    --
    1.8.3.2


    \
     
     \ /
      Last update: 2013-07-30 12:21    [W:3.815 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site