Commit:     8903795a5275e0366acf961190c57074ad27f9bb
Parent:     8a03d9a498eaf02c8a118752050a5154852c13bf
Author:     Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 14:55:27 2007 -0500
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Feb 16 15:32:17 2007 -0800

    EHCI: turn off remote wakeup during shutdown
    This patch (as850b) disables remote wakeup (and everything else!) on
    all EHCI ports when the shutdown() method is called.  If remote wakeup
    is left active then some systems will reboot instead of powering off.
    This fixes Bugzilla #7828.
    Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
    Cc: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
 drivers/usb/host/ehci-hcd.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 185721d..6bf909e 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -299,6 +299,19 @@ static void ehci_watchdog (unsigned long param)
        spin_unlock_irqrestore (&ehci->lock, flags);
+/* On some systems, leaving remote wakeup enabled prevents system shutdown.
+ * The firmware seems to think that powering off is a wakeup event!
+ * This routine turns off remote wakeup and everything else, on all ports.
+ */
+static void ehci_turn_off_all_ports(struct ehci_hcd *ehci)
+       int     port = HCS_N_PORTS(ehci->hcs_params);
+       while (port--)
+               ehci_writel(ehci, PORT_RWC_BITS,
+                               &ehci->regs->port_status[port]);
 /* ehci_shutdown kick in for silicon on any bus (not just pci, etc).
  * This forcibly disables dma and IRQs, helping kexec and other cases
  * where the next system software may expect clean state.
@@ -310,9 +323,13 @@ ehci_shutdown (struct usb_hcd *hcd)
        ehci = hcd_to_ehci (hcd);
        (void) ehci_halt (ehci);
+       ehci_turn_off_all_ports(ehci);
        /* make BIOS/etc use companion controller during reboot */
        ehci_writel(ehci, 0, &ehci->regs->configured_flag);
+       /* unblock posted writes */
+       ehci_readl(ehci, &ehci->regs->configured_flag);
 static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to