patch usb-don-t-enable-wakeup-by-default-for-pci-host-controllers.patch added to gregkh-2.6 tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Subject: USB: don't enable wakeup by default for PCI host controllers

to my gregkh-2.6 tree.  Its filename is

    usb-don-t-enable-wakeup-by-default-for-pci-host-controllers.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From stern@xxxxxxxxxxxxxxxxxxx  Sat Jan 24 16:19:17 2009
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Jan 2009 11:35:54 -0500 (EST)
Subject: USB: don't enable wakeup by default for PCI host controllers
To: Greg KH <greg@xxxxxxxxx>, "Rafael J. Wysocki" <rjw@xxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>, USB list <linux-usb@xxxxxxxxxxxxxxx>,  Linux-pm mailing list <linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Message-ID: <Pine.LNX.4.44L0.0901131133430.2667-100000@xxxxxxxxxxxxxxxxxxxx>


This patch (as1199) changes the initial wakeup settings for PCI USB
host controllers.  The controllers are marked as capable of waking the
system, but wakeup is not enabled by default.

It turns out that enabling wakeup for USB host controllers has a lot
of bad consequences.  As the simplest example, if a USB mouse or
keyboard is unplugged immediately after the computer is put to sleep,
the unplug will cause the system to wake back up again!  We are better
off marking them as wakeup-capable and leaving wakeup disabled.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Reported-by: Rafael J. Wysocki <rjw@xxxxxxx>
CC: David Brownell <david-b@xxxxxxxxxxx>
Cc: stable <stable@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
 drivers/usb/core/hcd-pci.c  |    1 -
 drivers/usb/host/ehci-pci.c |    2 +-
 drivers/usb/host/ohci-hcd.c |    8 +++-----
 3 files changed, 4 insertions(+), 7 deletions(-)

--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -128,7 +128,6 @@ int usb_hcd_pci_probe(struct pci_dev *de
 	}
 
 	pci_set_master(dev);
-	device_set_wakeup_enable(&dev->dev, 1);
 
 	retval = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED);
 	if (retval != 0)
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -230,7 +230,7 @@ static int ehci_pci_setup(struct usb_hcd
 		pci_read_config_word(pdev, 0x62, &port_wake);
 		if (port_wake & 0x0001) {
 			dev_warn(&pdev->dev, "Enabling legacy PCI PM\n");
-			device_init_wakeup(&pdev->dev, 1);
+			device_set_wakeup_capable(&pdev->dev, 1);
 		}
 	}
 
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -593,12 +593,10 @@ static int ohci_run (struct ohci_hcd *oh
 	 * to be checked in case boot firmware (BIOS/SMM/...) has set up
 	 * wakeup in a way the bus isn't aware of (e.g., legacy PCI PM).
 	 * If the bus glue detected wakeup capability then it should
-	 * already be enabled.  Either way, if wakeup should be enabled
-	 * but isn't, we'll enable it now.
+	 * already be enabled; if so we'll just enable it again.
 	 */
-	if ((ohci->hc_control & OHCI_CTRL_RWC) != 0
-			&& !device_can_wakeup(hcd->self.controller))
-		device_init_wakeup(hcd->self.controller, 1);
+	if ((ohci->hc_control & OHCI_CTRL_RWC) != 0)
+		device_set_wakeup_capable(hcd->self.controller, 1);
 
 	switch (ohci->hc_control & OHCI_CTRL_HCFS) {
 	case OHCI_USB_OPER:


Patches currently in gregkh-2.6 which might be from stern@xxxxxxxxxxxxxxxxxxx are

usb.current/usb-don-t-enable-wakeup-by-default-for-pci-host-controllers.patch
usb.current/usb-fix-char-device-disconnect-handling.patch
usb.current/usb-fix-suspend-resume-of-pci-usb-controllers.patch
usb.current/usb-fix-toggle-mismatch-in-disable_endpoint-paths.patch
driver-core.current/klist.c-bit-0-in-pointer-can-t-be-used-as-flag.patch
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux