Skip to content

Commit f8114f8

Browse files
tiwaitorvalds
authored andcommitted
Revert "ALSA: usb-audio: Fix race at stopping the stream"
This reverts commit 1620094. The commit was intended to cover the race condition, but it introduced yet another regression for devices with the implicit feedback, leading to a kernel panic due to NULL-dereference in an irq context. As the race condition that was addressed by the commit is very rare and the regression is much worse, let's revert the commit for rc1, and fix the issue properly in a later patch. Fixes: 1620094 ("ALSA: usb-audio: Fix race at stopping the stream") Reported-by: Ioan-Adrian Ratiu <adi@adirat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ba6d973 commit f8114f8

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

sound/usb/endpoint.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,6 @@ static void snd_complete_urb(struct urb *urb)
384384
if (unlikely(atomic_read(&ep->chip->shutdown)))
385385
goto exit_clear;
386386

387-
if (unlikely(!test_bit(EP_FLAG_RUNNING, &ep->flags)))
388-
goto exit_clear;
389-
390387
if (usb_pipeout(ep->pipe)) {
391388
retire_outbound_urb(ep, ctx);
392389
/* can be stopped during retire callback */
@@ -537,11 +534,6 @@ static int wait_clear_urbs(struct snd_usb_endpoint *ep)
537534
alive, ep->ep_num);
538535
clear_bit(EP_FLAG_STOPPING, &ep->flags);
539536

540-
ep->data_subs = NULL;
541-
ep->sync_slave = NULL;
542-
ep->retire_data_urb = NULL;
543-
ep->prepare_data_urb = NULL;
544-
545537
return 0;
546538
}
547539

@@ -1028,6 +1020,10 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep)
10281020

10291021
if (--ep->use_count == 0) {
10301022
deactivate_urbs(ep, false);
1023+
ep->data_subs = NULL;
1024+
ep->sync_slave = NULL;
1025+
ep->retire_data_urb = NULL;
1026+
ep->prepare_data_urb = NULL;
10311027
set_bit(EP_FLAG_STOPPING, &ep->flags);
10321028
}
10331029
}

0 commit comments

Comments
 (0)