Commit bae651dd authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds

[PATCH] 2.5.18: unnamed PCI bus resources

As pointed out by Russell King, resource name pointers
of the secondary PCI buses are left uninitialized in the
non-x86 PCI allocation path.

Assigning these pointers in pci_add_new_bus() fixes the problem.
parent 7304ada2
......@@ -151,7 +151,6 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
res->start = base;
res->end = limit + 0xfff;
res->name = child->name;
} else {
/*
* Ugh. We don't know enough about this bridge. Just assume
......@@ -170,7 +169,6 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
res->start = base;
res->end = limit + 0xfffff;
res->name = child->name;
} else {
/* See comment above. Same thing */
printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 1);
......@@ -201,7 +199,6 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
res->start = base;
res->end = limit + 0xfffff;
res->name = child->name;
} else {
/* See comments above */
printk(KERN_ERR "Unknown bridge resource %d: assuming transparent\n", 2);
......@@ -248,9 +245,11 @@ struct pci_bus * __devinit pci_add_new_bus(struct pci_bus *parent, struct pci_de
child->primary = parent->secondary;
child->subordinate = 0xff;
/* Set up default resource pointers.. */
for (i = 0; i < 4; i++)
/* Set up default resource pointers and names.. */
for (i = 0; i < 4; i++) {
child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
child->resource[i]->name = child->name;
}
return child;
}
......
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