Revert "USB: EHCI: fix performance regression"
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 May 2008 02:43:27 +0000 (19:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 May 2008 02:43:27 +0000 (19:43 -0700)
This reverts commit fa38dfcc56b5f6cce787f9aaa5d1830509213802.

It wasn't really a regression and David and Alan are still working
through the issues reported.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-q.c

index 3e3c5d3ea0ad91f9bb2b0a9ae327089e40c6aad7..369a8a5ea7bb374da2776dd3a02587b0f58b06fb 100644 (file)
@@ -84,8 +84,7 @@ static const char     hcd_name [] = "ehci_hcd";
 #define EHCI_IAA_MSECS         10              /* arbitrary */
 #define EHCI_IO_JIFFIES                (HZ/10)         /* io watchdog > irq_thresh */
 #define EHCI_ASYNC_JIFFIES     (HZ/20)         /* async idle timeout */
-#define EHCI_SHRINK_JIFFIES    (HZ/100)        /* async qh unlink delay */
-#define EHCI_SHRINK_UFRAMES    (10*8)          /* same value in uframes */
+#define EHCI_SHRINK_JIFFIES    (HZ/200)        /* async qh unlink delay */
 
 /* Initial IRQ latency:  faster than hw default */
 static int log2_irq_thresh = 0;                // 0 to 6
index 5200481deb27725ebecd7c7e9355066fa3b20a32..b85b54160cdaeade20792ad9878d9751606f3b50 100644 (file)
@@ -1116,7 +1116,8 @@ static void scan_async (struct ehci_hcd *ehci)
        struct ehci_qh          *qh;
        enum ehci_timer_action  action = TIMER_IO_WATCHDOG;
 
-       ehci->stamp = ehci_readl(ehci, &ehci->regs->frame_index);
+       if (!++(ehci->stamp))
+               ehci->stamp++;
        timer_action_done (ehci, TIMER_ASYNC_SHRINK);
 rescan:
        qh = ehci->async->qh_next.qh;
@@ -1147,14 +1148,12 @@ rescan:
                         * doesn't stay idle for long.
                         * (plus, avoids some kind of re-activation race.)
                         */
-                       if (list_empty(&qh->qtd_list) &&
-                                       qh->qh_state == QH_STATE_LINKED) {
-                               if (!ehci->reclaim &&
-                                   ((ehci->stamp - qh->stamp) & 8191) >=
-                                               EHCI_SHRINK_UFRAMES)
-                                       start_unlink_async(ehci, qh);
-                               else
+                       if (list_empty (&qh->qtd_list)) {
+                               if (qh->stamp == ehci->stamp)
                                        action = TIMER_ASYNC_SHRINK;
+                               else if (!ehci->reclaim
+                                           && qh->qh_state == QH_STATE_LINKED)
+                                       start_unlink_async (ehci, qh);
                        }
 
                        qh = qh->qh_next.qh;