Commit 6242668e authored by Takashi Iwai's avatar Takashi Iwai Committed by Sasha Levin

Revert "ALSA: usb-audio: Fix race at stopping the stream"

[ Upstream commit f8114f85 ]

This reverts commit 16200948.

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: 16200948 ("ALSA: usb-audio: Fix race at stopping the stream")
Reported-by: default avatarIoan-Adrian Ratiu <adi@adirat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent dd503527
...@@ -361,9 +361,6 @@ static void snd_complete_urb(struct urb *urb) ...@@ -361,9 +361,6 @@ static void snd_complete_urb(struct urb *urb)
if (unlikely(atomic_read(&ep->chip->shutdown))) if (unlikely(atomic_read(&ep->chip->shutdown)))
goto exit_clear; goto exit_clear;
if (unlikely(!test_bit(EP_FLAG_RUNNING, &ep->flags)))
goto exit_clear;
if (usb_pipeout(ep->pipe)) { if (usb_pipeout(ep->pipe)) {
retire_outbound_urb(ep, ctx); retire_outbound_urb(ep, ctx);
/* can be stopped during retire callback */ /* can be stopped during retire callback */
...@@ -518,11 +515,6 @@ static int wait_clear_urbs(struct snd_usb_endpoint *ep) ...@@ -518,11 +515,6 @@ static int wait_clear_urbs(struct snd_usb_endpoint *ep)
alive, ep->ep_num); alive, ep->ep_num);
clear_bit(EP_FLAG_STOPPING, &ep->flags); clear_bit(EP_FLAG_STOPPING, &ep->flags);
ep->data_subs = NULL;
ep->sync_slave = NULL;
ep->retire_data_urb = NULL;
ep->prepare_data_urb = NULL;
return 0; return 0;
} }
...@@ -972,6 +964,10 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep) ...@@ -972,6 +964,10 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep)
if (--ep->use_count == 0) { if (--ep->use_count == 0) {
deactivate_urbs(ep, false); deactivate_urbs(ep, false);
ep->data_subs = NULL;
ep->sync_slave = NULL;
ep->retire_data_urb = NULL;
ep->prepare_data_urb = NULL;
set_bit(EP_FLAG_STOPPING, &ep->flags); set_bit(EP_FLAG_STOPPING, &ep->flags);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment