diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-03 17:13:56 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-03-12 13:30:00 -0400 |
commit | f7834c092c42995e9f3611b7d186e9dfdb8430cc (patch) | |
tree | bfc4f5cf96d818a9eda6ceb5a28759057e039521 /drivers/pnp | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
PNP: Don't check for overlaps with unassigned PCI BARs
After 0509ad5e1a7d ("PNP: disable PNP motherboard resources that overlap
PCI BARs"), we disable and warn about PNP resources that overlap PCI BARs.
But we assume that all PCI BARs are valid, which is incorrect, because a
BAR may not have any space assigned to it. In that case, we will not
enable the BAR, so no other resource can conflict with it.
Ignore PCI BARs that are unassigned, as indicated by IORESOURCE_UNSET.
Firmware often leaves PCI BARs unassigned, containing zero. Zero is a
valid BAR value, so we can't just check for that, but the PCI core can set
IORESOURCE_UNSET when it detects an unassigned BAR by other means. This
should get rid of many of the annoying messages like this:
pnp 00:00: disabling [io 0x0061] because it overlaps 0001:05:00.0 BAR 0 [io 0x0000-0x00ff]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/quirks.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index ebf0d6710b5a..943c1cb9566c 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c | |||
@@ -246,13 +246,16 @@ static void quirk_system_pci_resources(struct pnp_dev *dev) | |||
246 | */ | 246 | */ |
247 | for_each_pci_dev(pdev) { | 247 | for_each_pci_dev(pdev) { |
248 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { | 248 | for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { |
249 | unsigned long type; | 249 | unsigned long flags, type; |
250 | 250 | ||
251 | type = pci_resource_flags(pdev, i) & | 251 | flags = pci_resource_flags(pdev, i); |
252 | (IORESOURCE_IO | IORESOURCE_MEM); | 252 | type = flags & (IORESOURCE_IO | IORESOURCE_MEM); |
253 | if (!type || pci_resource_len(pdev, i) == 0) | 253 | if (!type || pci_resource_len(pdev, i) == 0) |
254 | continue; | 254 | continue; |
255 | 255 | ||
256 | if (flags & IORESOURCE_UNSET) | ||
257 | continue; | ||
258 | |||
256 | pci_start = pci_resource_start(pdev, i); | 259 | pci_start = pci_resource_start(pdev, i); |
257 | pci_end = pci_resource_end(pdev, i); | 260 | pci_end = pci_resource_end(pdev, i); |
258 | for (j = 0; | 261 | for (j = 0; |