rpms/kernel/F-13 usb-obey-the-sysfs-power-wakeup-setting.patch, NONE, 1.1 kernel.spec, 1.2113, 1.2114

Chuck Ebbert cebbert at fedoraproject.org
Mon Jul 26 18:38:16 UTC 2010


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv11503

Modified Files:
	kernel.spec 
Added Files:
	usb-obey-the-sysfs-power-wakeup-setting.patch 
Log Message:
usb-obey-the-sysfs-power-wakeup-setting.patch:
  Restore ability of USB devices to wake the machine (#617559)

usb-obey-the-sysfs-power-wakeup-setting.patch:
 driver.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

--- NEW FILE usb-obey-the-sysfs-power-wakeup-setting.patch ---
From: Alan Stern <stern at rowland.harvard.edu>
Date: Tue, 22 Jun 2010 20:14:48 +0000 (-0400)
Subject: USB: obey the sysfs power/wakeup setting
X-Git-Tag: v2.6.35-rc4~18^2~6
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=48826626263d4a61d06fd8c5805da31f925aefa0

USB: obey the sysfs power/wakeup setting

This patch (as1403) is a partial reversion of an earlier change
(commit 5f677f1d45b2bf08085bbba7394392dfa586fa8e "USB: fix remote
wakeup settings during system sleep").  After hearing from a user, I
realized that remote wakeup should be enabled during system sleep
whenever userspace allows it, and not only if a driver requests it
too.

Indeed, there could be a device with no driver, that does nothing but
generate a wakeup request when the user presses a button.  Such a
device should be allowed to do its job.

The problem fixed by the earlier patch -- device generating a wakeup
request for no reason, causing system suspend to abort -- was also
addressed by a later patch ("USB: don't enable remote wakeup by
default", accepted but not yet merged into mainline).  The device
won't be able to generate the bogus wakeup requests because it will be
disabled for remote wakeup by default.  Hence this reversion will not
re-introduce any old problems.

Signed-off-by: Alan Stern <stern at rowland.harvard.edu>
Cc: stable <stable at kernel.org> [.34]
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index de98a94..a6bd53a 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1272,8 +1272,7 @@ static int usb_resume_both(struct usb_device *udev, pm_message_t msg)
 
 static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
 {
-	int			w, i;
-	struct usb_interface	*intf;
+	int	w;
 
 	/* Remote wakeup is needed only when we actually go to sleep.
 	 * For things like FREEZE and QUIESCE, if the device is already
@@ -1285,16 +1284,10 @@ static void choose_wakeup(struct usb_device *udev, pm_message_t msg)
 		return;
 	}
 
-	/* If remote wakeup is permitted, see whether any interface drivers
+	/* Enable remote wakeup if it is allowed, even if no interface drivers
 	 * actually want it.
 	 */
-	w = 0;
-	if (device_may_wakeup(&udev->dev) && udev->actconfig) {
-		for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
-			intf = udev->actconfig->interface[i];
-			w |= intf->needs_remote_wakeup;
-		}
-	}
+	w = device_may_wakeup(&udev->dev);
 
 	/* If the device is autosuspended with the wrong wakeup setting,
 	 * autoresume now so the setting can be changed.


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-13/kernel.spec,v
retrieving revision 1.2113
retrieving revision 1.2114
diff -u -p -r1.2113 -r1.2114
--- kernel.spec	22 Jul 2010 21:38:11 -0000	1.2113
+++ kernel.spec	26 Jul 2010 18:38:15 -0000	1.2114
@@ -793,6 +793,8 @@ Patch12400: input-synaptics-relax-capabi
 
 Patch12410: cifs-fix-malicious-redirect-problem-in-the-dns-lookup-code.patch
 
+Patch12420: usb-obey-the-sysfs-power-wakeup-setting.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1473,6 +1475,9 @@ ApplyPatch input-synaptics-relax-capabil
 # CVE-2010-2524
 ApplyPatch cifs-fix-malicious-redirect-problem-in-the-dns-lookup-code.patch
 
+# restore ability of USB remotes to wake the machine (#617559)
+ApplyPatch usb-obey-the-sysfs-power-wakeup-setting.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2092,6 +2097,10 @@ fi
 
 
 %changelog
+* Mon Jul 26 2010 Chuck Ebbert <cebbert at redhat.com>  2.6.34.1-30
+- usb-obey-the-sysfs-power-wakeup-setting.patch:
+  Restore ability of USB devices to wake the machine (#617559)
+
 * Thu Jul 22 2010 Chuck Ebbert <cebbert at redhat.com>  2.6.34.1-29
 - cifs-fix-malicious-redirect-problem-in-the-dns-lookup-code.patch:
   Fix a malicious redirect problem in the DNS lookup code (CVE-2010-2524)



More information about the scm-commits mailing list