Hi,
We are writing a driver to a serial device.
When the system goes to hibernation,a Power IRP is sent to our driver.
we save the device context and pass the IRP down to the bus driver which
sets the device to a lower power state.
We also register for the completion of the power IRP which sets the
device to fully powered mode. so when the system resumes from hibernation,
our completion routine is called. In the completion routine we restore the
device state to the original state before hibernation.
But the problem we are facing currenly is the fact that the completion
routine is called at an IRQL = dispatch level.
What are the possible reasons for such a behaviour?
Thanks in advance.
/D.Nagarajan.
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
wrote in message news:xxxxx@ntdev…
>
> But the problem we are facing currenly is the fact that the completion
> routine is called at an IRQL = dispatch level.
>
> What are the possible reasons for such a behaviour?
>
Reasons? It’s allowed behavior, pure and simple.
Completion routines ALWAYS need to be cabable of being called at IRQL
DISPATCH_LEVEL. Consider that most device drivers complete IRPs in their
DpcForIsr routine… which runs at IRQL DISPATCH_LEVEL… and when they call
IoCompleteRequest(…), I/O completion processing phase 1 calls back the
completion routines. Bingo! Completion routine called at IRQL
DISPATCH_LEVEL.
Peter
OSR
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Any IRP may be completed at DISPATCH_LEVEL. That’s all there is to it.
If a lower-level driver completes your IRP at raised IRQL, then your
completion routine will be called at raised IRQL.
This is why the Driver Verifier will cause your IRPs to always be
completed at DISPATCH_LEVEL, allowing you to catch your bugs before they
make it into production.
-----Original Message-----
Subject: Power Management - Hibernation
From: xxxxx@yahoo.com
Date: Sun, 20 Jan 2002 2:26:58
X-Message-Number: 1
Hi,
We are writing a driver to a serial device.
When the system goes to hibernation,a Power IRP is sent to our
driver.
we save the device context and pass the IRP down to the bus driver which
sets the device to a lower power state.
We also register for the completion of the power IRP which sets the
device to fully powered mode. so when the system resumes from
hibernation, our completion routine is called. In the completion routine
we restore the
device state to the original state before hibernation.
But the problem we are facing currenly is the fact that the
completion routine is called at an IRQL = dispatch level.
What are the possible reasons for such a behaviour?
Thanks in advance.
/D.Nagarajan.
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
If you don’t want to accept IRPs at DISPATCH_LEVEL, you may set special flag
in the DEVICE_OBJECT::Flags field.
After you have created your device, just add the following line of code:
pDevice->Flags |= DO_POWER_PAGABLE; // 0x2000
DDK says that the system will always call such device at PASSIVE_LEVEL.
-----Original Message-----
From: Jake Oshins [mailto:xxxxx@windows.microsoft.com]
Sent: Wednesday, January 23, 2002 10:57 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Power Management - Hibernation
Any IRP may be completed at DISPATCH_LEVEL. That’s all there
is to it.
If a lower-level driver completes your IRP at raised IRQL, then your
completion routine will be called at raised IRQL.
This is why the Driver Verifier will cause your IRPs to always be
completed at DISPATCH_LEVEL, allowing you to catch your bugs
before they
make it into production.
-----Original Message-----
Subject: Power Management - Hibernation
From: xxxxx@yahoo.com
Date: Sun, 20 Jan 2002 2:26:58
X-Message-Number: 1
Hi,
We are writing a driver to a serial device.
When the system goes to hibernation,a Power IRP is sent to our
driver.
we save the device context and pass the IRP down to the bus
driver which
sets the device to a lower power state.
We also register for the completion of the power IRP
which sets the
device to fully powered mode. so when the system resumes from
hibernation, our completion routine is called. In the
completion routine
we restore the
device state to the original state before hibernation.
But the problem we are facing currenly is the fact that the
completion routine is called at an IRQL = dispatch level.
What are the possible reasons for such a behaviour?
Thanks in advance.
/D.Nagarajan.
You are currently subscribed to ntdev as: xxxxx@previo.ee
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
That flag only affects how the IRPs are sent down the stack, not what
happens on the way up. If you set the pageable bit, then you can be
guranteed that the disk will still be spinning until after you’ve
completed your power IRP. But that’s about it. Your completion routine
may still get called at DISPATCH_LEVEL.
You could, for instance, queue your completion to a passive-level worker
thread if you’ve set DO_POWER_PAGABLE and expect good results. If you
don’t set the bit, then queueing your work to a worker thread may
deadlock the machine, as the worker thread routines may page-fault. And
a page-fault that occurs when the disks are powered off will never be
satisfied.
Jake Oshins
Windows Kernel Group
-----Original Message-----
Subject: RE: Power Management - Hibernation
From: Grigori Shpakov
Date: Wed, 23 Jan 2002 11:09:55 +0200
X-Message-Number: 11
If you don’t want to accept IRPs at DISPATCH_LEVEL, you may set special
flag
in the DEVICE_OBJECT::Flags field.
After you have created your device, just add the following line of code:
pDevice->Flags |= DO_POWER_PAGABLE; // 0x2000
DDK says that the system will always call such device at PASSIVE_LEVEL.
> -----Original Message-----
> From: Jake Oshins [mailto:xxxxx@windows.microsoft.com]
> Sent: Wednesday, January 23, 2002 10:57 AM
> To: NT Developers Interest List
> Subject: [ntdev] RE: Power Management - Hibernation
>
>
> Any IRP may be completed at DISPATCH_LEVEL. That’s all there
> is to it.
> If a lower-level driver completes your IRP at raised IRQL, then your
> completion routine will be called at raised IRQL.
>
> This is why the Driver Verifier will cause your IRPs to always be
> completed at DISPATCH_LEVEL, allowing you to catch your bugs
> before they
> make it into production.
>
> - Jake
>
> -----Original Message-----
> Subject: Power Management - Hibernation
> From: xxxxx@yahoo.com
> Date: Sun, 20 Jan 2002 2:26:58
> X-Message-Number: 1
>
> Hi,
> We are writing a driver to a serial device.
>
> When the system goes to hibernation,a Power IRP is sent to our
> driver.
> we save the device context and pass the IRP down to the bus
> driver which
>
> sets the device to a lower power state.
>
> We also register for the completion of the power IRP
> which sets the
> device to fully powered mode. so when the system resumes from
> hibernation, our completion routine is called. In the
> completion routine
> we restore the
> device state to the original state before hibernation.
>
> But the problem we are facing currenly is the fact that the
> completion routine is called at an IRQL = dispatch level.
>
> What are the possible reasons for such a behaviour?
>
> Thanks in advance.
>
> /D.Nagarajan.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@previo.ee
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com