aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-07-03 10:17:54 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-08-15 13:52:33 -0400
commit98a4f1ff7bea8002ab79d6776e30d27932e88244 (patch)
tree4f8b6a6273cab2f53cd0903717f28b6b5f4e27b0 /drivers/usb/core/hub.c
parentaa5ceae24bf8dff1d6fe87c6c4b08e69c6d33550 (diff)
usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend()
The pm qos NO_POWER_OFF flag is checked twice during usb device suspend to see if the usb port power off condition is met. This is redundant and also will prevent the port from being powered off if the NO_POWER_OFF flag is changed to 1 from 0 after the device was already suspended. More detail in the following link. http://marc.info/?l=linux-usb&m=136543949130865&w=2 This patch should be backported to kernels as old as 3.7, that contain the commit f7ac7787ad361e31a7972e2854ed8dc2eedfac3b "usb/acpi: Use ACPI methods to power off ports." Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 8287953e066c..17c3785241a4 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -3043,19 +3043,9 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
3043 usb_set_device_state(udev, USB_STATE_SUSPENDED); 3043 usb_set_device_state(udev, USB_STATE_SUSPENDED);
3044 } 3044 }
3045 3045
3046 /*
3047 * Check whether current status meets the requirement of
3048 * usb port power off mechanism
3049 */
3050 if (status == 0 && !udev->do_remote_wakeup && udev->persist_enabled) { 3046 if (status == 0 && !udev->do_remote_wakeup && udev->persist_enabled) {
3051 enum pm_qos_flags_status pm_qos_stat; 3047 pm_runtime_put_sync(&port_dev->dev);
3052 3048 port_dev->did_runtime_put = true;
3053 pm_qos_stat = dev_pm_qos_flags(&port_dev->dev,
3054 PM_QOS_FLAG_NO_POWER_OFF);
3055 if (pm_qos_stat != PM_QOS_FLAGS_ALL) {
3056 pm_runtime_put_sync(&port_dev->dev);
3057 port_dev->did_runtime_put = true;
3058 }
3059 } 3049 }
3060 3050
3061 usb_mark_last_busy(hub->hdev); 3051 usb_mark_last_busy(hub->hdev);