aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/probe.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 233d1c275d96..d3009430eab6 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -316,13 +316,17 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
316 limit |= (io_limit_hi << 16); 316 limit |= (io_limit_hi << 16);
317 } 317 }
318 318
319 if (base <= limit) { 319 if (base && base <= limit) {
320 res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO; 320 res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
321 if (!res->start) 321 if (!res->start)
322 res->start = base; 322 res->start = base;
323 if (!res->end) 323 if (!res->end)
324 res->end = limit + 0xfff; 324 res->end = limit + 0xfff;
325 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); 325 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
326 } else {
327 dev_printk(KERN_DEBUG, &dev->dev,
328 " bridge window [io %04lx - %04lx] reg reading\n",
329 base, limit);
326 } 330 }
327 331
328 res = child->resource[1]; 332 res = child->resource[1];
@@ -330,11 +334,15 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
330 pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo); 334 pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo);
331 base = (mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16; 335 base = (mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16;
332 limit = (mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16; 336 limit = (mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16;
333 if (base <= limit) { 337 if (base && base <= limit) {
334 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; 338 res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
335 res->start = base; 339 res->start = base;
336 res->end = limit + 0xfffff; 340 res->end = limit + 0xfffff;
337 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); 341 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
342 } else {
343 dev_printk(KERN_DEBUG, &dev->dev,
344 " bridge window [mem 0x%08lx - 0x%08lx] reg reading\n",
345 base, limit + 0xfffff);
338 } 346 }
339 347
340 res = child->resource[2]; 348 res = child->resource[2];
@@ -366,7 +374,7 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
366#endif 374#endif
367 } 375 }
368 } 376 }
369 if (base <= limit) { 377 if (base && base <= limit) {
370 res->flags = (mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) | 378 res->flags = (mem_base_lo & PCI_PREF_RANGE_TYPE_MASK) |
371 IORESOURCE_MEM | IORESOURCE_PREFETCH; 379 IORESOURCE_MEM | IORESOURCE_PREFETCH;
372 if (res->flags & PCI_PREF_RANGE_TYPE_64) 380 if (res->flags & PCI_PREF_RANGE_TYPE_64)
@@ -374,6 +382,10 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
374 res->start = base; 382 res->start = base;
375 res->end = limit + 0xfffff; 383 res->end = limit + 0xfffff;
376 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); 384 dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res);
385 } else {
386 dev_printk(KERN_DEBUG, &dev->dev,
387 " bridge window [mem 0x%08lx - %08lx pref] reg reading\n",
388 base, limit + 0xfffff);
377 } 389 }
378} 390}
379 391