diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-10-14 10:13:31 -0400 |
---|---|---|
committer | Kyle McMartin <kyle@shortfin.cabal.ca> | 2007-10-18 15:34:22 -0400 |
commit | 9611f61eb5baf22b6b6ed46c2c196c10e1fade6a (patch) | |
tree | 30bd8d782abc42a6f8b553f4c33bbba2dc8f9a31 /arch | |
parent | 26f0324922e50e0ef7677aaf96287b862c2fec61 (diff) |
[PARISC] Fix infinite loop in /proc/iomem
pcibios_link_hba_resources() could corrupt the resource tree by inserting
resources in the wrong place. Fix this by calling pci_claim_resource()
for PCI-PCI bridges. Delete pcibios_link_hba_resources as we shouldn't
need it any more. Also get rid of lba_claim_dev_resources() and just
call pci_claim_resource() directly.
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/pci.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 563df0072dee..8263d490b1b7 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c | |||
@@ -194,31 +194,6 @@ void __init pcibios_init_bus(struct pci_bus *bus) | |||
194 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl); | 194 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl); |
195 | } | 195 | } |
196 | 196 | ||
197 | |||
198 | /* KLUGE: Link the child and parent resources - generic PCI didn't */ | ||
199 | static void | ||
200 | pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) | ||
201 | { | ||
202 | if (!r->parent) { | ||
203 | printk(KERN_EMERG "PCI: resource not parented! [%p-%p]\n", | ||
204 | (void*) r->start, (void*) r->end); | ||
205 | r->parent = hba_res; | ||
206 | |||
207 | /* reverse link is harder *sigh* */ | ||
208 | if (r->parent->child) { | ||
209 | if (r->parent->sibling) { | ||
210 | struct resource *next = r->parent->sibling; | ||
211 | while (next->sibling) | ||
212 | next = next->sibling; | ||
213 | next->sibling = r; | ||
214 | } else { | ||
215 | r->parent->sibling = r; | ||
216 | } | ||
217 | } else | ||
218 | r->parent->child = r; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | /* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */ | 197 | /* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */ |
223 | void __devinit pcibios_resource_to_bus(struct pci_dev *dev, | 198 | void __devinit pcibios_resource_to_bus(struct pci_dev *dev, |
224 | struct pci_bus_region *region, struct resource *res) | 199 | struct pci_bus_region *region, struct resource *res) |
@@ -245,13 +220,6 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, | |||
245 | DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", | 220 | DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", |
246 | bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", | 221 | bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", |
247 | region->start, region->end); | 222 | region->start, region->end); |
248 | |||
249 | /* KLUGE ALERT | ||
250 | ** if this resource isn't linked to a "parent", then it seems | ||
251 | ** to be a child of the HBA - lets link it in. | ||
252 | */ | ||
253 | pcibios_link_hba_resources(&hba->io_space, bus->resource[0]); | ||
254 | pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]); | ||
255 | } | 223 | } |
256 | 224 | ||
257 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 225 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |