Commit 97a71c39 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc64: Some small pci fixes

This patch fixes a few issues in the ppc64 pci code, notably some
incorrect parsing of Open Firmware "ranges" when setting up host
bridge resources that would cause a problem with some future
platforms, a default mapping of the ISA IOs if the OF "isa" node
lacks a "ranges" property, and a safeguard in pci_scan_all_fns()
in case a pci<->OF node mapping cannot be established.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e631c40f
......@@ -585,9 +585,11 @@ static void __devinit pci_process_ISA_OF_ranges(struct device_node *isa_node,
int rlen = 0;
range = (struct isa_range *) get_property(isa_node, "ranges", &rlen);
if (rlen < sizeof(struct isa_range)) {
printk(KERN_ERR "unexpected isa range size: %s\n",
__FUNCTION__);
if (range == NULL || (rlen < sizeof(struct isa_range))) {
printk(KERN_ERR "no ISA ranges or unexpected isa range size,"
"mapping 64k\n");
__ioremap_explicit(phb_io_base_phys, (unsigned long)phb_io_base_virt,
0x10000, _PAGE_NO_CACHE);
return;
}
......@@ -652,8 +654,7 @@ void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
cpu_phys_addr = cpu_phys_addr << 32 | ranges[4];
size = (unsigned long)ranges[na+3] << 32 | ranges[na+4];
switch (ranges[0] >> 24) {
switch ((ranges[0] >> 24) & 0x3) {
case 1: /* I/O space */
hose->io_base_phys = cpu_phys_addr;
hose->pci_io_size = size;
......@@ -862,6 +863,9 @@ int pcibios_scan_all_fns(struct pci_bus *bus, int devfn)
else
busdn = bus->sysdata; /* must be a phb */
if (busdn == NULL)
return 0;
/*
* Check to see if there is any of the 8 functions are in the
* device tree. If they are then we need to scan all the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment