]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/ehci.h
USB: improve ehci_watchdog's side effect in CPU power management
[linux-2.6-omap-h63xx.git] / drivers / usb / host / ehci.h
index b697a13364ecee4d86d6c2dbbd7156001af961b8..a6fd550b6903f77116fec4adb63b379753041542 100644 (file)
@@ -181,14 +181,16 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
         * the async ring; just the I/O watchdog.  Note that if a
         * SHRINK were pending, OFF would never be requested.
         */
-       if (timer_pending(&ehci->watchdog)
-                       && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
-                               & ehci->actions))
-               return;
+       enum ehci_timer_action oldactions = ehci->actions;
 
        if (!test_and_set_bit (action, &ehci->actions)) {
                unsigned long t;
 
+               if (timer_pending(&ehci->watchdog)
+                       && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF))
+                               & oldactions))
+                       return;
+
                switch (action) {
                case TIMER_IO_WATCHDOG:
                        t = EHCI_IO_JIFFIES;
@@ -204,7 +206,7 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
                        t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
                        break;
                }
-               mod_timer(&ehci->watchdog, t + jiffies);
+               mod_timer(&ehci->watchdog, round_jiffies(t + jiffies));
        }
 }
 
@@ -604,16 +606,7 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
 /*
  * Big-endian read/write functions are arch-specific.
  * Other arches can be added if/when they're needed.
- *
- * REVISIT: arch/powerpc now has readl/writel_be, so the
- * definition below can die once the 4xx support is
- * finally ported over.
  */
-#if defined(CONFIG_PPC) && !defined(CONFIG_PPC_MERGE)
-#define readl_be(addr)         in_be32((__force unsigned *)addr)
-#define writel_be(val, addr)   out_be32((__force unsigned *)addr, val)
-#endif
-
 #if defined(CONFIG_ARM) && defined(CONFIG_ARCH_IXP4XX)
 #define readl_be(addr)         __raw_readl((__force unsigned *)addr)
 #define writel_be(val, addr)   __raw_writel(val, (__force unsigned *)addr)