Windows Power Management in USB device

Hi All,

I have some doubts in power management.

Windows Manages System power states as S0 - S5 and device Power states D0 -
D3. When system makes the transition from S0 to (S1, S2,… S5) which
happens system is idle or moving Shutdown/Hibernate/Restart. It sends power
IRPs down the stack to make device to switch corresponding mapping states(
D0 to D3).

What about when device remains IDLE for some time??

Is it like bus detects the inactivity on device and inform the power
manager to initiate power state transition for device and Power start
sending the IRPs down the stack? Just like it do in case of device
connection by calling *IoInvalidateDeviceRelations* and PnP IRPs follows
down the stack to enumerate the device?

Thanks
Sunil

The function driver decides when the device is idle and when to power it down while the system is running.

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sunil Kumar
Sent: Friday, May 18, 2012 10:28 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Windows Power Management in USB device

Hi All,

I have some doubts in power management.

Windows Manages System power states as S0 - S5 and device Power states D0 - D3. When system makes the transition from S0 to (S1, S2,… S5) which happens system is idle or moving Shutdown/Hibernate/Restart. It sends power IRPs down the stack to make device to switch corresponding mapping states( D0 to D3).

What about when device remains IDLE for some time??

Is it like bus detects the inactivity on device and inform the power manager to initiate power state transition for device and Power start sending the IRPs down the stack? Just like it do in case of device connection by calling IoInvalidateDeviceRelations and PnP IRPs follows down the stack to enumerate the device?

Thanks
Sunil — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks Doron,

But how function driver come to know about it? It has to be informed by
somebody?

Or it is internal logic that it did not perform any transaction for some
quantum so let the device change the state??

Bus driver and Power Manager has any rol to play here??

Thanks
Sunil

------kumarsunilsan------

On Sat, May 19, 2012 at 11:16 AM, Doron Holan wrote:

> The function driver decides when the device is idle and when to power it
> down while the system is running.
>
>

>
> d

>
> ****
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Sunil Kumar
> Sent: Friday, May 18, 2012 10:28 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Windows Power Management in USB device
>
>

>
> Hi All,
>
> I have some doubts in power management.
>
> Windows Manages System power states as S0 - S5 and device Power states D0
> - D3. When system makes the transition from S0 to (S1, S2,… S5) which
> happens system is idle or moving Shutdown/Hibernate/Restart. It sends power
> IRPs down the stack to make device to switch corresponding mapping states(
> D0 to D3).
>
> What about when device remains IDLE for some time??
>
> Is it like bus detects the inactivity on device and inform the power
> manager to initiate power state transition for device and Power start
> sending the IRPs down the stack? Just like it do in case of device
> connection by calling IoInvalidateDeviceRelations and PnP IRPs follows
> down the stack to enumerate the device?
>
> Thanks
> Sunil — NTDEV is sponsored by OSR For our schedule of WDF, WDM,
> debugging and other seminars visit: http://www.osr.com/seminars To
> unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

This is called selective suspend. The function driver is the only that knows when the device is idle and what idle means. Do not confuse software idle with bus link power management (LPM). They are two different things

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Sunil Kumar
Sent: Friday, May 18, 2012 11:00 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Windows Power Management in USB device

Thanks Doron,

But how function driver come to know about it? It has to be informed by somebody?

Or it is internal logic that it did not perform any transaction for some quantum so let the device change the state??

Bus driver and Power Manager has any rol to play here??

Thanks
Sunil

------kumarsunilsan------

On Sat, May 19, 2012 at 11:16 AM, Doron Holan > wrote:
The function driver decides when the device is idle and when to power it down while the system is running.

d

From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Sunil Kumar
Sent: Friday, May 18, 2012 10:28 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Windows Power Management in USB device

Hi All,

I have some doubts in power management.

Windows Manages System power states as S0 - S5 and device Power states D0 - D3. When system makes the transition from S0 to (S1, S2,… S5) which happens system is idle or moving Shutdown/Hibernate/Restart. It sends power IRPs down the stack to make device to switch corresponding mapping states( D0 to D3).

What about when device remains IDLE for some time??

Is it like bus detects the inactivity on device and inform the power manager to initiate power state transition for device and Power start sending the IRPs down the stack? Just like it do in case of device connection by calling IoInvalidateDeviceRelations and PnP IRPs follows down the stack to enumerate the device?

Thanks
Sunil — NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

>Is it like bus detects the inactivity on device

No. Not the bus, but the device’s PPO.

The PPO logic has 2 inputs:

  • system power IRPs
  • idle detection logic

The result of the PPO decisions is PoRequestPowerIrp.

IoInvalidateDeviceRelations

This has nothing to do with power transitions.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com