]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB-storage: problem clearing halts
authorMatthew Dharm <mdharm-usb@one-eyed-alien.net>
Mon, 30 Sep 2002 09:43:41 +0000 (02:43 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 30 Sep 2002 09:43:41 +0000 (02:43 -0700)
Greg, attached is a patch designed for diagnostic purposes.  Please apply
to the 2.5 tree -- yes, we'll be removing this at some point in the future.

It appears that we have a problem clearing halts.  This patch causes a very
clear message to be printed whenever a usb_stor_clear_halt() manages to
work.  So far, I haven't seen such a thing happen.  And I've seen _lots_ of
STALL conditions.

This problem has likely been around for a while... however, it hasn't been
noticed before because usb-storage was difficult to use because of other
bugs.  Heck, the most recent 'bk pull' is the first one for me in _months_
which let me boot all the way into X11.

I'm going to hold my patch queue until this is resolved.  On my test setup,
it's easy to see this failing.  I've tried with 4 different devices, with
both UHCI and EHCI drivers.  I don't want to confuse this problem with
other patches...

'result' in this function always seems to be -32.  Which is odd, because
control endpoints shouldn't do that.

I'm open to suggestions as to where to look for this bug, but my instincts
are telling me that this is a core or HCD issue, not a usb-storage issue.

On a positive note, this means that the error-recovery system gets a good
workout.

drivers/usb/storage/transport.c

index 76de10367593aee41b77173a6f7c4bc3d2f80397..19071ba8bf8600c0b0ae43ca8f9be826d9f70c00 100644 (file)
@@ -530,6 +530,8 @@ int usb_stor_clear_halt(struct us_data *us, int pipe)
        if (result < 0)
                return result;
 
+       printk(KERN_ERR "usb_stor_clear_halt() WORKED!\n");
+
        /* reset the toggles and endpoint flags */
        usb_endpoint_running(us->pusb_dev, usb_pipeendpoint(pipe),
                usb_pipeout(pipe));