Patch "ALSA: usb-audio: Add spinlock to stop_urbs()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

    ALSA: usb-audio: Add spinlock to stop_urbs()

to the 5.15-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-add-spinlock-to-stop_urbs.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 0ef74366bc150dda4f53c546dfa6e8f7c707e087 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@xxxxxxx>
Date: Wed, 29 Sep 2021 10:08:42 +0200
Subject: ALSA: usb-audio: Add spinlock to stop_urbs()

From: Takashi Iwai <tiwai@xxxxxxx>

commit 0ef74366bc150dda4f53c546dfa6e8f7c707e087 upstream.

In theory, stop_urbs() may be called concurrently.
Although we have the state check beforehand, it's safer to apply
ep->lock during the critical list head manipulations.

Link: https://lore.kernel.org/r/20210929080844.11583-8-tiwai@xxxxxxx
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 sound/usb/endpoint.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -927,6 +927,7 @@ void snd_usb_endpoint_sync_pending_stop(
 static int stop_urbs(struct snd_usb_endpoint *ep, bool force)
 {
 	unsigned int i;
+	unsigned long flags;
 
 	if (!force && atomic_read(&ep->running))
 		return -EBUSY;
@@ -934,9 +935,11 @@ static int stop_urbs(struct snd_usb_endp
 	if (!ep_state_update(ep, EP_STATE_RUNNING, EP_STATE_STOPPING))
 		return 0;
 
+	spin_lock_irqsave(&ep->lock, flags);
 	INIT_LIST_HEAD(&ep->ready_playback_urbs);
 	ep->next_packet_head = 0;
 	ep->next_packet_queued = 0;
+	spin_unlock_irqrestore(&ep->lock, flags);
 
 	for (i = 0; i < ep->nurbs; i++) {
 		if (test_bit(i, &ep->active_mask)) {


Patches currently in stable-queue which might be from tiwai@xxxxxxx are

queue-5.15/alsa-usb-audio-rename-early_playback_start-flag-with-lowlatency_playback.patch
queue-5.15/alsa-usb-audio-disable-low-latency-playback-for-free-wheel-mode.patch
queue-5.15/alsa-usb-audio-avoid-killing-in-flight-urbs-during-draining.patch
queue-5.15/alsa-usb-audio-less-restriction-for-low-latency-playback-mode.patch
queue-5.15/alsa-usb-audio-improved-lowlatency-playback-support.patch
queue-5.15/alsa-usb-audio-check-available-frames-for-the-next-packet-size.patch
queue-5.15/alsa-usb-audio-switch-back-to-non-latency-mode-at-a-later-point.patch
queue-5.15/alsa-usb-audio-fix-packet-size-calculation-regression.patch
queue-5.15/alsa-usb-audio-don-t-start-stream-for-capture-at-prepare.patch
queue-5.15/alsa-usb-audio-disable-low-latency-mode-for-implicit-feedback-sync.patch
queue-5.15/alsa-usb-audio-add-spinlock-to-stop_urbs.patch
queue-5.15/alsa-usb-audio-restrict-rates-for-the-shared-clocks.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux