EHCI: don't rescan interrupt QHs needlessly
[pandora-kernel.git] / drivers / usb / host / ehci-sched.c
index 1543c83..a7408d8 100644 (file)
@@ -2287,6 +2287,7 @@ scan_periodic (struct ehci_hcd *ehci)
        }
        clock &= mod - 1;
        clock_frame = clock >> 3;
+       ++ehci->periodic_stamp;
 
        for (;;) {
                union ehci_shadow       q, *q_p;
@@ -2315,10 +2316,14 @@ restart:
                                temp.qh = qh_get (q.qh);
                                type = Q_NEXT_TYPE(ehci, q.qh->hw->hw_next);
                                q = q.qh->qh_next;
-                               modified = qh_completions (ehci, temp.qh);
-                               if (unlikely(list_empty(&temp.qh->qtd_list) ||
-                                               temp.qh->needs_rescan))
-                                       intr_deschedule (ehci, temp.qh);
+                               if (temp.qh->stamp != ehci->periodic_stamp) {
+                                       modified = qh_completions(ehci, temp.qh);
+                                       if (!modified)
+                                               temp.qh->stamp = ehci->periodic_stamp;
+                                       if (unlikely(list_empty(&temp.qh->qtd_list) ||
+                                                       temp.qh->needs_rescan))
+                                               intr_deschedule(ehci, temp.qh);
+                               }
                                qh_put (temp.qh);
                                break;
                        case Q_TYPE_FSTN:
@@ -2460,6 +2465,7 @@ restart:
                        if (ehci->clock_frame != clock_frame) {
                                free_cached_lists(ehci);
                                ehci->clock_frame = clock_frame;
+                               ++ehci->periodic_stamp;
                        }
                } else {
                        now_uframe++;