Skip to contentSkip to conversation

usb6fire: prevent driver panic state when stopping

PATCH Applied Jurgen Kramer 2 participants 2 messages Dec 7, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb6fire: prevent driver panic state when stopping

Hi,

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'.

sound/usb/6fire/pcm.c +3 -0
diff -uNrp linux/sound/usb/6fire/pcm.c linux.new/sound/usb/6fire/pcm.c
@@ -135,6 +135,9 @@ static void usb6fire_pcm_stream_stop(str
 	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);

Jurgen

Applied
#1 lore raw

At Fri, 07 Dec 2012 10:26:43 +0100,

Quoted 10 lines · Jurgen Kramer

Hi,

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'.

Thanks, applied.

Takashi

Quoted 24 lines

diff -uNrp linux/sound/usb/6fire/pcm.c linux.new/sound/usb/6fire/pcm.c

sound/usb/6fire/pcm.c +3 -0
@@ -135,6 +135,9 @@ static void usb6fire_pcm_stream_stop(str
 	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);

Jurgen

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel