aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r--drivers/pci/setup-bus.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 827c0a520e2b..1aad599816f7 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -352,11 +352,12 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long
352 continue; 352 continue;
353 r_size = r->end - r->start + 1; 353 r_size = r->end - r->start + 1;
354 /* For bridges size != alignment */ 354 /* For bridges size != alignment */
355 align = (i < PCI_BRIDGE_RESOURCES) ? r_size : r->start; 355 align = resource_alignment(r);
356 order = __ffs(align) - 20; 356 order = __ffs(align) - 20;
357 if (order > 11) { 357 if (order > 11) {
358 dev_warn(&dev->dev, "BAR %d too large: " 358 dev_warn(&dev->dev, "BAR %d bad alignment %llx: "
359 "%#016llx-%#016llx\n", i, 359 "%#016llx-%#016llx\n", i,
360 (unsigned long long)align,
360 (unsigned long long)r->start, 361 (unsigned long long)r->start,
361 (unsigned long long)r->end); 362 (unsigned long long)r->end);
362 r->flags = 0; 363 r->flags = 0;
@@ -530,6 +531,36 @@ void __ref pci_bus_assign_resources(struct pci_bus *bus)
530} 531}
531EXPORT_SYMBOL(pci_bus_assign_resources); 532EXPORT_SYMBOL(pci_bus_assign_resources);
532 533
534static void pci_bus_dump_res(struct pci_bus *bus)
535{
536 int i;
537
538 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
539 struct resource *res = bus->resource[i];
540 if (!res)
541 continue;
542
543 printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end);
544 }
545}
546
547static void pci_bus_dump_resources(struct pci_bus *bus)
548{
549 struct pci_bus *b;
550 struct pci_dev *dev;
551
552
553 pci_bus_dump_res(bus);
554
555 list_for_each_entry(dev, &bus->devices, bus_list) {
556 b = dev->subordinate;
557 if (!b)
558 continue;
559
560 pci_bus_dump_resources(b);
561 }
562}
563
533void __init 564void __init
534pci_assign_unassigned_resources(void) 565pci_assign_unassigned_resources(void)
535{ 566{
@@ -545,4 +576,9 @@ pci_assign_unassigned_resources(void)
545 pci_bus_assign_resources(bus); 576 pci_bus_assign_resources(bus);
546 pci_enable_bridges(bus); 577 pci_enable_bridges(bus);
547 } 578 }
579
580 /* dump the resource on buses */
581 list_for_each_entry(bus, &pci_root_buses, node) {
582 pci_bus_dump_resources(bus);
583 }
548} 584}