Commit 72c26538 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] patch 2.5.50+, ehci-hcd loop termination

While in search of a different bug, I found this one
that got in with the recent 'async_next' patch.  The
schedule scan termination changed (had to), but it
wasn't quite correct.  Slower and/or misbehaving
devices might have wedged a CPU ... fix is simple,
only restart the scan when the list may have changed.
parent 03360765
......@@ -978,14 +978,19 @@ scan_async (struct ehci_hcd *ehci)
do {
/* clean any finished work for this qh */
if (!list_empty (&qh->qtd_list)) {
// dbg_qh ("scan_async", ehci, qh);
qh = qh_get (qh);
int temp;
/* concurrent unlink could happen here */
count += qh_completions (ehci, qh);
/* unlinks could happen here; completion
* reporting drops the lock.
*/
qh = qh_get (qh);
temp = qh_completions (ehci, qh);
qh_put (ehci, qh);
if (temp != 0) {
count += temp;
goto rescan;
}
}
/* unlink idle entries, reducing HC PCI usage as
* well as HCD schedule-scanning costs.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment