Concurrent: case 2
Serialized: cases 1 & 3
Think of the parent/child relationship this way. A child cannot be
running if the parent is not running. That means for a query stop/query
remove, the entire tree has to be locked and the tree is queried from
the children up to the root. Same for remove, the pnp manager changes
state from the children up to the root. This type of design would not
allow for a concurrent state change in both the parent and child at the
same time.
Now one would assume that the query remove canceled is sent from the
root and then downward to the children, but that is not the case. This
is a bug in the pnp manager on all currently shipping OS’s. The cancel
q.r. is sent from the children up to the root. This means that if you
enforce the rule during query remove, that a child cannot be in the
running/powered up state until the parent is in the running/powered up
state, you will deadlock b/c the child will get the canceled q.r. before
the parent, blocking the state change until the parent also moves into
the working state. What this boils down to is that you cannot treat
query remove w/in your own stack as an implicit power down state change,
q.r. becomes a notification to your driver that you can fail, but that’s
it.
By “PDO & FDO pair”, I meant the parent/child relation ship and not the
possible FDO attached to the PDO.
D
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Arlie Davis
Sent: Wednesday, December 14, 2005 11:27 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] PNP transitions and serialization
That helps some. However, please clarify a few things. Let’s say that
an
FDO bus driver creates 2 PDOs, “A” and “B”. Which of the following sets
of
devices can receive state-changing PNP requests concurrently, and which
cannot?
- Bus and PDO A
- PDO A and PDO B
- Bus, PDO A, PDO B
By “PDO and FDO pair”, do you mean the device objects in a single device
object stack? i.e. an FDO that is attached to a PDO? Or do you mean
the
parent/child relationship between the FDO bus driver and PDO child?
Thanks much.
– arlie
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Wednesday, December 14, 2005 2:04 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] PNP transitions and serialization
Pnp state changing irps are serialized, not all pnp irps fall into that
category. Pnp irps are serialized based on the device tree really. If
you
have 2 different device trees with different roots, there is nothing to
stop
the pnp manage from changing the state of both tres at the same time.
In
today’s implementation , it is serialized across the entire OS (*). For
a
PDO and FDO pair, the PDO’s state is dependent on the FDO’s state. That
means that only one state transition will be pending between an FDO and
PDO
pair (let’s say processing query remove). That does not apply to
sibling
PDOs, one PDO could be potentially moving into one state (query stop)
and
another PDO could be starting at the same time.
That help?
D
(*) start and QDR/BusRelations have been turned into async operations in
Vista so that more then one device tree can be started at a time.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com