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.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index e815111f3f81..369d48d6c6f1 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -103,7 +103,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
103 pci_read_config_dword(dev, reg, &check); 103 pci_read_config_dword(dev, reg, &check);
104 104
105 if ((new ^ check) & mask) { 105 if ((new ^ check) & mask) {
106 dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n", 106 pci_err(dev, "BAR %d: error updating (%#08x != %#08x)\n",
107 resno, new, check); 107 resno, new, check);
108 } 108 }
109 109
@@ -112,7 +112,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
112 pci_write_config_dword(dev, reg + 4, new); 112 pci_write_config_dword(dev, reg + 4, new);
113 pci_read_config_dword(dev, reg + 4, &check); 113 pci_read_config_dword(dev, reg + 4, &check);
114 if (check != new) { 114 if (check != new) {
115 dev_err(&dev->dev, "BAR %d: error updating (high %#08x != %#08x)\n", 115 pci_err(dev, "BAR %d: error updating (high %#08x != %#08x)\n",
116 resno, new, check); 116 resno, new, check);
117 } 117 }
118 } 118 }
@@ -137,7 +137,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
137 struct resource *root, *conflict; 137 struct resource *root, *conflict;
138 138
139 if (res->flags & IORESOURCE_UNSET) { 139 if (res->flags & IORESOURCE_UNSET) {
140 dev_info(&dev->dev, "can't claim BAR %d %pR: no address assigned\n", 140 pci_info(dev, "can't claim BAR %d %pR: no address assigned\n",
141 resource, res); 141 resource, res);
142 return -EINVAL; 142 return -EINVAL;
143 } 143 }
@@ -152,7 +152,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
152 152
153 root = pci_find_parent_resource(dev, res); 153 root = pci_find_parent_resource(dev, res);
154 if (!root) { 154 if (!root) {
155 dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", 155 pci_info(dev, "can't claim BAR %d %pR: no compatible bridge window\n",
156 resource, res); 156 resource, res);
157 res->flags |= IORESOURCE_UNSET; 157 res->flags |= IORESOURCE_UNSET;
158 return -EINVAL; 158 return -EINVAL;
@@ -160,7 +160,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
160 160
161 conflict = request_resource_conflict(root, res); 161 conflict = request_resource_conflict(root, res);
162 if (conflict) { 162 if (conflict) {
163 dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", 163 pci_info(dev, "can't claim BAR %d %pR: address conflict with %s %pR\n",
164 resource, res, conflict->name, conflict); 164 resource, res, conflict->name, conflict);
165 res->flags |= IORESOURCE_UNSET; 165 res->flags |= IORESOURCE_UNSET;
166 return -EBUSY; 166 return -EBUSY;
@@ -172,7 +172,7 @@ EXPORT_SYMBOL(pci_claim_resource);
172 172
173void pci_disable_bridge_window(struct pci_dev *dev) 173void pci_disable_bridge_window(struct pci_dev *dev)
174{ 174{
175 dev_info(&dev->dev, "disabling bridge mem windows\n"); 175 pci_info(dev, "disabling bridge mem windows\n");
176 176
177 /* MMIO Base/Limit */ 177 /* MMIO Base/Limit */
178 pci_write_config_dword(dev, PCI_MEMORY_BASE, 0x0000fff0); 178 pci_write_config_dword(dev, PCI_MEMORY_BASE, 0x0000fff0);
@@ -221,11 +221,11 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
221 root = &iomem_resource; 221 root = &iomem_resource;
222 } 222 }
223 223
224 dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n", 224 pci_info(dev, "BAR %d: trying firmware assignment %pR\n",
225 resno, res); 225 resno, res);
226 conflict = request_resource_conflict(root, res); 226 conflict = request_resource_conflict(root, res);
227 if (conflict) { 227 if (conflict) {
228 dev_info(&dev->dev, "BAR %d: %pR conflicts with %s %pR\n", 228 pci_info(dev, "BAR %d: %pR conflicts with %s %pR\n",
229 resno, res, conflict->name, conflict); 229 resno, res, conflict->name, conflict);
230 res->start = start; 230 res->start = start;
231 res->end = end; 231 res->end = end;
@@ -324,7 +324,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
324 res->flags |= IORESOURCE_UNSET; 324 res->flags |= IORESOURCE_UNSET;
325 align = pci_resource_alignment(dev, res); 325 align = pci_resource_alignment(dev, res);
326 if (!align) { 326 if (!align) {
327 dev_info(&dev->dev, "BAR %d: can't assign %pR (bogus alignment)\n", 327 pci_info(dev, "BAR %d: can't assign %pR (bogus alignment)\n",
328 resno, res); 328 resno, res);
329 return -EINVAL; 329 return -EINVAL;
330 } 330 }
@@ -338,19 +338,18 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
338 * working, which is better than just leaving it disabled. 338 * working, which is better than just leaving it disabled.
339 */ 339 */
340 if (ret < 0) { 340 if (ret < 0) {
341 dev_info(&dev->dev, "BAR %d: no space for %pR\n", resno, res); 341 pci_info(dev, "BAR %d: no space for %pR\n", resno, res);
342 ret = pci_revert_fw_address(res, dev, resno, size); 342 ret = pci_revert_fw_address(res, dev, resno, size);
343 } 343 }
344 344
345 if (ret < 0) { 345 if (ret < 0) {
346 dev_info(&dev->dev, "BAR %d: failed to assign %pR\n", resno, 346 pci_info(dev, "BAR %d: failed to assign %pR\n", resno, res);
347 res);
348 return ret; 347 return ret;
349 } 348 }
350 349
351 res->flags &= ~IORESOURCE_UNSET; 350 res->flags &= ~IORESOURCE_UNSET;
352 res->flags &= ~IORESOURCE_STARTALIGN; 351 res->flags &= ~IORESOURCE_STARTALIGN;
353 dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); 352 pci_info(dev, "BAR %d: assigned %pR\n", resno, res);
354 if (resno < PCI_BRIDGE_RESOURCES) 353 if (resno < PCI_BRIDGE_RESOURCES)
355 pci_update_resource(dev, resno); 354 pci_update_resource(dev, resno);
356 355
@@ -372,7 +371,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
372 flags = res->flags; 371 flags = res->flags;
373 res->flags |= IORESOURCE_UNSET; 372 res->flags |= IORESOURCE_UNSET;
374 if (!res->parent) { 373 if (!res->parent) {
375 dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR\n", 374 pci_info(dev, "BAR %d: can't reassign an unassigned resource %pR\n",
376 resno, res); 375 resno, res);
377 return -EINVAL; 376 return -EINVAL;
378 } 377 }
@@ -382,14 +381,14 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
382 ret = _pci_assign_resource(dev, resno, new_size, min_align); 381 ret = _pci_assign_resource(dev, resno, new_size, min_align);
383 if (ret) { 382 if (ret) {
384 res->flags = flags; 383 res->flags = flags;
385 dev_info(&dev->dev, "BAR %d: %pR (failed to expand by %#llx)\n", 384 pci_info(dev, "BAR %d: %pR (failed to expand by %#llx)\n",
386 resno, res, (unsigned long long) addsize); 385 resno, res, (unsigned long long) addsize);
387 return ret; 386 return ret;
388 } 387 }
389 388
390 res->flags &= ~IORESOURCE_UNSET; 389 res->flags &= ~IORESOURCE_UNSET;
391 res->flags &= ~IORESOURCE_STARTALIGN; 390 res->flags &= ~IORESOURCE_STARTALIGN;
392 dev_info(&dev->dev, "BAR %d: reassigned %pR (expanded by %#llx)\n", 391 pci_info(dev, "BAR %d: reassigned %pR (expanded by %#llx)\n",
393 resno, res, (unsigned long long) addsize); 392 resno, res, (unsigned long long) addsize);
394 if (resno < PCI_BRIDGE_RESOURCES) 393 if (resno < PCI_BRIDGE_RESOURCES)
395 pci_update_resource(dev, resno); 394 pci_update_resource(dev, resno);
@@ -401,7 +400,7 @@ void pci_release_resource(struct pci_dev *dev, int resno)
401{ 400{
402 struct resource *res = dev->resource + resno; 401 struct resource *res = dev->resource + resno;
403 402
404 dev_info(&dev->dev, "BAR %d: releasing %pR\n", resno, res); 403 pci_info(dev, "BAR %d: releasing %pR\n", resno, res);
405 release_resource(res); 404 release_resource(res);
406 res->end = resource_size(res) - 1; 405 res->end = resource_size(res) - 1;
407 res->start = 0; 406 res->start = 0;
@@ -477,13 +476,13 @@ int pci_enable_resources(struct pci_dev *dev, int mask)
477 continue; 476 continue;
478 477
479 if (r->flags & IORESOURCE_UNSET) { 478 if (r->flags & IORESOURCE_UNSET) {
480 dev_err(&dev->dev, "can't enable device: BAR %d %pR not assigned\n", 479 pci_err(dev, "can't enable device: BAR %d %pR not assigned\n",
481 i, r); 480 i, r);
482 return -EINVAL; 481 return -EINVAL;
483 } 482 }
484 483
485 if (!r->parent) { 484 if (!r->parent) {
486 dev_err(&dev->dev, "can't enable device: BAR %d %pR not claimed\n", 485 pci_err(dev, "can't enable device: BAR %d %pR not claimed\n",
487 i, r); 486 i, r);
488 return -EINVAL; 487 return -EINVAL;
489 } 488 }
@@ -495,8 +494,7 @@ int pci_enable_resources(struct pci_dev *dev, int mask)
495 } 494 }
496 495
497 if (cmd != old_cmd) { 496 if (cmd != old_cmd) {
498 dev_info(&dev->dev, "enabling device (%04x -> %04x)\n", 497 pci_info(dev, "enabling device (%04x -> %04x)\n", old_cmd, cmd);
499 old_cmd, cmd);
500 pci_write_config_word(dev, PCI_COMMAND, cmd); 498 pci_write_config_word(dev, PCI_COMMAND, cmd);
501 } 499 }
502 return 0; 500 return 0;