This gets rid of some potentially scarey messages I've recently
seen on disconnect, "bad hash" for a TD ... it's really a "no hash"
case, and this prevents the message in some cases where that's
not an issue.  Likely this is what Gary Gorgen noticed, but even
he had a different problem, this message shouldn't always appear.

It also slims down one other message, preventing it from appearing
in the routine "protocol stall" case (and cluttering logfiles).

Goes on top of the last couple OHCI patches I sent.  Please merge.

- Dave

--- 1.15/drivers/usb/host/ohci-mem.c    Tue Feb 18 17:05:55 2003
+++ edited/drivers/usb/host/ohci-mem.c  Wed Feb 19 14:05:40 2003
@@ -115,8 +115,8 @@
                prev = &(*prev)->td_hash;
        if (*prev)
                *prev = td->td_hash;
-       else
-               ohci_dbg (hc, "bad hash for td %p\n", td);
+       else if ((td->hwINFO & TD_DONE) != 0)
+               ohci_dbg (hc, "no hash for td %p\n", td);
        pci_pool_free (hc->td_cache, td, td->td_dma);
 }
 
--- 1.36/drivers/usb/host/ohci-q.c      Tue Feb 18 17:06:14 2003
+++ edited/drivers/usb/host/ohci-q.c    Wed Feb 19 15:05:57 2003
@@ -783,14 +783,18 @@
                ed->hwHeadP = next->hwNextTD | toggle;
        }
 
-       /* help for troubleshooting: */
-       ohci_dbg (ohci,
-               "urb %p usb-%s-%s ep-%d-%s cc %d --> status %d\n",
-               urb,
-               urb->dev->bus->bus_name, urb->dev->devpath,
-               usb_pipeendpoint (urb->pipe),
-               usb_pipein (urb->pipe) ? "IN" : "OUT",
-               cc, cc_to_error [cc]);
+       /* help for troubleshooting:  report anything that
+        * looks odd ... that doesn't include protocol stalls
+        * (or maybe some other things)
+        */
+       if (cc != TD_CC_STALL || !usb_pipecontrol (urb->pipe))
+               ohci_dbg (ohci,
+                       "urb %p path %s ep%d%s %08x cc %d --> status %d\n",
+                       urb, urb->dev->devpath,
+                       usb_pipeendpoint (urb->pipe),
+                       usb_pipein (urb->pipe) ? "in" : "out",
+                       le32_to_cpu (td->hwINFO),
+                       cc, cc_to_error [cc]);
 
        return rev;
 }

Reply via email to