Supporting D2 and D3 with one power state

Hi,
I have a usb device with selective suspend capability and remote wakeup
capabilities of one low power state, which is currently D2. My device also
need to support D3. Do I have to define another low power state? As per
MS, device in D3 should not have remote wakeup capability. For umdf
device, how do we report power capabilites? For kmdf we can report through
irp. In umdf device properties, power capabilities are reported. Not how
these are reported? Is it bus power capabilities?
Thanks, Krishna.

Thanks

s.v.krishna reddy wrote:

I have a usb device with selective suspend capability and remote
wakeup capabilities of one low power state, which is currently D2. My
device also need to support D3. Do I have to define another low power
state? As per MS, device in D3 should not have remote wakeup
capability. For umdf device, how do we report power capabilites? For
kmdf we can report through irp. In umdf device properties, power
capabilities are reported. Not how these are reported? Is it bus
power capabilities?

We just had a conversation about this not long ago.

One thing you need to do is separate the concept of a Windows driver
power state and a USB device power state, because they are almost
completely unrelated. D2 and D3 are Windows software concepts. When
your driver goes idle, your driver will drop below D0 (usually to D2),
and your device will go into selective suspend.

Why do you think you need to advertise D3? There’s no real point.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

In UMDF this is pretty simple. When you want to go to D2 with selective suspend, call AssignS0IdleSettings with D2 and SS enabled. To then shift to idling to D3, calling AssignS0IdleSettings again saying your idle state should be D3 off (no wake)

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, September 10, 2014 12:14 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Supporting D2 and D3 with one power state

s.v.krishna reddy wrote:

I have a usb device with selective suspend capability and remote
wakeup capabilities of one low power state, which is currently D2. My
device also need to support D3. Do I have to define another low power
state? As per MS, device in D3 should not have remote wakeup
capability. For umdf device, how do we report power capabilites? For
kmdf we can report through irp. In umdf device properties, power
capabilities are reported. Not how these are reported? Is it bus
power capabilities?

We just had a conversation about this not long ago.

One thing you need to do is separate the concept of a Windows driver power state and a USB device power state, because they are almost completely unrelated. D2 and D3 are Windows software concepts. When your driver goes idle, your driver will drop below D0 (usually to D2), and your device will go into selective suspend.

Why do you think you need to advertise D3? There’s no real point.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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

I’m trying to understand the relation. When I made the driver PPO, and
assign idle settings with selective suspend and power device max , it goes
to D2. That may probably be because of device power capabilities. But how
do I assign power capabilities to umdf device?
On 11 Sep 2014 00:45, “Tim Roberts” wrote:

> s.v.krishna reddy wrote:
> >
> > I have a usb device with selective suspend capability and remote
> > wakeup capabilities of one low power state, which is currently D2. My
> > device also need to support D3. Do I have to define another low power
> > state? As per MS, device in D3 should not have remote wakeup
> > capability. For umdf device, how do we report power capabilites? For
> > kmdf we can report through irp. In umdf device properties, power
> > capabilities are reported. Not how these are reported? Is it bus
> > power capabilities?
> >
>
> We just had a conversation about this not long ago.
>
> One thing you need to do is separate the concept of a Windows driver
> power state and a USB device power state, because they are almost
> completely unrelated. D2 and D3 are Windows software concepts. When
> your driver goes idle, your driver will drop below D0 (usually to D2),
> and your device will go into selective suspend.
>
> Why do you think you need to advertise D3? There’s no real point.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>

What is the behaviour if powerdevicemax is specified in assignidlesettings
instead of D2 or D3.
Thanks,
Krishna.
On 11 Sep 2014 01:00, “Doron Holan” wrote:

> In UMDF this is pretty simple. When you want to go to D2 with selective
> suspend, call AssignS0IdleSettings with D2 and SS enabled. To then shift to
> idling to D3, calling AssignS0IdleSettings again saying your idle state
> should be D3 off (no wake)
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Tim Roberts
> Sent: Wednesday, September 10, 2014 12:14 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Supporting D2 and D3 with one power state
>
> s.v.krishna reddy wrote:
> >
> > I have a usb device with selective suspend capability and remote
> > wakeup capabilities of one low power state, which is currently D2. My
> > device also need to support D3. Do I have to define another low power
> > state? As per MS, device in D3 should not have remote wakeup
> > capability. For umdf device, how do we report power capabilites? For
> > kmdf we can report through irp. In umdf device properties, power
> > capabilities are reported. Not how these are reported? Is it bus
> > power capabilities?
> >
>
> We just had a conversation about this not long ago.
>
> One thing you need to do is separate the concept of a Windows driver power
> state and a USB device power state, because they are almost completely
> unrelated. D2 and D3 are Windows software concepts. When your driver goes
> idle, your driver will drop below D0 (usually to D2), and your device will
> go into selective suspend.
>
> Why do you think you need to advertise D3? There’s no real point.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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

You are overly focusing on the wrong thing. Every device is capable of D3. D3 is off. D2 in usb has a special software only meaning in that it is SS capable. Furthermore, the power caps of a device are what the PDO reports. You can’t make the caps deeper or report more supported things that what the PDO reports, you can only lighten the caps.

you don’t need to assign power caps to the umdf device. You need to apply idle policy. Most drivers apply idle policy once. It sounds like in your case you want to change the policy at runtime (that is fine)

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of s.v.krishna reddy
Sent: Wednesday, September 10, 2014 7:04 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Supporting D2 and D3 with one power state

I’m trying to understand the relation. When I made the driver PPO, and assign idle settings with selective suspend and power device max , it goes to D2. That may probably be because of device power capabilities. But how do I assign power capabilities to umdf device?
On 11 Sep 2014 00:45, “Tim Roberts” > wrote:
s.v.krishna reddy wrote:
>
> I have a usb device with selective suspend capability and remote
> wakeup capabilities of one low power state, which is currently D2. My
> device also need to support D3. Do I have to define another low power
> state? As per MS, device in D3 should not have remote wakeup
> capability. For umdf device, how do we report power capabilites? For
> kmdf we can report through irp. In umdf device properties, power
> capabilities are reported. Not how these are reported? Is it bus
> power capabilities?
>

We just had a conversation about this not long ago.

One thing you need to do is separate the concept of a Windows driver
power state and a USB device power state, because they are almost
completely unrelated. D2 and D3 are Windows software concepts. When
your driver goes idle, your driver will drop below D0 (usually to D2),
and your device will go into selective suspend.

Why do you think you need to advertise D3? There’s no real point.


Tim Roberts, xxxxx@probo.commailto:xxxxx
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

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 Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See http://www.osr.com/careers 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>

wrong thing may be moving to D2 and D3 dynamically. D3 in this case I mean
D3 hot. why does a device does not enter D3 hot on idle, when I set below
policy setting.

hr = pDevice->m_FxDevice->AssignS0IdleSettings(IdleUsbSelectiveSuspend,
PowerDeviceMaximum,
5000,
IdleAllowUserControl,
WdfTrue);

PDO reports 0x0000007f capability

Device does go to D3 on idle, when I define below policy setting.

hr = pDevice->m_FxDevice->AssignS0IdleSettings(IdleUsbSelectiveSuspend,
PowerDeviceD3,
5000,
IdleAllowUserControl,
WdfTrue);

in my opinion frameworks should send it to D3 hot with PowerDeviceMaximum,
if device has 0x7f power capability.

>Furthermore, the power caps of a device are what the PDO reports. You
can’t make the caps deeper or report more supported things that what the
PDO reports, you can only lighten the caps.

I do see root hub with 5D cap, and it non composite child devices with 7f
cap, composite device with 1D cap, I do see those composite device has
Kernel driver. is it that UMDF can not alter cap?

Thanks,

Krishna,
On 11 Sep 2014 09:07, “Doron Holan” wrote:

> You are overly focusing on the wrong thing. Every device is capable of
> D3. D3 is off. D2 in usb has a special software only meaning in that it is
> SS capable. Furthermore, the power caps of a device are what the PDO
> reports. You can’t make the caps deeper or report more supported things
> that what the PDO reports, you can only lighten the caps.
>
>
>
> you don’t need to assign power caps to the umdf device. You need to apply
> idle policy. Most drivers apply idle policy once. It sounds like in your
> case you want to change the policy at runtime (that is fine)
>
>
>
> d
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *s.v.krishna reddy
> Sent: Wednesday, September 10, 2014 7:04 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Supporting D2 and D3 with one power state
>
>
>
> I’m trying to understand the relation. When I made the driver PPO, and
> assign idle settings with selective suspend and power device max , it goes
> to D2. That may probably be because of device power capabilities. But how
> do I assign power capabilities to umdf device?
>
> On 11 Sep 2014 00:45, “Tim Roberts” wrote:
>
> s.v.krishna reddy wrote:
> >
> > I have a usb device with selective suspend capability and remote
> > wakeup capabilities of one low power state, which is currently D2. My
> > device also need to support D3. Do I have to define another low power
> > state? As per MS, device in D3 should not have remote wakeup
> > capability. For umdf device, how do we report power capabilites? For
> > kmdf we can report through irp. In umdf device properties, power
> > capabilities are reported. Not how these are reported? Is it bus
> > power capabilities?
> >
>
> We just had a conversation about this not long ago.
>
> One thing you need to do is separate the concept of a Windows driver
> power state and a USB device power state, because they are almost
> completely unrelated. D2 and D3 are Windows software concepts. When
> your driver goes idle, your driver will drop below D0 (usually to D2),
> and your device will go into selective suspend.
>
> Why do you think you need to advertise D3? There’s no real point.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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 Visit the list at:
> http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
> http://www.osr.com/careers 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
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
>

s.v.krishna reddy wrote:

wrong thing may be moving to D2 and D3 dynamically. D3 in this case I
mean D3 hot. why does a device does not enter D3 hot on idle, when I
set below policy setting.

hr = pDevice->m_FxDevice->AssignS0IdleSettings(IdleUsbSelectiveSuspend,
PowerDeviceMaximum,
5000,
IdleAllowUserControl,
WdfTrue);

PDO reports 0x0000007f capability

Did you read the documentation for AssignS0IdleSettings?

If you specify *PowerDeviceMaximum*, the framework uses the value
that the kernel-mode driver for the device’s bus supplied in the
*DeviceWake* member of its *WDF_DEVICE_POWER_CAPABILITIES*
http:
structure.

0x7f means the hardware cannot wake from D3. That’s why it chooses D2.
If the hardware reported 0xff, then it would have chosen D3.

> in my opinion frameworks should send it to D3 hot with
> PowerDeviceMaximum, if device has 0x7f power capability.

That may be your opinion, but that’s not what the documentation says.

In the case of USB, it doesn’t make any difference anyway. A USB device
cannot go into D3hot unless the entire system is going to S3.

> I do see root hub with 5D cap, and it non composite child devices
> with 7f cap, composite device with 1D cap, I do see those composite
> device has Kernel driver. is it that UMDF can not alter cap?

Right. You can’t alter the PDO’s caps.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.</http:>

Thanks.I do understand that 7f does not have d3 wakeup capability. On the
other hand, I’m seeing UMDF devices which is going to D3 and waking up with
1D and 7D cap. I do not understand, how is it possible?

Thanks,

Krishna.
On 11 Sep 2014 22:04, “Tim Roberts” wrote:

> s.v.krishna reddy wrote:
>
> wrong thing may be moving to D2 and D3 dynamically. D3 in this case I
> mean D3 hot. why does a device does not enter D3 hot on idle, when I set
> below policy setting.
>
> hr = pDevice->m_FxDevice->AssignS0IdleSettings(IdleUsbSelectiveSuspend,
> PowerDeviceMaximum,
> 5000,
> IdleAllowUserControl,
> WdfTrue);
>
> PDO reports 0x0000007f capability
>
>
> Did you read the documentation for AssignS0IdleSettings?
>
> If you specify PowerDeviceMaximum, the framework uses the value that
> the kernel-mode driver for the device’s bus supplied in the DeviceWake
> member of its WDF_DEVICE_POWER_CAPABILITIES
> http:
> structure.
>
> 0x7f means the hardware cannot wake from D3. That’s why it chooses D2.
> If the hardware reported 0xff, then it would have chosen D3.
>
>
> in my opinion frameworks should send it to D3 hot with
> PowerDeviceMaximum, if device has 0x7f power capability.
>
>
> That may be your opinion, but that’s not what the documentation says.
>
> In the case of USB, it doesn’t make any difference anyway. A USB device
> cannot go into D3hot unless the entire system is going to S3.
>
>
> I do see root hub with 5D cap, and it non composite child devices with
> 7f cap, composite device with 1D cap, I do see those composite device has
> Kernel driver. is it that UMDF can not alter cap?
>
>
> Right. You can’t alter the PDO’s caps.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> 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
></http:>

s.v.krishna reddy wrote:

Thanks.I do understand that 7f does not have d3 wakeup capability.

Yes. You’re talking about the flags in the Device Manager “Power data”
list, right? It shows you the expansion of those bits immediately below
the raw value:

Power capabilities:
000000FF
PDCAP_D0_SUPPORTED
PDCAP_D1_SUPPORTED
PDCAP_D2_SUPPORTED
PDCAP_D3_SUPPORTED
PDCAP_WAKE_FROM_D0_SUPPORTED
PDCAP_WAKE_FROM_D1_SUPPORTED
PDCAP_WAKE_FROM_D2_SUPPORTED
PDCAP_WAKE_FROM_D3_SUPPORTED

If you look up the PDCAP values, you’ll find this page:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa372681.aspx

On the other hand, I’m seeing UMDF devices which is going to D3 and
waking up with 1D and 7D cap. I do not understand, how is it possible?

Do you understand what those values mean? “Wake from D3” means that the
device has the ability to force the system to wake up while it is in D3
state. Are you saying you have UMDF-driven device that can force the
system to wake up?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.