diff options
author | David S. Miller <davem@davemloft.net> | 2014-08-13 02:27:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-14 00:17:49 -0400 |
commit | 4afba24e5fc2626a3c604ec990539572f6662ff9 (patch) | |
tree | 9747dae7206d7aa396ece4c22397d81ba848eba5 /arch | |
parent | 93a6423bd84d977bd768a001c6c3868e6a20b63a (diff) |
sparc64: Skip bogus PCI bridge ranges.
It seems that when a PCI Express bridge is not in use and has no devices
behind it, the ranges property is bogus. Specifically the size property
is of the form [0xffffffff:...], and if you add this size to the resource
start address the 64-bit calculation will overflow.
Just check specifically for this size value signature and skip them.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/kernel/pci.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index da24fb6deb03..cc4c31e5185e 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -489,6 +489,17 @@ static void of_scan_pci_bridge(struct pci_pbm_info *pbm, | |||
489 | size = GET_64BIT(ranges, 6); | 489 | size = GET_64BIT(ranges, 6); |
490 | if (flags == 0 || size == 0) | 490 | if (flags == 0 || size == 0) |
491 | continue; | 491 | continue; |
492 | |||
493 | /* On PCI-Express systems, PCI bridges that have no devices downstream | ||
494 | * have a bogus size value where the first 32-bit cell is 0xffffffff. | ||
495 | * This results in a bogus range where start + size overflows. | ||
496 | * | ||
497 | * Just skip these otherwise the kernel will complain when the resource | ||
498 | * tries to be claimed. | ||
499 | */ | ||
500 | if (size >> 32 == 0xffffffff) | ||
501 | continue; | ||
502 | |||
492 | if (flags & IORESOURCE_IO) { | 503 | if (flags & IORESOURCE_IO) { |
493 | res = bus->resource[0]; | 504 | res = bus->resource[0]; |
494 | if (res->flags) { | 505 | if (res->flags) { |