Johannes: Here is a revised version of a patch I sent you earlier.
It stores the status for a completed URB in urb rather than urbp. It avoids setting the status of unlinked URBs to -ECONNRESET, since the hcd glue layer already does that. It gives back unlinked URBs in the order they were unlinked. It renames uhci_remove_pending_qhs() to uhci_remove_pending_urbps(), which is much more logical. If this all looks okay, please let Greg know he should merge it. Alan Stern # This is a BitKeeper generated patch for the following project: # Project Name: greg k-h's linux 2.5 USB kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1656 -> 1.1657 # drivers/usb/host/uhci-debug.c 1.9 -> 1.10 # drivers/usb/host/uhci-hcd.h 1.13 -> 1.14 # drivers/usb/host/uhci-hcd.c 1.57 -> 1.58 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/08/04 [EMAIL PROTECTED] 1.1657 # Remove urbp->status, use urb->status instead. # Don't set urb->status for unlinked urbs. # Giveback unlinked urbs in FIFO order. # Rename uhci_remove_pending_qhs() to uhci_remove_pending_urbps(). # -------------------------------------------- # diff -Nru a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c --- a/drivers/usb/host/uhci-debug.c Mon Aug 4 12:17:13 2003 +++ b/drivers/usb/host/uhci-debug.c Mon Aug 4 12:17:13 2003 @@ -320,8 +320,8 @@ out += sprintf(out, "%s", (urbp->fsbr ? "FSBR " : "")); out += sprintf(out, "%s", (urbp->fsbr_timeout ? "FSBR_TO " : "")); - if (urbp->status != -EINPROGRESS) - out += sprintf(out, "Status=%d ", urbp->status); + if (urbp->urb->status != -EINPROGRESS) + out += sprintf(out, "Status=%d ", urbp->urb->status); //out += sprintf(out, "Inserttime=%lx ",urbp->inserttime); //out += sprintf(out, "FSBRtime=%lx ",urbp->fsbrtime); diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c Mon Aug 4 12:17:13 2003 +++ b/drivers/usb/host/uhci-hcd.c Mon Aug 4 12:17:13 2003 @@ -1534,11 +1534,11 @@ break; } - urbp->status = ret; - if (ret == -EINPROGRESS) goto out; + urb->status = ret; + switch (usb_pipetype(urb->pipe)) { case PIPE_CONTROL: case PIPE_BULK: @@ -1641,10 +1641,8 @@ /* If this is an interrupt URB that is being killed in urb->complete, */ /* then just set its status and return */ - if (!urbp) { - urb->status = -ECONNRESET; - return 0; - } + if (!urbp) + return 0; spin_lock_irqsave(&uhci->urb_list_lock, flags); @@ -1657,7 +1655,7 @@ /* If we're the first, set the next interrupt bit */ if (list_empty(&uhci->urb_remove_list)) uhci_set_next_interrupt(uhci); - list_add(&urbp->urb_list, &uhci->urb_remove_list); + list_add_tail(&urbp->urb_list, &uhci->urb_remove_list); spin_unlock(&uhci->urb_remove_list_lock); spin_unlock_irqrestore(&uhci->urb_list_lock, flags); @@ -1803,17 +1801,11 @@ static void uhci_finish_urb(struct usb_hcd *hcd, struct urb *urb, struct pt_regs *regs) { - struct urb_priv *urbp = (struct urb_priv *)urb->hcpriv; struct uhci_hcd *uhci = hcd_to_uhci(hcd); - int status; unsigned long flags; spin_lock_irqsave(&urb->lock, flags); - status = urbp->status; uhci_destroy_urb_priv(uhci, urb); - - if (urb->status != -ENOENT && urb->status != -ECONNRESET) - urb->status = status; spin_unlock_irqrestore(&urb->lock, flags); usb_hcd_giveback_urb(hcd, urb, regs); @@ -1844,7 +1836,7 @@ spin_unlock_irqrestore(&uhci->complete_list_lock, flags); } -static void uhci_remove_pending_qhs(struct uhci_hcd *uhci) +static void uhci_remove_pending_urbps(struct uhci_hcd *uhci) { struct list_head *tmp, *head; unsigned long flags; @@ -1859,9 +1851,6 @@ tmp = tmp->next; list_del_init(&urbp->urb_list); - - urbp->status = urb->status = -ECONNRESET; - uhci_add_complete(uhci, urb); } spin_unlock_irqrestore(&uhci->urb_remove_list_lock, flags); @@ -1899,7 +1888,7 @@ uhci_free_pending_qhs(uhci); - uhci_remove_pending_qhs(uhci); + uhci_remove_pending_urbps(uhci); uhci_clear_next_interrupt(uhci); @@ -2412,7 +2401,7 @@ * to this bus since there are no more parents */ uhci_free_pending_qhs(uhci); - uhci_remove_pending_qhs(uhci); + uhci_remove_pending_urbps(uhci); reset_hc(uhci); diff -Nru a/drivers/usb/host/uhci-hcd.h b/drivers/usb/host/uhci-hcd.h --- a/drivers/usb/host/uhci-hcd.h Mon Aug 4 12:17:13 2003 +++ b/drivers/usb/host/uhci-hcd.h Mon Aug 4 12:17:13 2003 @@ -379,8 +379,6 @@ /* a control transfer, retrigger */ /* the status phase */ - int status; /* Final status */ - unsigned long inserttime; /* In jiffies */ unsigned long fsbrtime; /* In jiffies */ ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel