svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys

John Baldwin jhb at freebsd.org
Wed Apr 27 17:59:20 UTC 2016


On Wednesday, April 27, 2016 05:49:42 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Apr 27 17:49:42 2016
> New Revision: 298712
> URL: https://svnweb.freebsd.org/changeset/base/298712
> 
> Log:
>   Add a bus_null_rescan() method that always fails with an error.
>   
>   Use this in place of kobj_error_method to disable BUS_RESCAN() on
>   PCI drivers that do not use the "standard" scanning algorithm.

This should fix the build.

> Modified:
>   head/sys/dev/cardbus/cardbus.c
>   head/sys/kern/subr_bus.c
>   head/sys/mips/nlm/xlp_pci.c
>   head/sys/powerpc/ofw/ofw_pcibus.c
>   head/sys/sparc64/pci/ofw_pcibus.c
>   head/sys/sys/bus.h

Note that some of these drivers could be changed to use the "standard"
scanning algorithm and support rescans if they moved some of their custom
scanning logic into a pci_child_added callback.  This is generally true of
all but cardbus except that the OFW busses use the OFW tree to drive
scanning (so it seems they will add PCI devices that don't appear valid to
a PCI scan but are in the OFW tree).  I'm not sure how well that can work
in practice as no PCI device driver is going to attach to a PCI device
with a vendor ID of 0xffff (ACPI doesn't attempt to handle devices that
show up in the ACPI namespace but not in a PCI scan).

The xlp driver would just move the function-specific fixups into the
pci_child_added callback (though the special interrupt routing is
perhaps best done in PCI_ASSIGN_INTERRUPT or the like).  OFW would
walk the OFW tree to find the corresponding node (if one is found)
and initialize the OFW ivars (similar to what ACPI does) in the callback.

-- 
John Baldwin


More information about the svn-src-all mailing list