]> git.baikalelectronics.ru Git - kernel.git/commit
ia64/PCI: Treat all host bridge Address Space Descriptors (even consumers) as windows
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 21 Apr 2015 19:57:26 +0000 (14:57 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 21 Apr 2015 20:29:39 +0000 (15:29 -0500)
commit278ea9ed0d9f8fb053f8c90856f9b5a8f984d782
treedf1d59127854425e1a7356b416c14f19a205da6e
parent209c75f1bb421300eb2c4c95edde7b5b9a39ec06
ia64/PCI: Treat all host bridge Address Space Descriptors (even consumers) as windows

Prior to 2024981b3bab ("PCI: Mark invalid BARs as unassigned"), if we tried
to claim a PCI BAR but could not find an upstream bridge window that
matched it, we complained but still allowed the device to be enabled.

2024981b3bab broke devices that previously worked (mptsas and igb in the
case Tony reported, but it could be any devices) because it marks those
BARs as IORESOURCE_UNSET, which makes pci_enable_device() complain and
return failure:

  igb 0000:81:00.0: can't enable device: BAR 0 [mem size 0x00020000] not assigned
  igb: probe of 0000:81:00.0 failed with error -22

The underlying cause is an ACPI Address Space Descriptor for a PCI host
bridge window that is marked as "consumer".  This is a firmware defect:
resources that are produced on the downstream side of a bridge should be
marked "producer".  But rejecting these BARs that we previously allowed is
a functionality regression, and firmware has not used the producer/consumer
bit consistently, so we can't rely on it anyway.

Stop checking the producer/consumer bit, and assume all bridge Address
Space Descriptors are for bridge windows.

Note that this change does not affect I/O Port or Fixed Location I/O Port
Descriptors, which are commonly used for the [io 0x0cf8-0x0cff] config
access range.  That range is a "consumer" range and should not be treated
as a window.

Fixes: 2024981b3bab ("PCI: Mark invalid BARs as unassigned")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=96961
Reported-and-tested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/ia64/pci/pci.c