RE: Question regarding ScsiPort and failed START_DEVICE r equests

So what happens if the device is unplugged while start_device is pending? I
think perhaps getting a surprise remove irp in this case would be a good
idea :slight_smile:

=====================
Mark Roddy

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, April 19, 2004 2:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed
START_DEVICE requests

yep

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Robert Stankey
Sent: Monday, April 19, 2004 10:56 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question regarding ScsiPort and failed
START_DEVICE requests

On Mon, 19 Apr 2004 08:57:09 -0700, Peter Wieland wrote:

One last thing…

This sounds like a stupid question to ask but I’m going to
anyway. Can I assume PnP won’t send any other PnP request to
a device currently in a START_DEVICE/REMOVE_PENDING state.
In other words, I shouldn’t see a QUERY_REMOVE_DEVICE until
I’ve completed the START_DEVICE request.

Bob

> Returning STATUS_PENDING seems like a good choice.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
> Sent: Monday, April 19, 2004 7:30 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Question regarding ScsiPort and failed
> START_DEVICE requests
>
> On Fri, 16 Apr 2004 09:55:42 -0700, Peter Wieland wrote:
>
> Hi Peter,
>
> Thanks for your response. From what I can tell the reset
condition is

> caused by multiple storage arrays are coming up on the loop
causing a
> LIP condition. I believe the behavior of the HBA I’m using
may return

> this condition but only for a very short period of time.
>
> I can detect this condition and try again but I’m thinking
of a more
> general case where some condition may not be cleared in a timely
> manner which would hold up the PnP start process. In this case I
> should probably return a PENDING status from the
START_DEVICE request.
>
> Thoughts?
> Bob
>
>> I think you’re focussing on the wrong problem.
>>
>> What is the cause of the bus reset? Is the device timing out? Is
>> the
>
>> device resetting the bus for some reason? What does the event log
> say?
>>
>> What’s the reasoning behind failing the device start if a reset
>> occurs
>
>> while you’re probing it? This may or may not be the
“right thing to
>> do”.
>>
>>
>> PNP will disable the device. You’ll need to go into
device manager
>> and enable the device in order for it to get rediscovered.
>>
>> SCSIPORT won’t delete its PDO when this remove comes down because
>> scsiport knows the hardware is still present (unless
you’ve managed
>> to
>
>> make the device stop responding to inquiries or have changed its
>> inquiry data … Then it will get deleted eventually).
But it will
>> do
>
>> everything else associated with a remove.
>>
>> -p
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
>> Sent: Friday, April 16, 2004 9:27 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Question regarding ScsiPort and failed
START_DEVICE
>> requests
>>
>> I’ve been troubleshooting a condition where I’m running
into problems

>> with Lun 0 from a storage array. I’ve tracked the problem
down to an

>> issue during the START_DEVICE request. After passing the
PnP request

>> to the lower level drivers my driver issues a couple of inquiry
>> requests to the device to gather some information necessary for
>> proper
> operation.
>> One of these requests fails due to a BUS_RESET condition,
upon which
>> I
>
>> fail the START_DEVICE. According to the DDK documentation…
>>
>> "If a driver for a device fails the IRP_MN_START_DEVICE
request, the
>> PnP Manager sends an IRP_MN_REMOVE_DEVICE request to the
device stack

>> (on Windows 2000 and later systems). In response to this IRP, the
>> drivers for the device undo their start operations (if
they succeeded

>> the start IRP), undo their AddDevice operations, and
detach from the
> device stack.
>> The PnP Manager marks such a device “failed start.”"
>>
>> My questions are:
>>
>> - Will ScsiPort remove its PDO when this happens?
>> - Lets say I determine the condition has cleared. How do
I get PnP
>> to
>
>> reattempt a START_DEVICE? If ScsiPort has removed the PDO
>> invalidating the BusRelations for the adapter port’s PDO should
>> rediscover it. If ScsiPort hasn’t removed the PDO I don’t
know how
>> to
> accomplish this.
>>
>> Thanks,
>> Bob
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as:
>> xxxxx@windows.microsoft.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:
> xxxxx@windows.microsoft.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:
xxxxx@windows.microsoft.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:
xxxxx@stratus.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

If the hardware disappears while a driver is starting the device then I
would expect one of three things to happen:

  1. Driver starts the device anyway, bus doesn’t report the device on the
    next enumeration, PNP sends a surprise_remove
  2. Driver detects that the device is missing while starting it (because
    it doesn’t respond at all, returns 0xff, etc…) and fails the start
    operation. PNP sends a remove (any maybe a surprise remove … Not sure
    there)
  3. Driver hangs indefinately waiting for the device to clear a bit in a
    register that’s now returning 0xff because the device isn’t present.
    System eventaully hangs up.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Monday, April 19, 2004 11:27 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed START_DEVICE
r equests

So what happens if the device is unplugged while start_device is
pending? I think perhaps getting a surprise remove irp in this case
would be a good idea :slight_smile:

=====================
Mark Roddy

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, April 19, 2004 2:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed
START_DEVICE requests

yep

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Robert Stankey
Sent: Monday, April 19, 2004 10:56 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question regarding ScsiPort and failed
START_DEVICE requests

On Mon, 19 Apr 2004 08:57:09 -0700, Peter Wieland wrote:

One last thing…

This sounds like a stupid question to ask but I’m going to anyway.
Can I assume PnP won’t send any other PnP request to a device
currently in a START_DEVICE/REMOVE_PENDING state.
In other words, I shouldn’t see a QUERY_REMOVE_DEVICE until I’ve
completed the START_DEVICE request.

Bob

> Returning STATUS_PENDING seems like a good choice.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
> Sent: Monday, April 19, 2004 7:30 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Question regarding ScsiPort and failed
> START_DEVICE requests
>
> On Fri, 16 Apr 2004 09:55:42 -0700, Peter Wieland wrote:
>
> Hi Peter,
>
> Thanks for your response. From what I can tell the reset
condition is

> caused by multiple storage arrays are coming up on the loop
causing a
> LIP condition. I believe the behavior of the HBA I’m using
may return

> this condition but only for a very short period of time.
>
> I can detect this condition and try again but I’m thinking
of a more
> general case where some condition may not be cleared in a timely
> manner which would hold up the PnP start process. In this case I
> should probably return a PENDING status from the
START_DEVICE request.
>
> Thoughts?
> Bob
>
>> I think you’re focussing on the wrong problem.
>>
>> What is the cause of the bus reset? Is the device timing out? Is
>> the
>
>> device resetting the bus for some reason? What does the event log
> say?
>>
>> What’s the reasoning behind failing the device start if a reset
>> occurs
>
>> while you’re probing it? This may or may not be the
“right thing to
>> do”.
>>
>>
>> PNP will disable the device. You’ll need to go into
device manager
>> and enable the device in order for it to get rediscovered.
>>
>> SCSIPORT won’t delete its PDO when this remove comes down because
>> scsiport knows the hardware is still present (unless
you’ve managed
>> to
>
>> make the device stop responding to inquiries or have changed its
>> inquiry data … Then it will get deleted eventually).
But it will
>> do
>
>> everything else associated with a remove.
>>
>> -p
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
>> Sent: Friday, April 16, 2004 9:27 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Question regarding ScsiPort and failed
START_DEVICE
>> requests
>>
>> I’ve been troubleshooting a condition where I’m running
into problems

>> with Lun 0 from a storage array. I’ve tracked the problem
down to an

>> issue during the START_DEVICE request. After passing the
PnP request

>> to the lower level drivers my driver issues a couple of inquiry
>> requests to the device to gather some information necessary for
>> proper
> operation.
>> One of these requests fails due to a BUS_RESET condition,
upon which
>> I
>
>> fail the START_DEVICE. According to the DDK documentation…
>>
>> "If a driver for a device fails the IRP_MN_START_DEVICE
request, the
>> PnP Manager sends an IRP_MN_REMOVE_DEVICE request to the
device stack

>> (on Windows 2000 and later systems). In response to this IRP, the
>> drivers for the device undo their start operations (if
they succeeded

>> the start IRP), undo their AddDevice operations, and
detach from the
> device stack.
>> The PnP Manager marks such a device “failed start.”"
>>
>> My questions are:
>>
>> - Will ScsiPort remove its PDO when this happens?
>> - Lets say I determine the condition has cleared. How do
I get PnP
>> to
>
>> reattempt a START_DEVICE? If ScsiPort has removed the PDO
>> invalidating the BusRelations for the adapter port’s PDO should
>> rediscover it. If ScsiPort hasn’t removed the PDO I don’t
know how
>> to
> accomplish this.
>>
>> Thanks,
>> Bob
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as:
>> xxxxx@windows.microsoft.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:
> xxxxx@windows.microsoft.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:
xxxxx@windows.microsoft.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:
xxxxx@stratus.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: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

If you fail start, you immediately get a remove device irp.
Furthermore, if a filter on top of your device and you succeed the start
but the upper filter fails it, you still get the started -> removed
transition (w/out a query remove or a surprise remove)

D

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Monday, April 19, 2004 1:14 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed START_DEVICE
r equests

If the hardware disappears while a driver is starting the device then I
would expect one of three things to happen:

  1. Driver starts the device anyway, bus doesn’t report the device on the
    next enumeration, PNP sends a surprise_remove
  2. Driver detects that the device is missing while starting it (because
    it doesn’t respond at all, returns 0xff, etc…) and fails the start
    operation. PNP sends a remove (any maybe a surprise remove … Not sure
    there)
  3. Driver hangs indefinately waiting for the device to clear a bit in a
    register that’s now returning 0xff because the device isn’t present.
    System eventaully hangs up.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Monday, April 19, 2004 11:27 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed START_DEVICE
r equests

So what happens if the device is unplugged while start_device is
pending? I think perhaps getting a surprise remove irp in this case
would be a good idea :slight_smile:

=====================
Mark Roddy

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, April 19, 2004 2:13 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed
START_DEVICE requests

yep

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Robert Stankey
Sent: Monday, April 19, 2004 10:56 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question regarding ScsiPort and failed
START_DEVICE requests

On Mon, 19 Apr 2004 08:57:09 -0700, Peter Wieland wrote:

One last thing…

This sounds like a stupid question to ask but I’m going to anyway.
Can I assume PnP won’t send any other PnP request to a device
currently in a START_DEVICE/REMOVE_PENDING state.
In other words, I shouldn’t see a QUERY_REMOVE_DEVICE until I’ve
completed the START_DEVICE request.

Bob

> Returning STATUS_PENDING seems like a good choice.
>
> -p
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
> Sent: Monday, April 19, 2004 7:30 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Question regarding ScsiPort and failed
> START_DEVICE requests
>
> On Fri, 16 Apr 2004 09:55:42 -0700, Peter Wieland wrote:
>
> Hi Peter,
>
> Thanks for your response. From what I can tell the reset
condition is

> caused by multiple storage arrays are coming up on the loop
causing a
> LIP condition. I believe the behavior of the HBA I’m using
may return

> this condition but only for a very short period of time.
>
> I can detect this condition and try again but I’m thinking
of a more
> general case where some condition may not be cleared in a timely
> manner which would hold up the PnP start process. In this case I
> should probably return a PENDING status from the
START_DEVICE request.
>
> Thoughts?
> Bob
>
>> I think you’re focussing on the wrong problem.
>>
>> What is the cause of the bus reset? Is the device timing out? Is
>> the
>
>> device resetting the bus for some reason? What does the event log
> say?
>>
>> What’s the reasoning behind failing the device start if a reset
>> occurs
>
>> while you’re probing it? This may or may not be the
“right thing to
>> do”.
>>
>>
>> PNP will disable the device. You’ll need to go into
device manager
>> and enable the device in order for it to get rediscovered.
>>
>> SCSIPORT won’t delete its PDO when this remove comes down because
>> scsiport knows the hardware is still present (unless
you’ve managed
>> to
>
>> make the device stop responding to inquiries or have changed its
>> inquiry data … Then it will get deleted eventually).
But it will
>> do
>
>> everything else associated with a remove.
>>
>> -p
>>
>> -----Original Message-----
>> From: xxxxx@lists.osr.com
>> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
>> Sent: Friday, April 16, 2004 9:27 AM
>> To: Windows System Software Devs Interest List
>> Subject: [ntdev] Question regarding ScsiPort and failed
START_DEVICE
>> requests
>>
>> I’ve been troubleshooting a condition where I’m running
into problems

>> with Lun 0 from a storage array. I’ve tracked the problem
down to an

>> issue during the START_DEVICE request. After passing the
PnP request

>> to the lower level drivers my driver issues a couple of inquiry
>> requests to the device to gather some information necessary for
>> proper
> operation.
>> One of these requests fails due to a BUS_RESET condition,
upon which
>> I
>
>> fail the START_DEVICE. According to the DDK documentation…
>>
>> "If a driver for a device fails the IRP_MN_START_DEVICE
request, the
>> PnP Manager sends an IRP_MN_REMOVE_DEVICE request to the
device stack

>> (on Windows 2000 and later systems). In response to this IRP, the
>> drivers for the device undo their start operations (if
they succeeded

>> the start IRP), undo their AddDevice operations, and
detach from the
> device stack.
>> The PnP Manager marks such a device “failed start.”"
>>
>> My questions are:
>>
>> - Will ScsiPort remove its PDO when this happens?
>> - Lets say I determine the condition has cleared. How do
I get PnP
>> to
>
>> reattempt a START_DEVICE? If ScsiPort has removed the PDO
>> invalidating the BusRelations for the adapter port’s PDO should
>> rediscover it. If ScsiPort hasn’t removed the PDO I don’t
know how
>> to
> accomplish this.
>>
>> Thanks,
>> Bob
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as:
>> xxxxx@windows.microsoft.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:
> xxxxx@windows.microsoft.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:
xxxxx@windows.microsoft.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:
xxxxx@stratus.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: xxxxx@windows.microsoft.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: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The case in question was a function driver for a scsi target that has pended
a start_device request. The OP asked if he would not see any further PnP
requests until after he completes his queued start_device. I believe he
won’t, and both of your replies appear to confirm that.

So if the HBA bus driver detects that the device is missing (and most HBA’s
won’t unless somebody asks them to rescan the bus) and tries to inform PnP
that a devnode has disappeared, will anything happen at all? Will the bus
query even occur? I think not. Instead PnP is essentially stuck waiting for
that start_device to complete and will not be processing much else until it
does.

Note that the function driver in question is not accessing hardware
registers and will not therefore get specific feedback like an ‘all-ffff’s’
register read value. At best an error return from whatever operation the OP
is retrying might convince him that further retries are of no use, at worst
the error return from this operation will not be distinguishable from the
error return he used to begin his retry operations. In that case, the best
the OP can do is pick some number of retries or some time limit on retries
and decide that this many is enough and bail out.

=====================
Mark Roddy

-----Original Message-----
From: Doron Holan [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, April 19, 2004 4:26 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed
START_DEVICE r equests

If you fail start, you immediately get a remove device irp.
Furthermore, if a filter on top of your device and you
succeed the start but the upper filter fails it, you still
get the started -> removed transition (w/out a query remove
or a surprise remove)

D

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Wieland
Sent: Monday, April 19, 2004 1:14 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed
START_DEVICE r equests

If the hardware disappears while a driver is starting the
device then I would expect one of three things to happen:

  1. Driver starts the device anyway, bus doesn’t report the
    device on the next enumeration, PNP sends a surprise_remove
  2. Driver detects that the device is missing while starting
    it (because it doesn’t respond at all, returns 0xff, etc…)
    and fails the start operation. PNP sends a remove (any maybe
    a surprise remove … Not sure
    there)
  3. Driver hangs indefinately waiting for the device to clear
    a bit in a register that’s now returning 0xff because the
    device isn’t present.
    System eventaully hangs up.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Roddy, Mark
Sent: Monday, April 19, 2004 11:27 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Question regarding ScsiPort and failed
START_DEVICE r equests

So what happens if the device is unplugged while start_device
is pending? I think perhaps getting a surprise remove irp in
this case would be a good idea :slight_smile:

=====================
Mark Roddy

> -----Original Message-----
> From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
> Sent: Monday, April 19, 2004 2:13 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Question regarding ScsiPort and failed
> START_DEVICE requests
>
> yep
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
Robert Stankey
> Sent: Monday, April 19, 2004 10:56 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Question regarding ScsiPort and failed
> START_DEVICE requests
>
> On Mon, 19 Apr 2004 08:57:09 -0700, Peter Wieland wrote:
>
> One last thing…
>
> This sounds like a stupid question to ask but I’m going to anyway.
> Can I assume PnP won’t send any other PnP request to a device
> currently in a START_DEVICE/REMOVE_PENDING state.
> In other words, I shouldn’t see a QUERY_REMOVE_DEVICE until I’ve
> completed the START_DEVICE request.
>
> Bob
>
> > Returning STATUS_PENDING seems like a good choice.
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of
> Robert Stankey
> > Sent: Monday, April 19, 2004 7:30 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Question regarding ScsiPort and failed
> > START_DEVICE requests
> >
> > On Fri, 16 Apr 2004 09:55:42 -0700, Peter Wieland wrote:
> >
> > Hi Peter,
> >
> > Thanks for your response. From what I can tell the reset
> condition is
>
> > caused by multiple storage arrays are coming up on the loop
> causing a
> > LIP condition. I believe the behavior of the HBA I’m using
> may return
>
> > this condition but only for a very short period of time.
> >
> > I can detect this condition and try again but I’m thinking
> of a more
> > general case where some condition may not be cleared in a timely
> > manner which would hold up the PnP start process. In this case I
> > should probably return a PENDING status from the
> START_DEVICE request.
> >
> > Thoughts?
> > Bob
> >
> >> I think you’re focussing on the wrong problem.
> >>
> >> What is the cause of the bus reset? Is the device
timing out? Is
> >> the
> >
> >> device resetting the bus for some reason? What does the
event log
> > say?
> >>
> >> What’s the reasoning behind failing the device start if a reset
> >> occurs
> >
> >> while you’re probing it? This may or may not be the
> “right thing to
> >> do”.
> >>
> >>
> >> PNP will disable the device. You’ll need to go into
> device manager
> >> and enable the device in order for it to get rediscovered.
> >>
> >> SCSIPORT won’t delete its PDO when this remove comes
down because
> >> scsiport knows the hardware is still present (unless
> you’ve managed
> >> to
> >
> >> make the device stop responding to inquiries or have changed its
> >> inquiry data … Then it will get deleted eventually).
> But it will
> >> do
> >
> >> everything else associated with a remove.
> >>
> >> -p
> >>
> >> -----Original Message-----
> >> From: xxxxx@lists.osr.com
> >> [mailto:xxxxx@lists.osr.com] On Behalf Of
> Robert Stankey
> >> Sent: Friday, April 16, 2004 9:27 AM
> >> To: Windows System Software Devs Interest List
> >> Subject: [ntdev] Question regarding ScsiPort and failed
> START_DEVICE
> >> requests
> >>
> >> I’ve been troubleshooting a condition where I’m running
> into problems
>
> >> with Lun 0 from a storage array. I’ve tracked the problem
> down to an
>
> >> issue during the START_DEVICE request. After passing the
> PnP request
>
> >> to the lower level drivers my driver issues a couple of inquiry
> >> requests to the device to gather some information necessary for
> >> proper
> > operation.
> >> One of these requests fails due to a BUS_RESET condition,
> upon which
> >> I
> >
> >> fail the START_DEVICE. According to the DDK documentation…
> >>
> >> “If a driver for a device fails the IRP_MN_START_DEVICE
> request, the
> >> PnP Manager sends an IRP_MN_REMOVE_DEVICE request to the
> device stack
>
> >> (on Windows 2000 and later systems). In response to this
IRP, the
> >> drivers for the device undo their start operations (if
> they succeeded
>
> >> the start IRP), undo their AddDevice operations, and
> detach from the
> > device stack.
> >> The PnP Manager marks such a device “failed start.””
> >>
> >> My questions are:
> >>
> >> - Will ScsiPort remove its PDO when this happens?
> >> - Lets say I determine the condition has cleared. How do
> I get PnP
> >> to
> >
> >> reattempt a START_DEVICE? If ScsiPort has removed the PDO
> >> invalidating the BusRelations for the adapter port’s PDO should
> >> rediscover it. If ScsiPort hasn’t removed the PDO I don’t
> know how
> >> to
> > accomplish this.
> >>
> >> Thanks,
> >> Bob
> >>
> >> —
> >> Questions? First check the Kernel Driver FAQ at
> >> http://www.osronline.com/article.cfm?id=256
> >>
> >> You are currently subscribed to ntdev as:
> >> xxxxx@windows.microsoft.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:
> > xxxxx@windows.microsoft.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:
> xxxxx@windows.microsoft.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:
> xxxxx@stratus.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:
xxxxx@windows.microsoft.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:
xxxxx@windows.microsoft.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:
xxxxx@stratus.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

> The case in question was a function driver for a scsi target that has pended

a start_device request. The OP asked if he would not see any further PnP
requests until after he completes his queued start_device.

Pending the PnP IRP indefinitely is a very bad idea. I expect the w2k’s PnP
manager to be just frozen with this, so no more PnP work can progress.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Which is why I brought it up. PnP is essentially single threaded. Pending
StartDevice (or any other pnp request) basically hangs NT dynamic
configuration until the request is completed. If you aren’t aware of this
when you write your driver you are asking for a whole mess of trouble.

=====================
Mark Roddy

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Tuesday, April 20, 2004 10:00 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Question regarding ScsiPort and failed
START_DEVICE r equests

> The case in question was a function driver for a scsi
target that has
> pended a start_device request. The OP asked if he would not see any
> further PnP requests until after he completes his queued
start_device.

Pending the PnP IRP indefinitely is a very bad idea. I expect
the w2k’s PnP manager to be just frozen with this, so no more
PnP work can progress.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


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

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

Sorry for my late reply on this…

Based on input from everyone else it sounds like pending is a bad idea. I
currently have a limit at which I finally give up the START_DEVICE request
but getting a “second chance” at the device doesn’t seem possible.

Bob

On Tue, 20 Apr 2004 10:05:24 -0400, Roddy, Mark wrote:

Which is why I brought it up. PnP is essentially single threaded. Pending
StartDevice (or any other pnp request) basically hangs NT dynamic
configuration until the request is completed. If you aren’t aware of this
when you write your driver you are asking for a whole mess of trouble.

=====================
Mark Roddy

> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Tuesday, April 20, 2004 10:00 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Question regarding ScsiPort and failed
> START_DEVICE r equests
>
>> The case in question was a function driver for a scsi
> target that has
>> pended a start_device request. The OP asked if he would not see any
>> further PnP requests until after he completes his queued
> start_device.
>
> Pending the PnP IRP indefinitely is a very bad idea. I expect
> the w2k’s PnP manager to be just frozen with this, so no more
> PnP work can progress.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>

Note that your retries within your dispatch routine will also hang PnP until
you give up. My point was that pending these requests may not have the
desired effect, and obscures the fact that you are holding up
reconfiguration.

Absent some mechanism to force a re-enumeration and re-activation of your
target PDO, you are indeed stuck at this point. (The point where you have
exceeded your retries.)

The other hack is to allow start_device to complete successfully and
continue your retries in the background. You then have some additional state
that you manage that holds off other (non-pnp) IO, either rejecting it or
pending it, until you decide what the final resolution of this PDO’s
operational state is.

(note to self: is my habitual misspelling of ‘retries’ as ‘retires’
meaningful?)

=====================
Mark Roddy

-----Original Message-----
From: Robert Stankey [mailto:xxxxx@lsil.com]
Sent: Monday, April 26, 2004 11:08 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Question regarding ScsiPort and failed
START_DEVICE r equests

Sorry for my late reply on this…

Based on input from everyone else it sounds like pending is a
bad idea. I currently have a limit at which I finally give
up the START_DEVICE request but getting a “second chance” at
the device doesn’t seem possible.

Bob

On Tue, 20 Apr 2004 10:05:24 -0400, Roddy, Mark wrote:

> Which is why I brought it up. PnP is essentially single threaded.
> Pending StartDevice (or any other pnp request) basically hangs NT
> dynamic configuration until the request is completed. If you aren’t
> aware of this when you write your driver you are asking for
a whole mess of trouble.
>
>
> =====================
> Mark Roddy
>
>
>> -----Original Message-----
>> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
>> Sent: Tuesday, April 20, 2004 10:00 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] Question regarding ScsiPort and failed
>> START_DEVICE r equests
>>
>>> The case in question was a function driver for a scsi
>> target that has
>>> pended a start_device request. The OP asked if he would
not see any
>>> further PnP requests until after he completes his queued
>> start_device.
>>
>> Pending the PnP IRP indefinitely is a very bad idea. I expect the
>> w2k’s PnP manager to be just frozen with this, so no more PnP work
>> can progress.
>>
>> Maxim Shatskih, Windows DDK MVP
>> StorageCraft Corporation
>> xxxxx@storagecraft.com
>> http://www.storagecraft.com
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as:
>> xxxxx@stratus.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:
xxxxx@stratus.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

On Mon, 26 Apr 2004 11:25:17 -0400, Roddy, Mark wrote:

Thanks for the comments!

I certainly don’t want to hold up the configuration process but will have
to see how much effort is involved in changing my driver for this. From
one viewpoint it happens very infrequently; from another viewpoint, if it
happens on my test setup it will certainly happen at customer sites. At
least its not something specific to my driver but more of a timing issue.

I’ve heard that Microsoft is considering some improvements in the PnP
discovery process, such as pending either AddDevice or StartDevice
requests. Have you heard this?

Bob

Note that your retries within your dispatch routine will also hang PnP until
you give up. My point was that pending these requests may not have the
desired effect, and obscures the fact that you are holding up
reconfiguration.

Absent some mechanism to force a re-enumeration and re-activation of your
target PDO, you are indeed stuck at this point. (The point where you have
exceeded your retries.)

The other hack is to allow start_device to complete successfully and
continue your retries in the background. You then have some additional state
that you manage that holds off other (non-pnp) IO, either rejecting it or
pending it, until you decide what the final resolution of this PDO’s
operational state is.

(note to self: is my habitual misspelling of ‘retries’ as ‘retires’
meaningful?)

=====================
Mark Roddy

> -----Original Message-----
> From: Robert Stankey [mailto:xxxxx@lsil.com]
> Sent: Monday, April 26, 2004 11:08 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Question regarding ScsiPort and failed
> START_DEVICE r equests
>
> Sorry for my late reply on this…
>
> Based on input from everyone else it sounds like pending is a
> bad idea. I currently have a limit at which I finally give
> up the START_DEVICE request but getting a “second chance” at
> the device doesn’t seem possible.
>
> Bob
>
> On Tue, 20 Apr 2004 10:05:24 -0400, Roddy, Mark wrote:
>
>> Which is why I brought it up. PnP is essentially single threaded.
>> Pending StartDevice (or any other pnp request) basically hangs NT
>> dynamic configuration until the request is completed. If you aren’t
>> aware of this when you write your driver you are asking for
> a whole mess of trouble.
>>
>>
>> =====================
>> Mark Roddy
>>
>>
>>> -----Original Message-----
>>> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
>>> Sent: Tuesday, April 20, 2004 10:00 AM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re: [ntdev] Question regarding ScsiPort and failed
>>> START_DEVICE r equests
>>>
>>>> The case in question was a function driver for a scsi
>>> target that has
>>>> pended a start_device request. The OP asked if he would
> not see any
>>>> further PnP requests until after he completes his queued
>>> start_device.
>>>
>>> Pending the PnP IRP indefinitely is a very bad idea. I expect the
>>> w2k’s PnP manager to be just frozen with this, so no more PnP work
>>> can progress.
>>>
>>> Maxim Shatskih, Windows DDK MVP
>>> StorageCraft Corporation
>>> xxxxx@storagecraft.com
>>> http://www.storagecraft.com
>>>
>>>
>>> —
>>> Questions? First check the Kernel Driver FAQ at
>>> http://www.osronline.com/article.cfm?id=256
>>>
>>> You are currently subscribed to ntdev as:
>>> xxxxx@stratus.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:
> xxxxx@stratus.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>