aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-bus.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-11-04 12:32:57 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-11-04 16:06:44 -0500
commit865df576e8fc70daf297b53e61a4fbefc719d065 (patch)
tree59abb13e1dd402bf8cb4496ab94bbceb2ac2ee2b /drivers/pci/setup-bus.c
parent0207c356ef0e2bae6ce4603080d42c130d7debc6 (diff)
PCI: improve discovery/configuration messages
This makes PCI resource management messages more consistent and adds a few new messages to aid debugging. Whenever we assign resources to a device, update a BAR, or change a bridge aperture, it's worth noting it. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r--drivers/pci/setup-bus.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ed6916bac675..502d1704c533 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -74,8 +74,8 @@ void pci_setup_cardbus(struct pci_bus *bus)
74 struct resource *res; 74 struct resource *res;
75 struct pci_bus_region region; 75 struct pci_bus_region region;
76 76
77 dev_info(&bridge->dev, "CardBus bridge, secondary bus %04x:%02x\n", 77 dev_info(&bridge->dev, "CardBus bridge to [bus %02x-%02x]\n",
78 pci_domain_nr(bus), bus->number); 78 bus->secondary, bus->subordinate);
79 79
80 res = bus->resource[0]; 80 res = bus->resource[0];
81 pcibios_resource_to_bus(bridge, &region, res); 81 pcibios_resource_to_bus(bridge, &region, res);
@@ -145,8 +145,8 @@ static void pci_setup_bridge(struct pci_bus *bus)
145 if (pci_is_enabled(bridge)) 145 if (pci_is_enabled(bridge))
146 return; 146 return;
147 147
148 dev_info(&bridge->dev, "PCI bridge, secondary bus %04x:%02x\n", 148 dev_info(&bridge->dev, "PCI bridge to [bus %02x-%02x]\n",
149 pci_domain_nr(bus), bus->number); 149 bus->secondary, bus->subordinate);
150 150
151 /* Set up the top and bottom of the PCI I/O segment for this bus. */ 151 /* Set up the top and bottom of the PCI I/O segment for this bus. */
152 res = bus->resource[0]; 152 res = bus->resource[0];
@@ -338,6 +338,10 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size)
338#endif 338#endif
339 size = ALIGN(size + size1, 4096); 339 size = ALIGN(size + size1, 4096);
340 if (!size) { 340 if (!size) {
341 if (b_res->start || b_res->end)
342 dev_info(&bus->self->dev, "disabling bridge window "
343 "%pR to [bus %02x-%02x] (unused)\n", b_res,
344 bus->secondary, bus->subordinate);
341 b_res->flags = 0; 345 b_res->flags = 0;
342 return; 346 return;
343 } 347 }
@@ -383,8 +387,9 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
383 align = pci_resource_alignment(dev, r); 387 align = pci_resource_alignment(dev, r);
384 order = __ffs(align) - 20; 388 order = __ffs(align) - 20;
385 if (order > 11) { 389 if (order > 11) {
386 dev_warn(&dev->dev, "BAR %d: bad alignment %llx: " 390 dev_warn(&dev->dev, "disabling BAR %d: %pR "
387 "%pR\n", i, (unsigned long long)align, r); 391 "(bad alignment %#llx)\n", i, r,
392 (unsigned long long) align);
388 r->flags = 0; 393 r->flags = 0;
389 continue; 394 continue;
390 } 395 }
@@ -418,6 +423,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
418 } 423 }
419 size = ALIGN(size, min_align); 424 size = ALIGN(size, min_align);
420 if (!size) { 425 if (!size) {
426 if (b_res->start || b_res->end)
427 dev_info(&bus->self->dev, "disabling bridge window "
428 "%pR to [bus %02x-%02x] (unused)\n", b_res,
429 bus->secondary, bus->subordinate);
421 b_res->flags = 0; 430 b_res->flags = 0;
422 return 1; 431 return 1;
423 } 432 }