From: roger.maps on
Hi and happy new year to everyone !

I have an unexpected behavior with my USB driver : when the device is
suspended and a stand by request is issued, sometimes the system
refuses to enter stand by mode, here are the steps:

[OS is WinXP SP2]
[Device is suspended (D2) thanks to
IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION IRP]
The user selects Start-> Shut down-> Stand by
1. Driver receives IRP_MN_QUERY_POWER (SystemPowerState = 4)
Completion routine is set, IRP is forwarded

2. IdleNotificationRequestComplete callback is called with
STATUS_CANCELLED
As WDK states, driver sends a device IRP_MN_SET_POWER IRP

3. Sometimes, when completion routine for 1. is called, the completion
status is set to 0xC0000001 and I guess that's why Windows pops a
message saying that the system cannot enter stand by because of this
device.

When this IRP is completed with success, the device returns to D0 then
D2 and the system enters stand by.

What sounds strange is that the device has to switch from D2 to D0 and
then to D2 again because the IdleNotificationRequestComplete is called.
Is this expected and why the bus driver is sometimes failing the first
IRP_MN_QUERY_POWER IRP ?

Any ideas ?
Thanks,
Roger

From: Doron Holan [MS] on
you must cancel the SS irp and move back into D0 and then Dx when you get a
IRP_MN_SET_POWER/SystemPowerState

d



--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


<roger.maps(a)tiscali.fr> wrote in message
news:1168347687.632784.20130(a)i15g2000cwa.googlegroups.com...
> Hi and happy new year to everyone !
>
> I have an unexpected behavior with my USB driver : when the device is
> suspended and a stand by request is issued, sometimes the system
> refuses to enter stand by mode, here are the steps:
>
> [OS is WinXP SP2]
> [Device is suspended (D2) thanks to
> IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION IRP]
> The user selects Start-> Shut down-> Stand by
> 1. Driver receives IRP_MN_QUERY_POWER (SystemPowerState = 4)
> Completion routine is set, IRP is forwarded
>
> 2. IdleNotificationRequestComplete callback is called with
> STATUS_CANCELLED
> As WDK states, driver sends a device IRP_MN_SET_POWER IRP
>
> 3. Sometimes, when completion routine for 1. is called, the completion
> status is set to 0xC0000001 and I guess that's why Windows pops a
> message saying that the system cannot enter stand by because of this
> device.
>
> When this IRP is completed with success, the device returns to D0 then
> D2 and the system enters stand by.
>
> What sounds strange is that the device has to switch from D2 to D0 and
> then to D2 again because the IdleNotificationRequestComplete is called.
> Is this expected and why the bus driver is sometimes failing the first
> IRP_MN_QUERY_POWER IRP ?
>
> Any ideas ?
> Thanks,
> Roger
>


From: roger.maps on
Hi Doron,

I did so, but the IRP_MN_SET_POWER/SystemPowerState is not received yet
when the bus driver fails the IRP_MN_QUERY_POWER.
I also tried to cancel the SS IRP before forwarding the
IRP_MN_QUERY_POWER : same result.
However, it seems that the system cancels this SS IRP by itself as the
SS completion routine IRP is always cancelled even not from the driver
(step 2).

Is it possible to know under which circonstances the bus driver may
fail this IRP_MN_QUERY_POWER IRP ?

Thanks,
Roger

Doron Holan [MS] a écrit :
> you must cancel the SS irp and move back into D0 and then Dx when you get a
> IRP_MN_SET_POWER/SystemPowerState
>
> d
>
>
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> <roger.maps(a)tiscali.fr> wrote in message
> news:1168347687.632784.20130(a)i15g2000cwa.googlegroups.com...
> > Hi and happy new year to everyone !
> >
> > I have an unexpected behavior with my USB driver : when the device is
> > suspended and a stand by request is issued, sometimes the system
> > refuses to enter stand by mode, here are the steps:
> >
> > [OS is WinXP SP2]
> > [Device is suspended (D2) thanks to
> > IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION IRP]
> > The user selects Start-> Shut down-> Stand by
> > 1. Driver receives IRP_MN_QUERY_POWER (SystemPowerState = 4)
> > Completion routine is set, IRP is forwarded
> >
> > 2. IdleNotificationRequestComplete callback is called with
> > STATUS_CANCELLED
> > As WDK states, driver sends a device IRP_MN_SET_POWER IRP
> >
> > 3. Sometimes, when completion routine for 1. is called, the completion
> > status is set to 0xC0000001 and I guess that's why Windows pops a
> > message saying that the system cannot enter stand by because of this
> > device.
> >
> > When this IRP is completed with success, the device returns to D0 then
> > D2 and the system enters stand by.
> >
> > What sounds strange is that the device has to switch from D2 to D0 and
> > then to D2 again because the IdleNotificationRequestComplete is called.
> > Is this expected and why the bus driver is sometimes failing the first
> > IRP_MN_QUERY_POWER IRP ?
> >
> > Any ideas ?
> > Thanks,
> > Roger
> >

From: Doron Holan [MS] on
i don't think the usb core cares about the query Sx irp with respect to SS

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


<roger.maps(a)tiscali.fr> wrote in message
news:1168423039.481384.129980(a)k58g2000hse.googlegroups.com...
Hi Doron,

I did so, but the IRP_MN_SET_POWER/SystemPowerState is not received yet
when the bus driver fails the IRP_MN_QUERY_POWER.
I also tried to cancel the SS IRP before forwarding the
IRP_MN_QUERY_POWER : same result.
However, it seems that the system cancels this SS IRP by itself as the
SS completion routine IRP is always cancelled even not from the driver
(step 2).

Is it possible to know under which circonstances the bus driver may
fail this IRP_MN_QUERY_POWER IRP ?

Thanks,
Roger

Doron Holan [MS] a �crit :
> you must cancel the SS irp and move back into D0 and then Dx when you get
> a
> IRP_MN_SET_POWER/SystemPowerState
>
> d
>
>
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> <roger.maps(a)tiscali.fr> wrote in message
> news:1168347687.632784.20130(a)i15g2000cwa.googlegroups.com...
> > Hi and happy new year to everyone !
> >
> > I have an unexpected behavior with my USB driver : when the device is
> > suspended and a stand by request is issued, sometimes the system
> > refuses to enter stand by mode, here are the steps:
> >
> > [OS is WinXP SP2]
> > [Device is suspended (D2) thanks to
> > IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION IRP]
> > The user selects Start-> Shut down-> Stand by
> > 1. Driver receives IRP_MN_QUERY_POWER (SystemPowerState = 4)
> > Completion routine is set, IRP is forwarded
> >
> > 2. IdleNotificationRequestComplete callback is called with
> > STATUS_CANCELLED
> > As WDK states, driver sends a device IRP_MN_SET_POWER IRP
> >
> > 3. Sometimes, when completion routine for 1. is called, the completion
> > status is set to 0xC0000001 and I guess that's why Windows pops a
> > message saying that the system cannot enter stand by because of this
> > device.
> >
> > When this IRP is completed with success, the device returns to D0 then
> > D2 and the system enters stand by.
> >
> > What sounds strange is that the device has to switch from D2 to D0 and
> > then to D2 again because the IdleNotificationRequestComplete is called.
> > Is this expected and why the bus driver is sometimes failing the first
> > IRP_MN_QUERY_POWER IRP ?
> >
> > Any ideas ?
> > Thanks,
> > Roger
> >