On Wed, Dec 19, 2001 at 12:10:42AM -0800, David Brownell wrote:
> This is a resend of what you sent to Linus, but with a bugfix
> for an unlink-in-completion bug I ran across.
So the only difference between what you sent me before and this patch is
the following diff?
thanks,
greg k-h
--- linux-2.5/drivers/usb/hcd.h Thu Dec 13 08:42:39 2001
+++ linux-2.5.1-greg/drivers/usb/hcd.h Wed Dec 19 09:16:13 2001
@@ -203,10 +203,6 @@
#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
-// FIXME: hub.h should define TT-related class requests too.
-// Likely some should be handled by usb 2.0 root hubs, even
-// though companions' HCDs handle the TT-like functionality.
-
/*-------------------------------------------------------------------------*/
--- linux-2.5/drivers/usb/hcd.c Thu Dec 13 08:42:39 2001
+++ linux-2.5.1-greg/drivers/usb/hcd.c Wed Dec 19 09:16:13 2001
@@ -922,6 +922,7 @@
struct usb_hcd *hcd;
struct hcd_dev *dev;
unsigned long flags;
+ int pipe;
int mem_flags;
if (!urb || urb->hcpriv || !urb->complete)
@@ -941,6 +942,10 @@
/* can't submit new urbs when quiescing, halted, ... */
if (hcd->state == USB_STATE_QUIESCING || !HCD_IS_RUNNING (hcd->state))
return -ESHUTDOWN;
+ pipe = urb->pipe;
+ if (usb_endpoint_halted (urb->dev, usb_pipeendpoint (pipe),
+ usb_pipeout (pipe)))
+ return -EPIPE;
// FIXME paging/swapping requests over USB should not use GFP_KERNEL
// and might even need to use GFP_NOIO ... that flag actually needs
@@ -955,7 +960,7 @@
/* enforce simple/standard policy */
allowed = USB_ASYNC_UNLINK; // affects later unlinks
allowed |= USB_NO_FSBR; // only affects UHCI
- switch (usb_pipetype (urb->pipe)) {
+ switch (usb_pipetype (pipe)) {
case PIPE_CONTROL:
allowed |= USB_DISABLE_SPD;
break;
@@ -978,14 +983,11 @@
orig_flags, urb->transfer_flags);
}
#endif
-
/*
* FIXME: alloc periodic bandwidth here, for interrupt and iso?
* Need to look at the ring submit mechanism for iso tds ... they
* aren't actually "periodic" in 2.4 kernels.
*
- * FIXME: if (urb->dev->tt) check TT schedule somewhere ...
- *
* FIXME: make urb timeouts be generic, keeping the HCD cores
* as simple as possible.
*/
@@ -1112,6 +1114,11 @@
if ((urb->transfer_flags & USB_TIMEOUT_KILLED))
urb->status = -ETIMEDOUT;
else if (!(urb->transfer_flags & USB_ASYNC_UNLINK)) {
+ if (in_interrupt ()) {
+ dbg ("non-async unlink in_interrupt");
+ retval = -EWOULDBLOCK;
+ goto done;
+ }
/* synchronous unlink: block till we see the completion */
splice.done = 0;
splice.complete = urb->complete;
@@ -1119,10 +1126,6 @@
urb->complete = unlink_complete;
urb->context = &splice;
urb->status = -ENOENT;
- } else if (in_interrupt ()) {
- dbg ("non-async unlink in_interrupt");
- retval = -EWOULDBLOCK;
- goto done;
} else {
/* asynchronous unlink */
urb->status = -ECONNRESET;
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel