DPC issue in StorPort

Hi all,
In ISR routine, I used StorPortIssueDpc to insert a DPC. The DPC routine is
very small and it only contain just a piece of StorPortReadRegisterUlong.
However, I find the duration of the DPC routine is about 2 second! I used
StorPortQuerySystemTime to calculate it. I find the reason is that
sometimes DPC routine is interrupt by BuildIO many times. After BuildIO
finished, the DPC will resume. Could you tell me why BuildIO can interrupt
the DPC routine?
Thanks.
Marvin

Is it not legal to issue this in the ISR? Why do you need a DPC to do it?

Hi all,
In ISR routine, I used StorPortIssueDpc to insert a DPC. The DPC routine
is
very small and it only contain just a piece of StorPortReadRegisterUlong.
However, I find the duration of the DPC routine is about 2 second! I used
StorPortQuerySystemTime to calculate it. I find the reason is that
sometimes DPC routine is interrupt by BuildIO many times. After BuildIO
finished, the DPC will resume. Could you tell me why BuildIO can interrupt
the DPC routine?
Thanks.
Marvin


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

From my other PCI device driver experiment, I think ISR will handle will do
very urgent response and deliver a DPC to handle less urgent response such
complete IRP or set event. Is it not right in StorPort?

On Wed, Feb 8, 2012 at 6:58 PM, wrote:

> Is it not legal to issue this in the ISR? Why do you need a DPC to do it?
>
> > Hi all,
> > In ISR routine, I used StorPortIssueDpc to insert a DPC. The DPC routine
> > is
> > very small and it only contain just a piece of
> StorPortReadRegisterUlong.
> > However, I find the duration of the DPC routine is about 2 second! I used
> > StorPortQuerySystemTime to calculate it. I find the reason is that
> > sometimes DPC routine is interrupt by BuildIO many times. After BuildIO
> > finished, the DPC will resume. Could you tell me why BuildIO can
> interrupt
> > the DPC routine?
> > Thanks.
> > Marvin
> >
> > —
> > 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
>

Yes the DPC is where you have to perform IO completion operations, but
you can poke ahardware register in your ISR, so the question remiains
why the only thing your DPC does is StorPortReadRegisterUlong.

Your DPC is not “interrupted” by BuildIo, but it could be stalled
waiting for a lock acquired in your BuildIo routine. Your DPC can only
be interrupted by ISRs run from other interrupt events.

Mark Roddy

On Wed, Feb 8, 2012 at 7:42 AM, Marvin(Fan) Zhang wrote:
> From my other PCI device driver experiment, I think ISR will handle will do
> very urgent response and deliver a DPC to handle less urgent response such
> complete IRP or set event. Is it not right in StorPort?
>
>
> On Wed, Feb 8, 2012 at 6:58 PM, wrote:
>>
>> Is it not legal to issue this in the ISR? ?Why do you need a DPC to do it?
>>
>> > Hi all,
>> > In ISR routine, I used StorPortIssueDpc to insert a DPC. The DPC routine
>> > is
>> > very small and it only contain ?just a piece of
>> > StorPortReadRegisterUlong.
>> > However, I find the duration of the DPC routine is about 2 second! I
>> > used
>> > StorPortQuerySystemTime to calculate it. I find the reason is that
>> > sometimes DPC routine is interrupt by BuildIO many times. After BuildIO
>> > finished, the DPC will resume. Could you tell me why BuildIO can
>> > interrupt
>> > the DPC routine?
>> > Thanks.
>> > Marvin
>> >
>> > —
>> > 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

The DPC will be called while holding the miniport lock, the same is held while StartIo is called.

Yes but the op explicitly said that BuidIo was interrupting his DPC,
whatever that means, and one can acquire the miniport lock in BuildIo.
Mark Roddy

On Wed, Feb 8, 2012 at 11:38 AM, wrote:
> The DPC will be called while holding the miniport lock, the same is held while StartIo is called.
>
> —
> 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

Do you mean only one of DPC and StartIO can hold the miniport lock at the
same time?
Is it spin-lock?

On Thu, Feb 9, 2012 at 12:38 AM, wrote:

> The DPC will be called while holding the miniport lock, the same is held
> while StartIo is called.
>
> —
> 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
>

>Do you mean only one of DPC and StartIO can hold the miniport lock at the same time?

Is it spin-lock?

I think it’s more of queue-style thing which will allow only one of DPC or StartIO “requests” inside.

But yes, there is also a spinlock there.


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