David:

I found the reasons why root-hub remote wakeup for EHCI hasn't been
working on my systems.  A patch that gets things going is below.  Perhaps
you've already fixed this and I haven't seen it...

Alan Stern



Index: usb-2.6/drivers/usb/host/ehci-hub.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci-hub.c
+++ usb-2.6/drivers/usb/host/ehci-hub.c
@@ -76,6 +76,10 @@ static int ehci_bus_suspend (struct usb_
        ehci_halt (ehci);
        hcd->state = HC_STATE_SUSPENDED;
 
+       /* allow remote wakeup */
+       if (device_may_wakeup(&hcd->self.root_hub->dev))
+               writel (INTR_MASK, &ehci->regs->intr_enable);
+
        ehci->next_statechange = jiffies + msecs_to_jiffies(10);
        spin_unlock_irq (&ehci->lock);
        return 0;
Index: usb-2.6/drivers/usb/host/ehci-hcd.c
===================================================================
--- usb-2.6.orig/drivers/usb/host/ehci-hcd.c
+++ usb-2.6/drivers/usb/host/ehci-hcd.c
@@ -625,7 +625,7 @@ static irqreturn_t ehci_irq (struct usb_
                /* resume root hub? */
                status = readl (&ehci->regs->command);
                if (!(status & CMD_RUN))
-                       writel (status | CMD_RUN, &ehci->regs->command);
+                       usb_hcd_resume_root_hub(hcd);
 
                while (i--) {
                        status = readl (&ehci->regs->port_status [i]);
@@ -641,7 +641,6 @@ static irqreturn_t ehci_irq (struct usb_
                         */
                        ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
                        ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
-                       usb_hcd_resume_root_hub(hcd);
                }
        }
 



_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to