> Date: Tue, 26 Feb 2002 22:38:57 -0800
> From: Greg KH <[EMAIL PROTECTED]>
> On Tue, Feb 26, 2002 at 10:38:56AM -0800, Geoff Keating wrote:
> >
> > Starting a command-line mp3 player on a system with USB speakers,
> > and then trying to stop it with control-C, didn't work; at best it
> > didn't stop right away, at worst kernel panics.
> >
> > It turned out that if a request is stopped half-way using
> > usb_unlink_urb, the completion routine never gets run, and so
> > FLG_URB0RUNNING etc. never get cleared.
> >
> > The problem is somewhat rare, and timing-dependent, because often
> > the request will actually complete before all this code gets run.
> >
> > What should I do to get this patch integrated in the mainline sources?
>
> Try reading Documentation/SubmittingPatches :)
I did. I couldn't find a specific maintainer for the USB audio stuff,
but this does seem like the right list for USB patches, correct?
> How about verifying that this problem is still present in the most
> recent kernel versions, and then sending a patch against those versions?
Sure. I verified by eye that the problem still existed (by checking
that in usb-ohci.c, in dl_del_urb, there's a code path that doesn't
call urb->complete). The commentary above still applies. Some very
minor changes were needed to the patch.
--
- Geoffrey Keating <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
===File ~/patches/kernel-usbaudio-interrupt-2.patch=========
--- linux-2.5.5/drivers/usb/audio.c Tue Feb 19 18:11:02 2002
+++ linux-2.5.5-1/drivers/usb/audio.c Wed Feb 27 13:56:13 2002
@@ -630,6 +630,8 @@ static int dmabuf_copyout_user(struct dm
* USB I/O code. We do sample format conversion if necessary
*/
+static void usbout_completed(struct urb *urb);
+
static void usbin_stop(struct usb_audiodev *as)
{
struct usbin *u = &as->usbin;
@@ -647,14 +649,26 @@ static void usbin_stop(struct usb_audiod
i = u->flags;
spin_unlock_irqrestore(&as->lock, flags);
if (notkilled && signal_pending(current)) {
- if (i & FLG_URB0RUNNING)
+ if (i & FLG_URB0RUNNING) {
usb_unlink_urb(u->durb[0].urb);
- if (i & FLG_URB1RUNNING)
+ if (u->durb[0].urb.status == -ENOENT)
+ usbout_completed (u->durb[0].urb);
+ }
+ if (i & FLG_URB1RUNNING) {
usb_unlink_urb(u->durb[1].urb);
- if (i & FLG_SYNC0RUNNING)
+ if (u->durb[1].urb.status == -ENOENT)
+ usbout_completed (u->durb[1].urb);
+ }
+ if (i & FLG_SYNC0RUNNING) {
usb_unlink_urb(u->surb[0].urb);
- if (i & FLG_SYNC1RUNNING)
+ if (u->surb[0].urb.status == -ENOENT)
+ usbout_completed (u->surb[0].urb);
+ }
+ if (i & FLG_SYNC1RUNNING) {
usb_unlink_urb(u->surb[1].urb);
+ if (u->surb[1].urb.status == -ENOENT)
+ usbout_completed (u->surb[1].urb);
+ }
notkilled = 0;
}
}
============================================================
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel