aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-res.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r--drivers/pci/setup-res.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index c54526b206b5..5e78f2096ce8 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -51,11 +51,9 @@ void pci_update_resource(struct pci_dev *dev, int resno)
51 51
52 pcibios_resource_to_bus(dev, &region, res); 52 pcibios_resource_to_bus(dev, &region, res);
53 53
54 dev_dbg(&dev->dev, "BAR %d: got res %pR bus [%#llx-%#llx] " 54 dev_dbg(&dev->dev, "BAR %d: got %pRf (bus addr [%#llx-%#llx])\n",
55 "flags %#lx\n", resno, res, 55 resno, res, (unsigned long long)region.start,
56 (unsigned long long)region.start, 56 (unsigned long long)region.end);
57 (unsigned long long)region.end,
58 (unsigned long)res->flags);
59 57
60 new = region.start | (res->flags & PCI_REGION_FLAG_MASK); 58 new = region.start | (res->flags & PCI_REGION_FLAG_MASK);
61 if (res->flags & IORESOURCE_IO) 59 if (res->flags & IORESOURCE_IO)
@@ -91,9 +89,9 @@ void pci_update_resource(struct pci_dev *dev, int resno)
91 } 89 }
92 } 90 }
93 res->flags &= ~IORESOURCE_UNSET; 91 res->flags &= ~IORESOURCE_UNSET;
94 dev_dbg(&dev->dev, "BAR %d: moved to bus [%#llx-%#llx] flags %#lx\n", 92 dev_dbg(&dev->dev, "BAR %d: moved to bus addr [%#llx-%#llx]\n",
95 resno, (unsigned long long)region.start, 93 resno, (unsigned long long)region.start,
96 (unsigned long long)region.end, res->flags); 94 (unsigned long long)region.end);
97} 95}
98 96
99int pci_claim_resource(struct pci_dev *dev, int resource) 97int pci_claim_resource(struct pci_dev *dev, int resource)
@@ -110,7 +108,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
110 108
111 if (err) { 109 if (err) {
112 const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; 110 const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
113 dev_err(&dev->dev, "BAR %d: %s of %s %pR\n", 111 dev_err(&dev->dev, "BAR %d: %s %s %pRt\n",
114 resource, 112 resource,
115 root ? "address space collision on" : 113 root ? "address space collision on" :
116 "no parent found for", 114 "no parent found for",
@@ -181,9 +179,8 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
181 179
182 align = pci_resource_alignment(dev, res); 180 align = pci_resource_alignment(dev, res);
183 if (!align) { 181 if (!align) {
184 dev_info(&dev->dev, "BAR %d: can't allocate resource (bogus " 182 dev_info(&dev->dev, "BAR %d: can't allocate %pRf "
185 "alignment) %pR flags %#lx\n", 183 "(bogus alignment)\n", resno, res);
186 resno, res, res->flags);
187 return -EINVAL; 184 return -EINVAL;
188 } 185 }
189 186
@@ -199,8 +196,8 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
199 } 196 }
200 197
201 if (ret) 198 if (ret)
202 dev_info(&dev->dev, "BAR %d: can't allocate %s resource %pR\n", 199 dev_info(&dev->dev, "BAR %d: can't allocate %pRt\n",
203 resno, res->flags & IORESOURCE_IO ? "I/O" : "mem", res); 200 resno, res);
204 201
205 return ret; 202 return ret;
206} 203}
@@ -225,9 +222,8 @@ void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
225 222
226 r_align = pci_resource_alignment(dev, r); 223 r_align = pci_resource_alignment(dev, r);
227 if (!r_align) { 224 if (!r_align) {
228 dev_warn(&dev->dev, "BAR %d: bogus alignment " 225 dev_warn(&dev->dev, "BAR %d: bogus alignment %pRf\n",
229 "%pR flags %#lx\n", 226 i, r);
230 i, r, r->flags);
231 continue; 227 continue;
232 } 228 }
233 for (list = head; ; list = list->next) { 229 for (list = head; ; list = list->next) {