aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-bus.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-01-21 05:08:31 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-02-14 11:44:58 -0500
commitb592443d9045f0880eb4d8cc9125075744db4b9e (patch)
treee8f6d1d49f67f3558ae18b9bde41328a6856569c /drivers/pci/setup-bus.c
parentbffc56d41102705d809f88c29918a9c33d2900f7 (diff)
PCI: add debug print out for add_size
For use in debugging resource reallocation. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/setup-bus.c')
-rw-r--r--drivers/pci/setup-bus.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index c845d18bb126..ae0b1f2c9e0a 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -118,10 +118,13 @@ static resource_size_t get_res_add_size(struct list_head *head,
118 118
119 list_for_each_entry(dev_res, head, list) { 119 list_for_each_entry(dev_res, head, list) {
120 if (dev_res->res == res) { 120 if (dev_res->res == res) {
121 int idx = res - &dev_res->dev->resource[0];
122
121 dev_printk(KERN_DEBUG, &dev_res->dev->dev, 123 dev_printk(KERN_DEBUG, &dev_res->dev->dev,
122 "%pR get_res_add_size add_size %llx\n", 124 "res[%d]=%pR get_res_add_size add_size %llx\n",
123 dev_res->res, 125 idx, dev_res->res,
124 (unsigned long long)dev_res->add_size); 126 (unsigned long long)dev_res->add_size);
127
125 return dev_res->add_size; 128 return dev_res->add_size;
126 } 129 }
127 } 130 }
@@ -260,8 +263,9 @@ static void reassign_resources_sorted(struct list_head *realloc_head,
260 if (pci_reassign_resource(add_res->dev, idx, 263 if (pci_reassign_resource(add_res->dev, idx,
261 add_size, align)) 264 add_size, align))
262 dev_printk(KERN_DEBUG, &add_res->dev->dev, 265 dev_printk(KERN_DEBUG, &add_res->dev->dev,
263 "failed to add optional resources res=%pR\n", 266 "failed to add %llx res[%d]=%pR\n",
264 res); 267 (unsigned long long)add_size,
268 idx, res);
265 } 269 }
266out: 270out:
267 list_del(&add_res->list); 271 list_del(&add_res->list);
@@ -760,8 +764,12 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
760 b_res->start = 4096; 764 b_res->start = 4096;
761 b_res->end = b_res->start + size0 - 1; 765 b_res->end = b_res->start + size0 - 1;
762 b_res->flags |= IORESOURCE_STARTALIGN; 766 b_res->flags |= IORESOURCE_STARTALIGN;
763 if (size1 > size0 && realloc_head) 767 if (size1 > size0 && realloc_head) {
764 add_to_list(realloc_head, bus->self, b_res, size1-size0, 4096); 768 add_to_list(realloc_head, bus->self, b_res, size1-size0, 4096);
769 dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "
770 "%pR to [bus %02x-%02x] add_size %lx\n", b_res,
771 bus->secondary, bus->subordinate, size1-size0);
772 }
765} 773}
766 774
767/** 775/**
@@ -873,8 +881,12 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
873 b_res->start = min_align; 881 b_res->start = min_align;
874 b_res->end = size0 + min_align - 1; 882 b_res->end = size0 + min_align - 1;
875 b_res->flags |= IORESOURCE_STARTALIGN | mem64_mask; 883 b_res->flags |= IORESOURCE_STARTALIGN | mem64_mask;
876 if (size1 > size0 && realloc_head) 884 if (size1 > size0 && realloc_head) {
877 add_to_list(realloc_head, bus->self, b_res, size1-size0, min_align); 885 add_to_list(realloc_head, bus->self, b_res, size1-size0, min_align);
886 dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "
887 "%pR to [bus %02x-%02x] add_size %llx\n", b_res,
888 bus->secondary, bus->subordinate, (unsigned long long)size1-size0);
889 }
878 return 1; 890 return 1;
879} 891}
880 892