Subject: [PATCH] sparc/PCI: check overlapping mmio64 with mmio for root bus
Found one system have overlapping between mmio64 and mmio:
/pci@1d,700000: TOMATILLO PCI Bus Module ver[4:0]
/pci@1d,700000: PCI IO [io 0x7c601000000-0x7c601ffffff] offset 7c601000000
/pci@1d,700000: PCI MEM [mem 0x7c700000000-0x7c7ffffffff] offset 7c700000000
/pci@1d,700000: PCI MEM64 [mem 0x7c700000000-0x7c7ffffffff] offset 7c700000000
PCI: Scanning PBM /pci@1d,700000
schizo f00859d4: PCI host bridge to bus 0003:00
pci_bus 0003:00: root bus resource [io 0x7c601000000-0x7c601ffffff] (bus address [0x0000-0xffffff])
pci_bus 0003:00: root bus resource [mem 0x7c700000000-0x7c7ffffffff] (bus address [0x00000000-0xffffffff])
pci_bus 0003:00: root bus resource [mem 0x7c700000000-0x7c7ffffffff] (bus address [0x00000000-0xffffffff])
so add checking for overlapping, and skip that mem64.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/sparc/kernel/pci_common.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
===================================================================
@@ -483,12 +483,17 @@ void pci_determine_mem_io_space(struct p
if (mem64_offset != pbm->mem_offset)
panic("mem offset %llx != mem64 offset %llx\n",
pbm->mem_offset, mem64_offset);
+ if (pbm->mem64_space.start <= pbm->mem_space.end)
+ pbm->mem64_space.start = pbm->mem_space.end + 1;
+ if (pbm->mem64_space.start > pbm->mem64_space.end)
+ pbm->mem64_space.flags = 0;
} else
pbm->mem_offset = mem64_offset;
+ }
+ if (pbm->mem64_space.flags)
printk("%s: PCI MEM64 %pR offset %llx\n",
pbm->name, &pbm->mem64_space, pbm->mem_offset);
- }
pbm->io_space.name = pbm->mem_space.name = pbm->name;
pbm->mem64_space.name = pbm->name;