12.07.2015 Views

Link Power Management in USB 3.0 Hardware

Link Power Management in USB 3.0 Hardware

Link Power Management in USB 3.0 Hardware

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong><strong>3.0</strong> <strong>Hardware</strong>Common Problems <strong>in</strong> Implement<strong>in</strong>g U1 and U2StatesOctober 19, 2011AbstractThis paper provides <strong>in</strong>formation about certa<strong>in</strong> limitations of the Universal Serial Bus(<strong>USB</strong>) 2.0 Selective Suspend mechanism. It provides guidel<strong>in</strong>es for <strong>in</strong>dependenthardware vendors (IHVs) and orig<strong>in</strong>al equipment manufacturers (OEMs) toimplement power management for <strong>USB</strong> devices by us<strong>in</strong>g <strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong>(LPM) <strong>in</strong> conjunction with Selective Suspend. It also provides <strong>in</strong>formation aboutcommon pitfalls <strong>in</strong> LPM implementation <strong>in</strong> <strong>USB</strong> controllers, hubs, and devices.This paper assumes that the reader is familiar with:• The official <strong>USB</strong> <strong>3.0</strong> specification.• The <strong>USB</strong> Selective Suspend mechanism.The mechanism is described <strong>in</strong> the blog post, Demystify<strong>in</strong>g <strong>USB</strong> Selective Suspend.This <strong>in</strong>formation applies to the follow<strong>in</strong>g operat<strong>in</strong>g systems:The next version of W<strong>in</strong>dows® (code-named W<strong>in</strong>dows 8)The current version of this paper is ma<strong>in</strong>ta<strong>in</strong>ed on the web at:<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong> <strong>3.0</strong> <strong>Hardware</strong>Disclaimer: This document is provided “as-is”. Information and views expressed <strong>in</strong> this document, <strong>in</strong>clud<strong>in</strong>gURL and other Internet website references, may change without notice. Some <strong>in</strong>formation relates to prereleasedproduct which may be substantially modified before it’s commercially released. Microsoft makes nowarranties, express or implied, with respect to the <strong>in</strong>formation provided here. You bear the risk of us<strong>in</strong>g it.Some examples depicted here<strong>in</strong> are provided for illustration only and are fictitious. No real association orconnection is <strong>in</strong>tended or should be <strong>in</strong>ferred.This document does not provide you with any legal rights to any <strong>in</strong>tellectual property <strong>in</strong> any Microsoftproduct. You may copy and use this document for your <strong>in</strong>ternal, reference purposes.© 2011 Microsoft. All rights reserved.


<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong> <strong>3.0</strong> <strong>Hardware</strong> - 2ContentsDocument HistoryDateChangeOctober 19, 2011 First publicationIntroduction.................................................................................................................... 3Limitations of <strong>USB</strong> 2.0 Mechanism.............................................................................3<strong>USB</strong> <strong>3.0</strong> LPM Mechanism............................................................................................ 3What Is a <strong>L<strong>in</strong>k</strong>......................................................................................................... 3U States...................................................................................................................4Advantages of U1 and U2.......................................................................................4U1 and U2 Transitions.................................................................................................4Initial Setup by Software........................................................................................ 4<strong>Hardware</strong> Transitions............................................................................................. 5Common <strong>Hardware</strong> Problems with U1 or U2 Implementation..................................8Device-related Issues..............................................................................................8Hub or Controller-Related Issues........................................................................... 9Conclusion.................................................................................................................10Resources...................................................................................................................... 10October 19, 2011© 2011 Microsoft. All rights reserved.


<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong> <strong>3.0</strong> <strong>Hardware</strong> - 4U StatesAs per the <strong>USB</strong> 2.0 specification, a l<strong>in</strong>k enters a low power state (consum<strong>in</strong>g lesspower than the work<strong>in</strong>g state) only when the downstream device enters thesuspended state through the Selective Suspend mechanism. The <strong>USB</strong> <strong>3.0</strong> specificationdecouples l<strong>in</strong>k power states from device power states. The specification def<strong>in</strong>es theLPM feature (see Section C.1 <strong>in</strong> the specification) that refers to power managementof physical and logical layers of a pair of ports that constitute a l<strong>in</strong>k. The specificationdef<strong>in</strong>es four l<strong>in</strong>k power states known as U states, from U0 to U3. An active l<strong>in</strong>k is <strong>in</strong>state U0. After rema<strong>in</strong><strong>in</strong>g idle for a certa<strong>in</strong> period of time, l<strong>in</strong>k partners progressivelyenter U1 (standby with fast exit) and then U2 (standby with slower exit). After theyare idle for sufficient time, software <strong>in</strong>itiates the transition to U3 by send<strong>in</strong>g acommand to the DS port l<strong>in</strong>k partner. The steps that are required by software, tosend the l<strong>in</strong>k to U3, are identical to the steps required for <strong>USB</strong> 2.0 Selective suspend.The device must enter the suspended state when the l<strong>in</strong>k enters U3. As a result, thedevice is subject to similar restrictions as with <strong>USB</strong> 2.0 Selective Suspend. Toovercome those limitations, the <strong>USB</strong> <strong>3.0</strong> specification def<strong>in</strong>es U1 and U2 states.Advantages of U1 and U2U1 and U2 states are designed to complement Selective Suspend, which can lead tosignificant power sav<strong>in</strong>gs. After the software configures the l<strong>in</strong>k partners for U1 or U2transition, the hardware enters the states autonomously without any software<strong>in</strong>tervention. The exit times from U1 and U2 are really fast (from microseconds to afew milliseconds) and have less of an impact on the performance of the devices. Thisallows for much better power management where l<strong>in</strong>ks can enter and exit thesestates even when the device is <strong>in</strong> use. For example, a device with isochronousendpo<strong>in</strong>ts can put the l<strong>in</strong>k to U1 or U2 between service <strong>in</strong>tervals. To save somepower, when the device is idle, it can send its upstream l<strong>in</strong>k to those states evenbefore Selective Suspend gets <strong>in</strong>voked. There are no restrictions on how much powerthe device can draw when the l<strong>in</strong>k is <strong>in</strong> U1 or U2. A device could rema<strong>in</strong> fully poweredwhen the l<strong>in</strong>k is <strong>in</strong> U1 or U2. Therefore, unlike Selective Suspend, a device can sendits l<strong>in</strong>k to U1 or U2 without los<strong>in</strong>g any capabilities.U1 and U2 TransitionsThis section first describes the <strong>in</strong>itial setup that is done by the software to enable U1and U2 transitions and then describes how these transitions occur <strong>in</strong> the hardware.Initial Setup by SoftwareIn order for U1 or U2 transitions to occur, software performs the follow<strong>in</strong>g stepsdur<strong>in</strong>g the enumeration of a device.1. Software exchanges U1 or U2 exit latency <strong>in</strong>formation with the device dur<strong>in</strong>g theenumeration process. As the first part of this exchange, the device-specificlatencies are filled <strong>in</strong> by the device <strong>in</strong> bU1DevExitLat and wU2DevExitLat fields ofthe SuperSpeed <strong>USB</strong> device capability (def<strong>in</strong>ed <strong>in</strong> Section 9.6.2.2 of the <strong>USB</strong> <strong>3.0</strong>specification). As the second part of the exchange, the host <strong>in</strong>forms the deviceabout overall exit latencies for the device by send<strong>in</strong>g a SET_SEL control transfer,as per section 9.4.12 of the <strong>USB</strong> <strong>3.0</strong> specification. The latency <strong>in</strong>formation<strong>in</strong>cludes the latencies that are associated with upstream l<strong>in</strong>ks and controller.October 19, 2011© 2011 Microsoft. All rights reserved.


<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong> <strong>3.0</strong> <strong>Hardware</strong> - 8to <strong>in</strong>itiate transfers with other endpo<strong>in</strong>ts. In parallel, the hub <strong>in</strong>itiates a U0 transitionon the l<strong>in</strong>k and then <strong>in</strong>forms the device about the deferred packet. The device thensends ERDY to the host to <strong>in</strong>dicate that the device is now ready for the transfer. Thehost can then reschedule the transfer to the device.An important responsibility of the device is that after send<strong>in</strong>g ERDY, the device isresponsible for keep<strong>in</strong>g the l<strong>in</strong>k <strong>in</strong> U0 until the host sends a response to ERDY or untilthe tERDYTimeout (500 milliseconds) time elapses. Dur<strong>in</strong>g that time, the device mustnot <strong>in</strong>itiate a U1 or U2 transition and should also reject any transition <strong>in</strong>itiated by itsl<strong>in</strong>k partner.Common <strong>Hardware</strong> Problems with U1 or U2 ImplementationLPM can significantly save power and lead to longer battery life. Therefore, it isimperative that both software and hardware should support LPM to its fullest extent.However, some of the early prototypes of <strong>USB</strong> <strong>3.0</strong> hardware have common problems<strong>in</strong> the LPM implementation that can lead to poor end-user experience. The purposeof this section is to identify those problems.Device-related IssuesNo support for U1 or U2Some devices never <strong>in</strong>itiate U1 and U2 transitions and always reject transitions thatare <strong>in</strong>itiated by the host, even though there are no transfers for a long time and theperformance effect of LPM is not likely to be significant. Those devices not onlyprevent power sav<strong>in</strong>gs for their l<strong>in</strong>k but also prevent any upstream l<strong>in</strong>ks fromenter<strong>in</strong>g U1 or U2.Incorrect deferred packet implementationAs described <strong>in</strong> the Packet Deferr<strong>in</strong>g section, after a device has sent ERDY, the devicemust keep the l<strong>in</strong>k <strong>in</strong> U0 until the host sends a response to ERDY or tERDYTimeoutoccurs. Some devices fail to send ERDY after gett<strong>in</strong>g a deferred packet notification.This can lead to a problematic situation where a transfer never completes.Failure to send P<strong>in</strong>g.LPFS <strong>in</strong> U1The US port of the device should keep send<strong>in</strong>g P<strong>in</strong>g.LPFS when the l<strong>in</strong>k is <strong>in</strong> U1. Somedevices fail to do that, which causes the l<strong>in</strong>k partner to assume that the device hasbeen removed. That can cause the l<strong>in</strong>k to enter an error state and can cause reenumerationof the device.Failure of SET_SEL transferThe software sends a SET_SEL control transfer to <strong>in</strong>form the device about the variousexit latencies from U1 and U2. Some devices stall that transfer. That can lead toenumeration failure or can lead to software not enabl<strong>in</strong>g U1 or U2 for the device.Failure of SET_FEATURE (U1_ENABLE or U2_ENABLE) transferThe software enables or disables the ability of the device to <strong>in</strong>itiate a U1 or U2transition by send<strong>in</strong>g a SET_FEATURE control transfer. Some devices stall thattransfer. This can lead to enumeration failure or the software not enabl<strong>in</strong>g U1 or U2for the device.October 19, 2011© 2011 Microsoft. All rights reserved.


<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong> <strong>3.0</strong> <strong>Hardware</strong> - 9Hub or Controller-Related IssuesNo support of U1 or U2 timersOne of the most common problems with LPM implementation is the failure to <strong>in</strong>itiateU1 or U2 transition when the timer expires. Even after the software has programmedU1 or U2 timeout values for DS ports, some hubs or controllers do not <strong>in</strong>itiate atransition to U1 or U2 on the expiration of the timer. This behavior prevents powersav<strong>in</strong>gs through LPM.Hard-coded U1 or U2 time-out valuesSome host controllers support U1 and U2 transitions but have a hard-coded time-outvalue. Before this time-out, they do not <strong>in</strong>itiate these transitions and rejecttransitions <strong>in</strong>itiated by the l<strong>in</strong>k partner. This behavior results <strong>in</strong> missed opportunitiesfor U1 and U2 transitions and thus can prevent some power sav<strong>in</strong>gs.Incorrect implementation of deferred packetAs described <strong>in</strong> the Packet Deferr<strong>in</strong>g section, hubs are responsible for send<strong>in</strong>g thedeferred bit packet header back to the host that must process the packet, similar to aNRDY notification from the device. Some hubs fail to send the deferred packet to thehost or the device. Some hosts do not correctly process the deferred bit packet or resendthe transfer when the device ultimately sends ERDY. This leads to transferfailures and unreliable behavior.Not send<strong>in</strong>g upstream port to U2 when no device connectedSome hubs fail to <strong>in</strong>itiate a U1 or U2 transition for the US port when there are nodownstream devices connected. Some hubs send the l<strong>in</strong>k to U1 but do not send to U2<strong>in</strong> this scenario. This issue has been observed <strong>in</strong> many of the current shipp<strong>in</strong>gimplementations of <strong>USB</strong> <strong>3.0</strong> hardware, as of the release date of this paper. Thisbehavior prevents optimum power sav<strong>in</strong>gs.Not transition<strong>in</strong>g the US port from U1 to U2Some hubs fail to transition the US port from U1 to U0 to U2 when the hub’s DS portstransition from U1 to U2 or a lower state. That occurs if the <strong>in</strong>activity timer of the DSport to which the hub is connected is set to 0xFF. This behavior prevents optimumpower sav<strong>in</strong>gs.Transition from U1/U2 to U3If a DS port of a hub or controller is <strong>in</strong> U1 or U2 and the software <strong>in</strong>itiates a U3transition on the port, the parent hub or controller is responsible for firsttransition<strong>in</strong>g the l<strong>in</strong>k to U0 and then to U3. Some hubs and controllers do not handlethat requirement properly. This can cause the l<strong>in</strong>k to enter an error state and cancause re-enumeration of the device.October 19, 2011© 2011 Microsoft. All rights reserved.


<strong>L<strong>in</strong>k</strong> <strong>Power</strong> <strong>Management</strong> <strong>in</strong> <strong>USB</strong> <strong>3.0</strong> <strong>Hardware</strong> - 10ConclusionResourcesIn this paper, we have discussed the LPM mechanism for sav<strong>in</strong>g power and describedvarious common problems seen <strong>in</strong> current <strong>USB</strong> <strong>3.0</strong> hardware. <strong>USB</strong>-IF certificationrequires that devices, hubs, and controllers implement U1 and U2 correctly. Thecertification aims at enforc<strong>in</strong>g that requirement through compliance tests. TheMicrosoft <strong>USB</strong> driver stack (<strong>in</strong>cluded with the next version of W<strong>in</strong>dows®, code-namedW<strong>in</strong>dows 8) takes full advantage of the U1 and U2 mechanism to achieve maximumpower sav<strong>in</strong>gs. Therefore problems such as those described <strong>in</strong> this document will beseen more frequently. Those problems can lead to poor user experience and mightprevent W<strong>in</strong>dows from achiev<strong>in</strong>g the power sav<strong>in</strong>gs offered by the <strong>USB</strong> <strong>3.0</strong>specification.<strong>Hardware</strong> vendors must take steps to avoid the issues that are described <strong>in</strong> thisdocument. For currently released hardware with problems, vendors should releaseupdated firmware with fixes as soon as possible and must work with their partners toensure that the updates are provided to end customers.The follow<strong>in</strong>g list conta<strong>in</strong>s l<strong>in</strong>ks to documents that conta<strong>in</strong> related <strong>in</strong>formation.<strong>USB</strong> <strong>3.0</strong> Specificationhttp://go.microsoft.com/fwl<strong>in</strong>k/?l<strong>in</strong>kid=230961<strong>USB</strong> Selective Suspendhttp://go.microsoft.com/fwl<strong>in</strong>k/?l<strong>in</strong>kid=230964Demystify<strong>in</strong>g <strong>USB</strong> Selective Suspendhttp://go.microsoft.com/fwl<strong>in</strong>k/?l<strong>in</strong>kid=230962October 19, 2011© 2011 Microsoft. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!