diff options
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r-- | drivers/pci/setup-bus.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 827c0a520e2b..3abbfad9ddab 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,40 @@ void __ref pci_bus_assign_resources(struct pci_bus *bus) | |||
530 | } | 531 | } |
531 | EXPORT_SYMBOL(pci_bus_assign_resources); | 532 | EXPORT_SYMBOL(pci_bus_assign_resources); |
532 | 533 | ||
534 | static 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", | ||
544 | bus->number, i, | ||
545 | (res->flags & IORESOURCE_IO) ? "io port" : "mmio", | ||
546 | (unsigned long long) res->start, | ||
547 | (unsigned long long) res->end); | ||
548 | } | ||
549 | } | ||
550 | |||
551 | static void pci_bus_dump_resources(struct pci_bus *bus) | ||
552 | { | ||
553 | struct pci_bus *b; | ||
554 | struct pci_dev *dev; | ||
555 | |||
556 | |||
557 | pci_bus_dump_res(bus); | ||
558 | |||
559 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
560 | b = dev->subordinate; | ||
561 | if (!b) | ||
562 | continue; | ||
563 | |||
564 | pci_bus_dump_resources(b); | ||
565 | } | ||
566 | } | ||
567 | |||
533 | void __init | 568 | void __init |
534 | pci_assign_unassigned_resources(void) | 569 | pci_assign_unassigned_resources(void) |
535 | { | 570 | { |
@@ -545,4 +580,9 @@ pci_assign_unassigned_resources(void) | |||
545 | pci_bus_assign_resources(bus); | 580 | pci_bus_assign_resources(bus); |
546 | pci_enable_bridges(bus); | 581 | pci_enable_bridges(bus); |
547 | } | 582 | } |
583 | |||
584 | /* dump the resource on buses */ | ||
585 | list_for_each_entry(bus, &pci_root_buses, node) { | ||
586 | pci_bus_dump_resources(bus); | ||
587 | } | ||
548 | } | 588 | } |