]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Disable IO/MEM decoding for devices with non-compliant BARs
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 25 Feb 2016 20:35:57 +0000 (14:35 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:46:08 +0000 (15:46 -0700)
commitd06c2a37382284581812b9b6cc17f3dbb00492f7
tree4028cd198f5aa8a0e6f9e7b0a086752efbd5df77
parent834c35402c34a9f43c68563de57d4cc2c5398465
PCI: Disable IO/MEM decoding for devices with non-compliant BARs

Orabug: 23331067

[ Upstream commit b84106b4e2290c081cdab521fa832596cdfea246 ]

The PCI config header (first 64 bytes of each device's config space) is
defined by the PCI spec so generic software can identify the device and
manage its usage of I/O, memory, and IRQ resources.

Some non-spec-compliant devices put registers other than BARs where the
BARs should be.  When the PCI core sizes these "BARs", the reads and writes
it does may have unwanted side effects, and the "BAR" may appear to
describe non-sensical address space.

Add a flag bit to mark non-compliant devices so we don't touch their BARs.
Turn off IO/MEM decoding to prevent the devices from consuming address
space, since we can't read the BARs to find out what that address space
would be.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Andi Kleen <ak@linux.intel.com>
CC: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit aa57ba13f44426a076ac567e965654453d4be1f1)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/pci/probe.c
include/linux/pci.h