device probe re-tried for failed isa device
Norbert Koch
NKoch at demig.de
Fri Jan 13 06:26:46 PST 2006
Hello.
I wrote two isa device drivers A and B for FreeBSD4.11.
Both are kld-loaded and have identify() entries.
Here is the pseudo code for the identify() routines:
A_identify() /* 2 units */
{
for (i = 0; i <=1; ++ i)
{
dev = BUS_ADD_CHILD(parent, ISA-ORDER_SPECULATIVE, "a", 0);
If (bus_set_resource (dev, ...) != 0)
{
device_delete_child (parent, dev);
continue;
};
init (device_get_softc (dev, i));
}
}
B_identify() /* 1 unit */
{
dev = BUS_ADD_CHILD(parent, ISA-ORDER_SPECULATIVE, "a", 0);
If (bus_set_resource (dev, ...) != 0)
{
device_delete_child (parent, dev);
}
}
When I kldload the two drivers I see these function calls:
1. A_identify
2. A_probe(unit 0)
3. A_attach(unit 0)
4. A_probe(unit 1)
<-- fails with ENXIO because hardware is not present
5. B_identify
6. A_probe(unit 1)
<-- probed again!?
7. B_probe(unit 0)
8. B_attach(unit 0)
Is it correct, that the isa bus re-tries
to probe failed devices?
The results from calling device_get_softc()
differ for the two probe() calls 4 and 6.
Is this correct?
Is it correct to initialize softc in identify()?
Should I call device_delete_child() in
probe() when the hardware fails?
Thank you,
Norbert Koch
More information about the freebsd-hackers
mailing list