David Brownell wrote:
> 
> This fix enhances the scope of the existing OHCI_QUIRK_ZFMICRO flag:
> 
>  1. A watchdog routine periodically scans the OHCI structures to check
>     for orphaned TDs. In these cases the TD is taken back from the
>     controller and completed normally.

Of course, just after I verified and signed off on the final version of
this patch, a problem has cropped up. This just showed up in the log of
one of my test systems:

user.warn kernel: ohci_hcd 0000:00:13.0: Reclaiming orphaned TD c3f41380
user.err kernel: ohci_hcd 0000:00:13.0: bad entry  3f41381

The first message indicates that my watchdog was triggered and the TD
was taken back from the HC. The second message seems to indicate that
the HC did, in fact, later complete the TD.

I can think of two explanations for this:

1. We aren't waiting long enough between the time the TD is popped off
the queue and the time it's taken back through the donelist. If that's
the case, I don't know how long would be reasonable.

2. The logic is too naive. The quirk assumes that if HeadP and DoneP
remain equal (meaning that the HC's queue is empty) for at least one
frame, but the HCD still sees an outstanding TD, then that TD must be
lost. But it may be that even though the queue is still empty, there
were intervening transactions in the meantime (it was momentarily
nonempty, but is now empty again). In that case, I could fix it by
verifying that the second time around, if HeadP and TailP are still
equal, they point to a *different* dummy than they did before. I don't
know how that comparison would be done - a simple address check may not
be sufficient, because the DMA allocation code will give out the same
addresses for new TDs after the old ones are retired.

Either way, this patch in its current form isn't safe.

Mike

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to