PM question

Hi!

I have to quickly port NT driver to WDM. Since last two years I’m
working with streaming devices I’ve forgot too many details.
I’ve already implemented PM support; but I’m not sure I’ve done
all things right. So, the question:

Than I receive IRP_MN_SET_POWER for system power
I do the following:
a) Mark IRP pending and set completion routine
b) pass request down
Completion routine for S-IRP calls PoRequestPowerIrp for D-IRP
and returns STATUS_MORE_PROCESSING_REQUIRED;
D-Irp finalize routine completes S-Irp;

I’ve found that D-Irp processing is performed synchronously, i.e,
D-Irp finalize routine is executed before PoRequestPowerIrp returns;
and completes S-IRP request
Is it ok to return STATUS_MORE_PROCESSING_REQUIRED in this
case?

Thanks in advance.
Igor

Hi!
I would recommend to have a copy of Walter’s WDM book and open power
management chapter(6th I think). That will solve most of your problems.

Regards,
Dev

-----Original Message-----
From: Igor Slewsarev [mailto:xxxxx@yahoo.com]
Sent: Wednesday, April 21, 2004 3:47 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] PM question

Hi!

I have to quickly port NT driver to WDM. Since last two years I’m
working with streaming devices I’ve forgot too many details.
I’ve already implemented PM support; but I’m not sure I’ve done
all things right. So, the question:

Than I receive IRP_MN_SET_POWER for system power
I do the following:
a) Mark IRP pending and set completion routine
b) pass request down
Completion routine for S-IRP calls PoRequestPowerIrp for D-IRP
and returns STATUS_MORE_PROCESSING_REQUIRED;
D-Irp finalize routine completes S-Irp;

I’ve found that D-Irp processing is performed synchronously, i.e,
D-Irp finalize routine is executed before PoRequestPowerIrp returns;
and completes S-IRP request
Is it ok to return STATUS_MORE_PROCESSING_REQUIRED in this
case?

Thanks in advance.
Igor


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: dsingh@in.rainbow.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,
Returning STATUS_MORE_PROCESSING_REQUIRED is ok.

"I do the following:
a) Mark IRP pending and set completion routine
b) pass request down "
In case of Power_Down IRP, first perform your device specific operations
(may be storing some context information etc.) then only pass the IRP down,
else sometimes some devices may not work properly when returns to normal
mode from suspended mode(It once happen to me while working with a PCI board
around 2 years back). For Power_UP this is ok. Also you can pass all the
PIRP down if you don’t need them without setting any completion routine etc.

Regards,
Dev

-----Original Message-----
From: Dsingh@in.safenet-inc.com [mailto:Dsingh@in.safenet-inc.com]
Sent: Wednesday, April 21, 2004 3:53 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] PM question

Hi!
I would recommend to have a copy of Walter’s WDM book and open power
management chapter(6th I think). That will solve most of your problems.
Regards,
Dev
-----Original Message-----
From: Igor Slewsarev [mailto:xxxxx@yahoo.com]
Sent: Wednesday, April 21, 2004 3:47 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] PM question

Hi!
I have to quickly port NT driver to WDM. Since last two years I’m
working with streaming devices I’ve forgot too many details.
I’ve already implemented PM support; but I’m not sure I’ve done
all things right. So, the question:
Than I receive IRP_MN_SET_POWER for system power
I do the following:
a) Mark IRP pending and set completion routine
b) pass request down
Completion routine for S-IRP calls PoRequestPowerIrp for D-IRP
and returns STATUS_MORE_PROCESSING_REQUIRED;
D-Irp finalize routine completes S-Irp;
I’ve found that D-Irp processing is performed synchronously, i.e,
D-Irp finalize routine is executed before PoRequestPowerIrp returns;
and completes S-IRP request
Is it ok to return STATUS_MORE_PROCESSING_REQUIRED in this
case?
Thanks in advance.
Igor


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: dsingh@in.rainbow.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: dsingh@in.rainbow.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

RE: [ntdev] PM questionHi!

Yes, You are right returning STATUS_MORE_PROCESSING_REQUIRED
is safe, since in this case IopfCompleteRequest immediately returns. I’ve
just found this with S-ICE; and that’s exactly I’ve expected to heard.
So the only thing I have to rememeber is that I shouldn’t access any S-IRP
fields after PoRequestPowerIrp returns, since S-IRP could be already
deallocated. I’ve also find that PoRequestPowerIrp always returns
STATUS_PENDING (at least in w2ksp4) despite the result of PoCallDriver
call;

S.Y.
Igor.

Hi,
Returning STATUS_MORE_PROCESSING_REQUIRED is ok.

"I do the following:
a) Mark IRP pending and set completion routine
b) pass request down "
In case of Power_Down IRP, first perform your device specific operations
(may be storing some context information etc.) then only pass the IRP down,
else sometimes some devices may not work properly when returns to normal
mode from suspended mode(It once happen to me while working with a PCI
board
around 2 years back). For Power_UP this is ok. Also you can pass all the
PIRP down if you don’t need them without setting any completion routine
etc.

Regards,
Dev