USB: EHCI: add need_io_watchdog flag to ehci_hcd
authorAlek Du <alek.du@intel.com>
Mon, 13 Jul 2009 09:30:41 +0000 (17:30 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Sep 2009 13:46:28 +0000 (06:46 -0700)
Basically the io watchdog is only useful for those quirk HCDs. For most
good ones, it only brings unnecessary wakeups.  At least, I know the
Intel EHCI HCDs should turn off the flag.

Signed-off-by: Alek Du <alek.du@intel.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci.h

index 54715b875759c0cc83fe5e4402bad822251a805c..2dc15f3ad14386ad0708c1173410f45b201625c4 100644 (file)
@@ -127,6 +127,8 @@ timer_action(struct ehci_hcd *ehci, enum ehci_timer_action action)
 
                switch (action) {
                case TIMER_IO_WATCHDOG:
+                       if (!ehci->need_io_watchdog)
+                               return;
                        t = EHCI_IO_JIFFIES;
                        break;
                case TIMER_ASYNC_OFF:
@@ -508,6 +510,10 @@ static int ehci_init(struct usb_hcd *hcd)
 
        spin_lock_init(&ehci->lock);
 
+       /*
+        * keep io watchdog by default, those good HCDs could turn off it later
+        */
+       ehci->need_io_watchdog = 1;
        init_timer(&ehci->watchdog);
        ehci->watchdog.function = ehci_watchdog;
        ehci->watchdog.data = (unsigned long) ehci;
index b5b83c43898a6ff080a598e15311072e8e87c5ea..a88ad517ec5c29c31a397e5e900ae55e8393f789 100644 (file)
@@ -129,6 +129,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
                return retval;
 
        switch (pdev->vendor) {
+       case PCI_VENDOR_ID_INTEL:
+               ehci->need_io_watchdog = 0;
+               break;
        case PCI_VENDOR_ID_TDI:
                if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
                        hcd->has_tt = 1;
index 48b9e889a18b43e00fca23826dfa36b9697885f0..acec108940783378dc0c70dc740e81dc2c6b247d 100644 (file)
@@ -126,6 +126,7 @@ struct ehci_hcd {                   /* one per controller */
        unsigned                big_endian_mmio:1;
        unsigned                big_endian_desc:1;
        unsigned                has_amcc_usb23:1;
+       unsigned                need_io_watchdog:1;
 
        /* required for usb32 quirk */
        #define OHCI_CTRL_HCFS          (3 << 6)