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.
- Dave
--- 1.13/drivers/usb/host/ehci-mem.c Tue Apr 1 19:48:17 2003
+++ edited/drivers/usb/host/ehci-mem.c Tue Apr 1 20:23:15 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);
--- 1.20/drivers/usb/host/ehci-q.c Tue Apr 1 19:48:17 2003
+++ edited/drivers/usb/host/ehci-q.c Tue Apr 1 20:23:15 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);
