Subject: misc/26545: ohci can miss interrupts
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <dellis@conexant.com>
List: netbsd-bugs
Date: 08/04/2004 13:13:35
>Number:         26545
>Category:       misc
>Synopsis:       ohci can miss interrupts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 04 15:38:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dan Ellis
>Release:        
>Organization:
Conexant Systems Inc.
>Environment:
>Description:
The ohci driver can occasionally miss transfer completions.
>How-To-Repeat:
Heavy PCI load.
>Fix:
It's possible that the ohci interrupt can reach the CPU before the write  over PCI. This results in the done head pointer being NULL. If the subsequent read of the interrupt status indicates that an OHCI_WDH has occured then the done pointer should be reread and the pointer nulled:

@@ -1122,8 +1128,15 @@
 		if (done & OHCI_DONE_INTRS)
 			intrs |= OREAD4(sc, OHCI_INTERRUPT_STATUS);
 		sc->sc_hcca->hcca_done_head = 0;
-	} else
-		intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS) & ~OHCI_WDH;
+	} else {
+		intrs = OREAD4(sc, OHCI_INTERRUPT_STATUS);
+                /* if we've flushed out a WDH, then reread */
+                if (intrs & OHCI_WDH)
+                {
+                        done = le32toh(sc->sc_hcca->hcca_done_head);
+                        sc->sc_hcca->hcca_done_head = 0;
+                }
+        }
 
 	if (!intrs)
 		return (0);

>Release-Note:
>Audit-Trail:
>Unformatted: