]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Revision 233677 broke certain machines. Specifically, if the firmware/BIOS
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 9 May 2013 19:24:50 +0000 (19:24 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 9 May 2013 19:24:50 +0000 (19:24 +0000)
commit5569a8b8df00d55f3e834f0424d2fbd161d94596
treec97d229122e0d9d60c1094407aa932df02d2ba65
parent241b67bb47591cedbe637fc0dae1b0ad4db32d3c
Revision 233677 broke certain machines.  Specifically, if the firmware/BIOS
assigned conflicting ranges to BARs then leaving the BARs alone could
result in one device stealing mmio accesses intended to go to a second
device.  Prior to 233677 the PCI bus driver attempted to handle this case
by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
is not guaranteed to be true).  Now when a conflicting BAR is detected the
following steps are taken:

 1) If hw.pci.realloc_bars (a new tunable) is enabled (default is enabled),
    then ignore the current BAR setting from the firmware and attempt to
    allocate a fresh resource range for the BAR.

 2) If 1) failed (or was disabled), disable decoding for the relevant
    BAR type (e.g. disable mem decoding for a memory BAR) and emit a
    warning if booting verbose.

Tested by: Alex Keda <admin@lissyara.su>
MFC after: 1 week
sys/dev/pci/pci.c