ALSA: usb6fire: prevent driver panic state when stopping
authorJurgen Kramer <gtmkramer@xs4all.nl>
Fri, 7 Dec 2012 09:26:43 +0000 (10:26 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 7 Dec 2012 14:03:34 +0000 (15:03 +0100)
The patch below prevents the 6fire usb driver going into panic state
when stopping playing. On some systems the urb in handler
(usb6fire_pcm_in_urb_handler) is being called while urbs are being
killed off, this causes the driver to set panic state and can result in
the kernel warning 'URB %p submitted while active'.

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/6fire/pcm.c

index cabedb416fc4a39193cd06c353992967c4395582..e2ca12fe92e946f662d47ae39983e176f7a50402 100644 (file)
@@ -135,6 +135,9 @@ static void usb6fire_pcm_stream_stop(struct pcm_runtime *rt)
        struct control_runtime *ctrl_rt = rt->chip->control;
 
        if (rt->stream_state != STREAM_DISABLED) {
+
+               rt->stream_state = STREAM_STOPPING;
+
                for (i = 0; i < PCM_N_URBS; i++) {
                        usb_kill_urb(&rt->in_urbs[i].instance);
                        usb_kill_urb(&rt->out_urbs[i].instance);