Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Jun 2015 12:03:38 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Marcel Moolenaar <marcel@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r284078 - head/sys/dev/pci
Message-ID:  <14005803.mtbqcRkBJG@ralph.baldwin.cx>
In-Reply-To: <201506061551.t56FpCbX013048@svn.freebsd.org>
References:  <201506061551.t56FpCbX013048@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, June 06, 2015 03:51:12 PM Marcel Moolenaar wrote:
> Author: marcel
> Date: Sat Jun  6 15:51:11 2015
> New Revision: 284078
> URL: https://svnweb.freebsd.org/changeset/base/284078
> 
> Log:
>   Don't return -10000 as the probe priority. That's lower than what
>   BUS_PROBE_HOOVER is. Drivers like proto(4), when compiled into the
>   kernel or preloaded, will render your system useless by virtue of
>   attaching to your PCI busses.
>   
>   Return BUS_PROBE_GENERIC instead. It's just the next priority up
>   from BUS_PROBE_HOOVER. No other meaning has been give to its use.
>   While BUS_PROBE_DEFAULT seems like a better candidate, it's hard
>   not to think that there must be some reason why these drivers
>   return -10000 in the first place.

BUS_PROBE_DEFAULT would conflict with other drivers that are supposed to
override these, such as acpi_pcib_pci which should override pci_pci
for PCI-PCI bridges in the ACPI namespace.  That driver currently hardcodes
-1000 itself. :-/  Then there's pcibios_pcib_probe for the $PIR PCI-PCI
bridge driver for when ACPI isn't present.  It returns -2000.  The
MPTable PCI-PCI bridge driver returns -1000 like ACPI.

That relative order (ACPI and MPTable are most preferred, then $PIR,
then generic PCI-PCI) is important for PCI INTx interrupt routing on
x86.  In general any platform which knows better how to route INTx
interrupts than the swizzle defined for add-on cards that pci_pci
uses should override the pci_pci driver via a higher probe value.

In this case simply using the stock BUS_PROBE values doesn't quite work
since there isn't just DEFAULT/GENERIC, but on x86 you have at least
three levels.

Also, BUS_PROBE_GENERIC does have a meaning and it is well suited to
these drivers.  It is for drivers that match large classes of devices
rather than specific devices.  In PCI terms that would mean a device
that matches on class/subclass rather than vendor/device ID (which is
true of these bridge drivers.  ignore_pci is a different animal).

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14005803.mtbqcRkBJG>