aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2014-01-17 17:15:44 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2014-03-04 18:38:00 -0500
commit25cd2882e2fc8bd8ed7acaee0ec979f11feda6d7 (patch)
tree212dd9b5aa676bb86a7f876c937a3266df6fe0e1 /drivers/usb/core
parent3c1b2c3ecd3122fe6dded7b012f74021144d95b2 (diff)
usb/xhci: Change how we indicate a host supports Link PM.
The xHCI driver currently uses a USB core internal field, udev->lpm_capable, to indicate the xHCI driver knows how to calculate the LPM timeout values. If this value is set for the host controller udev, it means Link PM can be enabled for child devices under that host. Change the code so the xHCI driver isn't mucking with USB core internal fields. Instead, indicate the xHCI driver doesn't support Link PM on this host by clearing the U1 and U2 exit latencies in the roothub SuperSpeed Extended Capabilities BOS descriptor. The code to check for the roothub setting U1 and U2 exit latencies to zero will also disable LPM for external devices that do that same. This was already effectively done with commit ae8963adb4ad8c5f2a89ca1d99fb7bb721e7599f "usb: Don't enable LPM if the exit latency is zero." Leave that code in place, so that if a device sets one exit latency value to zero, but the other is set to a valid value, LPM is only enabled for the U1 or U2 state that had the valid value. This is the same behavior the code had before. Also, change messages about missing Link PM information from warning level to info level. Only print a warning about the first device that doesn't support LPM, to avoid log spam. Further, cleanup some unnecessary line breaks to help people to grep for the error messages. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hub.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index f6c6b6f7cc9c..763c3134dd78 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -141,19 +141,27 @@ static int usb_device_supports_lpm(struct usb_device *udev)
141 return 0; 141 return 0;
142 } 142 }
143 143
144 /* All USB 3.0 must support LPM, but we need their max exit latency 144 /*
145 * information from the SuperSpeed Extended Capabilities BOS descriptor. 145 * According to the USB 3.0 spec, all USB 3.0 devices must support LPM.
146 * However, there are some that don't, and they set the U1/U2 exit
147 * latencies to zero.
146 */ 148 */
147 if (!udev->bos->ss_cap) { 149 if (!udev->bos->ss_cap) {
148 dev_warn(&udev->dev, "No LPM exit latency info found. " 150 dev_info(&udev->dev, "No LPM exit latency info found, disabling LPM.\n");
149 "Power management will be impacted.\n");
150 return 0; 151 return 0;
151 } 152 }
152 if (udev->parent->lpm_capable)
153 return 1;
154 153
155 dev_warn(&udev->dev, "Parent hub missing LPM exit latency info. " 154 if (udev->bos->ss_cap->bU1devExitLat == 0 &&
156 "Power management will be impacted.\n"); 155 udev->bos->ss_cap->bU2DevExitLat == 0) {
156 if (udev->parent)
157 dev_info(&udev->dev, "LPM exit latency is zeroed, disabling LPM.\n");
158 else
159 dev_info(&udev->dev, "We don't know the algorithms for LPM for this host, disabling LPM.\n");
160 return 0;
161 }
162
163 if (!udev->parent || udev->parent->lpm_capable)
164 return 1;
157 return 0; 165 return 0;
158} 166}
159 167