This patch (as738) fixes the root-hub remote-wakeup support in ehci-hcd.  
The existing code has two problems.  First, when the bus is suspended all 
root-hub interrupts are disabled.  Second, the call to 
usb_hcd_resume_root_hub() is in the wrong place -- it is invoked when a 
wakeup request arrives on a suspended port rather than when the root hub 
itself generates a wakeup request.

Working remote wakeup support is an important part of autoresume and a
prerequisite for autosuspend.

Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

---

Index: 18g20/drivers/usb/host/ehci-hub.c
===================================================================
--- 18g20.orig/drivers/usb/host/ehci-hub.c
+++ 18g20/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: 18g20/drivers/usb/host/ehci-hcd.c
===================================================================
--- 18g20.orig/drivers/usb/host/ehci-hcd.c
+++ 18g20/drivers/usb/host/ehci-hcd.c
@@ -637,7 +637,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--) {
                        int pstatus = readl (&ehci->regs->port_status [i]);
@@ -654,7 +654,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);
                }
        }
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to