diff options
author | marius <marius@FreeBSD.org> | 2007-01-08 01:08:24 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2007-01-08 01:08:24 +0000 |
commit | 384c6b86d01fe237623ce0e39a80320316886fa2 (patch) | |
tree | c3da10d6ba10639e388abf574fd71fc90a949b5d /sys/sparc64/pci | |
parent | 8a0d7747e8c6d065909f58df133a3653261d644e (diff) | |
download | FreeBSD-src-384c6b86d01fe237623ce0e39a80320316886fa2.zip FreeBSD-src-384c6b86d01fe237623ce0e39a80320316886fa2.tar.gz |
In ofw_pcibus_attach() skip dupe PCI devices reported by the
firmware (mainly 'pmu' and its 'lomp' dupe found in a couple of
later USII{e,i}-based machines) by checking whether a device with
the same triple of bus number, slot and function already has been
added. This is the simple yet effective approach introduced in
OpenBSD some time ago, but which has the flaw that it assumes
that the device and its dupe(s) found in the OFW device tree are
equal or at least the one encountered first is in some way the
more important one (this is the case with 'pmu' and 'lomp'; the
'pmu' node has couple of properties and children while the 'lomp'
one misses most of these). If there's ever a device/dupe pair
where we don't encounter the more important node first, we'll
probably need to introduce a quirk list in order to add the
desired device but prevent its dupe(s) from being added.
MFC after: 1 week
Diffstat (limited to 'sys/sparc64/pci')
-rw-r--r-- | sys/sparc64/pci/ofw_pcibus.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sparc64/pci/ofw_pcibus.c b/sys/sparc64/pci/ofw_pcibus.c index 6454ee3..d5293e1 100644 --- a/sys/sparc64/pci/ofw_pcibus.c +++ b/sys/sparc64/pci/ofw_pcibus.c @@ -197,6 +197,8 @@ ofw_pcibus_attach(device_t dev) continue; slot = OFW_PCI_PHYS_HI_DEVICE(pcir.phys_hi); func = OFW_PCI_PHYS_HI_FUNCTION(pcir.phys_hi); + if (pci_find_bsf(busno, slot, func) != NULL) + continue; ofw_pcibus_setup_device(pcib, busno, slot, func); dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, busno, slot, func, sizeof(*dinfo)); |