aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-25 09:18:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-25 09:18:39 -0400
commit7e0bb71e75020348bee523720a0c2f04cc72f540 (patch)
tree1a22d65bbce34e8cc0f82c543c9486ffb58332f7 /drivers/usb
parentb9e2780d576a010d4aba1e69f247170bf3718d6b (diff)
parent0ab1e79b825a5cd8aeb3b34d89c9a89dea900056 (diff)
Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (63 commits) PM / Clocks: Remove redundant NULL checks before kfree() PM / Documentation: Update docs about suspend and CPU hotplug ACPI / PM: Add Sony VGN-FW21E to nonvs blacklist. ARM: mach-shmobile: sh7372 A4R support (v4) ARM: mach-shmobile: sh7372 A3SP support (v4) PM / Sleep: Mark devices involved in wakeup signaling during suspend PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image PM / Hibernate: Do not initialize static and extern variables to 0 PM / Freezer: Make fake_signal_wake_up() wake TASK_KILLABLE tasks too PM / Hibernate: Add resumedelay kernel param in addition to resumewait MAINTAINERS: Update linux-pm list address PM / ACPI: Blacklist Vaio VGN-FW520F machine known to require acpi_sleep=nonvs PM / ACPI: Blacklist Sony Vaio known to require acpi_sleep=nonvs PM / Hibernate: Add resumewait param to support MMC-like devices as resume file PM / Hibernate: Fix typo in a kerneldoc comment PM / Hibernate: Freeze kernel threads after preallocating memory PM: Update the policy on default wakeup settings PM / VT: Cleanup #if defined uglyness and fix compile error PM / Suspend: Off by one in pm_suspend() PM / Hibernate: Include storage keys in hibernation image on s390 ...
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/class/cdc-acm.c2
-rw-r--r--drivers/usb/class/cdc-wdm.c6
-rw-r--r--drivers/usb/core/driver.c9
-rw-r--r--drivers/usb/core/hcd.c9
-rw-r--r--drivers/usb/core/hub.c15
-rw-r--r--drivers/usb/serial/sierra.c2
-rw-r--r--drivers/usb/serial/usb_wwan.c2
7 files changed, 22 insertions, 23 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 3ec6699ab725..6960715c5063 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1305,7 +1305,7 @@ static int acm_suspend(struct usb_interface *intf, pm_message_t message)
1305 struct acm *acm = usb_get_intfdata(intf); 1305 struct acm *acm = usb_get_intfdata(intf);
1306 int cnt; 1306 int cnt;
1307 1307
1308 if (message.event & PM_EVENT_AUTO) { 1308 if (PMSG_IS_AUTO(message)) {
1309 int b; 1309 int b;
1310 1310
1311 spin_lock_irq(&acm->write_lock); 1311 spin_lock_irq(&acm->write_lock);
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 1d26a7135dd9..efe684908c1f 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -798,11 +798,11 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
798 dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor); 798 dev_dbg(&desc->intf->dev, "wdm%d_suspend\n", intf->minor);
799 799
800 /* if this is an autosuspend the caller does the locking */ 800 /* if this is an autosuspend the caller does the locking */
801 if (!(message.event & PM_EVENT_AUTO)) 801 if (!PMSG_IS_AUTO(message))
802 mutex_lock(&desc->lock); 802 mutex_lock(&desc->lock);
803 spin_lock_irq(&desc->iuspin); 803 spin_lock_irq(&desc->iuspin);
804 804
805 if ((message.event & PM_EVENT_AUTO) && 805 if (PMSG_IS_AUTO(message) &&
806 (test_bit(WDM_IN_USE, &desc->flags) 806 (test_bit(WDM_IN_USE, &desc->flags)
807 || test_bit(WDM_RESPONDING, &desc->flags))) { 807 || test_bit(WDM_RESPONDING, &desc->flags))) {
808 spin_unlock_irq(&desc->iuspin); 808 spin_unlock_irq(&desc->iuspin);
@@ -815,7 +815,7 @@ static int wdm_suspend(struct usb_interface *intf, pm_message_t message)
815 kill_urbs(desc); 815 kill_urbs(desc);
816 cancel_work_sync(&desc->rxwork); 816 cancel_work_sync(&desc->rxwork);
817 } 817 }
818 if (!(message.event & PM_EVENT_AUTO)) 818 if (!PMSG_IS_AUTO(message))
819 mutex_unlock(&desc->lock); 819 mutex_unlock(&desc->lock);
820 820
821 return rv; 821 return rv;
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index adf5ca8a2396..3b029a0a4787 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1046,8 +1046,7 @@ static int usb_resume_device(struct usb_device *udev, pm_message_t msg)
1046 /* Non-root devices on a full/low-speed bus must wait for their 1046 /* Non-root devices on a full/low-speed bus must wait for their
1047 * companion high-speed root hub, in case a handoff is needed. 1047 * companion high-speed root hub, in case a handoff is needed.
1048 */ 1048 */
1049 if (!(msg.event & PM_EVENT_AUTO) && udev->parent && 1049 if (!PMSG_IS_AUTO(msg) && udev->parent && udev->bus->hs_companion)
1050 udev->bus->hs_companion)
1051 device_pm_wait_for_dev(&udev->dev, 1050 device_pm_wait_for_dev(&udev->dev,
1052 &udev->bus->hs_companion->root_hub->dev); 1051 &udev->bus->hs_companion->root_hub->dev);
1053 1052
@@ -1075,7 +1074,7 @@ static int usb_suspend_interface(struct usb_device *udev,
1075 1074
1076 if (driver->suspend) { 1075 if (driver->suspend) {
1077 status = driver->suspend(intf, msg); 1076 status = driver->suspend(intf, msg);
1078 if (status && !(msg.event & PM_EVENT_AUTO)) 1077 if (status && !PMSG_IS_AUTO(msg))
1079 dev_err(&intf->dev, "%s error %d\n", 1078 dev_err(&intf->dev, "%s error %d\n",
1080 "suspend", status); 1079 "suspend", status);
1081 } else { 1080 } else {
@@ -1189,7 +1188,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
1189 status = usb_suspend_interface(udev, intf, msg); 1188 status = usb_suspend_interface(udev, intf, msg);
1190 1189
1191 /* Ignore errors during system sleep transitions */ 1190 /* Ignore errors during system sleep transitions */
1192 if (!(msg.event & PM_EVENT_AUTO)) 1191 if (!PMSG_IS_AUTO(msg))
1193 status = 0; 1192 status = 0;
1194 if (status != 0) 1193 if (status != 0)
1195 break; 1194 break;
@@ -1199,7 +1198,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
1199 status = usb_suspend_device(udev, msg); 1198 status = usb_suspend_device(udev, msg);
1200 1199
1201 /* Again, ignore errors during system sleep transitions */ 1200 /* Again, ignore errors during system sleep transitions */
1202 if (!(msg.event & PM_EVENT_AUTO)) 1201 if (!PMSG_IS_AUTO(msg))
1203 status = 0; 1202 status = 0;
1204 } 1203 }
1205 1204
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index b3b7d062906d..13222d352a61 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1975,8 +1975,9 @@ int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg)
1975 int status; 1975 int status;
1976 int old_state = hcd->state; 1976 int old_state = hcd->state;
1977 1977
1978 dev_dbg(&rhdev->dev, "bus %s%s\n", 1978 dev_dbg(&rhdev->dev, "bus %ssuspend, wakeup %d\n",
1979 (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "suspend"); 1979 (PMSG_IS_AUTO(msg) ? "auto-" : ""),
1980 rhdev->do_remote_wakeup);
1980 if (HCD_DEAD(hcd)) { 1981 if (HCD_DEAD(hcd)) {
1981 dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "suspend"); 1982 dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "suspend");
1982 return 0; 1983 return 0;
@@ -2011,8 +2012,8 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg)
2011 int status; 2012 int status;
2012 int old_state = hcd->state; 2013 int old_state = hcd->state;
2013 2014
2014 dev_dbg(&rhdev->dev, "usb %s%s\n", 2015 dev_dbg(&rhdev->dev, "usb %sresume\n",
2015 (msg.event & PM_EVENT_AUTO ? "auto-" : ""), "resume"); 2016 (PMSG_IS_AUTO(msg) ? "auto-" : ""));
2016 if (HCD_DEAD(hcd)) { 2017 if (HCD_DEAD(hcd)) {
2017 dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "resume"); 2018 dev_dbg(&rhdev->dev, "skipped %s of dead bus\n", "resume");
2018 return 0; 2019 return 0;
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d6cc83249341..96f05b29c9ad 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2369,8 +2369,6 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2369 int port1 = udev->portnum; 2369 int port1 = udev->portnum;
2370 int status; 2370 int status;
2371 2371
2372 // dev_dbg(hub->intfdev, "suspend port %d\n", port1);
2373
2374 /* enable remote wakeup when appropriate; this lets the device 2372 /* enable remote wakeup when appropriate; this lets the device
2375 * wake up the upstream hub (including maybe the root hub). 2373 * wake up the upstream hub (including maybe the root hub).
2376 * 2374 *
@@ -2387,7 +2385,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2387 dev_dbg(&udev->dev, "won't remote wakeup, status %d\n", 2385 dev_dbg(&udev->dev, "won't remote wakeup, status %d\n",
2388 status); 2386 status);
2389 /* bail if autosuspend is requested */ 2387 /* bail if autosuspend is requested */
2390 if (msg.event & PM_EVENT_AUTO) 2388 if (PMSG_IS_AUTO(msg))
2391 return status; 2389 return status;
2392 } 2390 }
2393 } 2391 }
@@ -2416,12 +2414,13 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
2416 USB_CTRL_SET_TIMEOUT); 2414 USB_CTRL_SET_TIMEOUT);
2417 2415
2418 /* System sleep transitions should never fail */ 2416 /* System sleep transitions should never fail */
2419 if (!(msg.event & PM_EVENT_AUTO)) 2417 if (!PMSG_IS_AUTO(msg))
2420 status = 0; 2418 status = 0;
2421 } else { 2419 } else {
2422 /* device has up to 10 msec to fully suspend */ 2420 /* device has up to 10 msec to fully suspend */
2423 dev_dbg(&udev->dev, "usb %ssuspend\n", 2421 dev_dbg(&udev->dev, "usb %ssuspend, wakeup %d\n",
2424 (msg.event & PM_EVENT_AUTO ? "auto-" : "")); 2422 (PMSG_IS_AUTO(msg) ? "auto-" : ""),
2423 udev->do_remote_wakeup);
2425 usb_set_device_state(udev, USB_STATE_SUSPENDED); 2424 usb_set_device_state(udev, USB_STATE_SUSPENDED);
2426 msleep(10); 2425 msleep(10);
2427 } 2426 }
@@ -2572,7 +2571,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
2572 } else { 2571 } else {
2573 /* drive resume for at least 20 msec */ 2572 /* drive resume for at least 20 msec */
2574 dev_dbg(&udev->dev, "usb %sresume\n", 2573 dev_dbg(&udev->dev, "usb %sresume\n",
2575 (msg.event & PM_EVENT_AUTO ? "auto-" : "")); 2574 (PMSG_IS_AUTO(msg) ? "auto-" : ""));
2576 msleep(25); 2575 msleep(25);
2577 2576
2578 /* Virtual root hubs can trigger on GET_PORT_STATUS to 2577 /* Virtual root hubs can trigger on GET_PORT_STATUS to
@@ -2679,7 +2678,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
2679 udev = hdev->children [port1-1]; 2678 udev = hdev->children [port1-1];
2680 if (udev && udev->can_submit) { 2679 if (udev && udev->can_submit) {
2681 dev_warn(&intf->dev, "port %d nyet suspended\n", port1); 2680 dev_warn(&intf->dev, "port %d nyet suspended\n", port1);
2682 if (msg.event & PM_EVENT_AUTO) 2681 if (PMSG_IS_AUTO(msg))
2683 return -EBUSY; 2682 return -EBUSY;
2684 } 2683 }
2685 } 2684 }
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index d5d136a53b61..b18179bda0d8 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -1009,7 +1009,7 @@ static int sierra_suspend(struct usb_serial *serial, pm_message_t message)
1009 struct sierra_intf_private *intfdata; 1009 struct sierra_intf_private *intfdata;
1010 int b; 1010 int b;
1011 1011
1012 if (message.event & PM_EVENT_AUTO) { 1012 if (PMSG_IS_AUTO(message)) {
1013 intfdata = serial->private; 1013 intfdata = serial->private;
1014 spin_lock_irq(&intfdata->susp_lock); 1014 spin_lock_irq(&intfdata->susp_lock);
1015 b = intfdata->in_flight; 1015 b = intfdata->in_flight;
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index e4fad5e643d7..d555ca9567b8 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -651,7 +651,7 @@ int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
651 651
652 dbg("%s entered", __func__); 652 dbg("%s entered", __func__);
653 653
654 if (message.event & PM_EVENT_AUTO) { 654 if (PMSG_IS_AUTO(message)) {
655 spin_lock_irq(&intfdata->susp_lock); 655 spin_lock_irq(&intfdata->susp_lock);
656 b = intfdata->in_flight; 656 b = intfdata->in_flight;
657 spin_unlock_irq(&intfdata->susp_lock); 657 spin_unlock_irq(&intfdata->susp_lock);