ChangeSet 1.1101.3.5, 2003/04/09 17:00:10-07:00, david-b@pacbell.net [PATCH] USB: ehci-hcd, minor hardware tweaks Greg KH wrote: > On Thu, Mar 27, 2003 at 06:48:38PM -0800, David Brownell wrote: > >>This tweaks the hardware in two minor ways, being more forgiving >>of what are either hardware bugs or hard-to-see driver bugs. >> >> - Some silicon seems to mis-handle dummy qtds on occasion, >> writing them into the qh and thus stopping progress unless >> something times it out and cancels it (scsi-eh etc). >> >> This initializes such qtds slightly differently, so some >> such cases will make the driver automatically recover, and >> so all such errors will fail in the same way. >> >>Also minor diagnostic tweaks for better uniformity/usability. >> >>Please merge to 2.5 and 2.4 trees. > > > Applied to 2.5, but I get 2 rejects when trying to apply it to 2.4. The second tweak was in 2.4 already, and the other reject was a whitespace issue. Here's the 2.4 version. drivers/usb/host/ehci-mem.c | 1 + drivers/usb/host/ehci-q.c | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff -Nru a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c --- a/drivers/usb/host/ehci-mem.c Fri Apr 18 15:01:10 2003 +++ b/drivers/usb/host/ehci-mem.c Fri Apr 18 15:01:10 2003 @@ -62,6 +62,7 @@ { memset (qtd, 0, sizeof *qtd); qtd->qtd_dma = dma; + qtd->hw_token = cpu_to_le32 (QTD_STS_HALT); qtd->hw_next = EHCI_LIST_END; qtd->hw_alt_next = EHCI_LIST_END; INIT_LIST_HEAD (&qtd->qtd_list); diff -Nru a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c --- a/drivers/usb/host/ehci-q.c Fri Apr 18 15:01:10 2003 +++ b/drivers/usb/host/ehci-q.c Fri Apr 18 15:01:10 2003 @@ -137,7 +137,10 @@ if (QTD_CERR (token)) urb->status = -EPIPE; else { - dbg ("3strikes"); + ehci_dbg (ehci, "devpath %s ep%d%s 3strikes\n", + urb->dev->devpath, + usb_pipeendpoint (urb->pipe), + usb_pipein (urb->pipe) ? "in" : "out"); urb->status = -EPROTO; } /* CERR nonzero + no errors + halt --> stall */ @@ -866,7 +869,7 @@ * HC is allowed to fetch the old dummy (4.10.2). */ token = qtd->hw_token; - qtd->hw_token = 0; + qtd->hw_token = cpu_to_le32 (QTD_STS_HALT); wmb (); dummy = qh->dummy; @@ -918,8 +921,7 @@ if (usb_pipein (urb->pipe) && !usb_pipecontrol (urb->pipe)) epnum |= 0x10; - vdbg ("%s: submit_async urb %p len %d ep %d-%s qtd %p [qh %p]", - hcd_to_bus (&ehci->hcd)->bus_name, + ehci_vdbg (ehci, "submit_async urb %p len %d ep%d%s qtd %p [qh %p]\n", urb, urb->transfer_buffer_length, epnum & 0x0f, (epnum & 0x10) ? "in" : "out", qtd, dev ? dev->ep [epnum] : (void *)~0);