aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-04-14 17:26:50 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-23 12:47:20 -0400
commit26370fc6647b63eefb85a675382d661d0fed30a1 (patch)
treeff504a0d7bcca78b3250dc6652ff16ce80e190d1
parent31e9dd2565a6e27a3e698d7e3adf929db8d6c767 (diff)
PCI: Don't print anything while decoding is disabled
If the console is a PCI device, and we try to print to it while its decoding is disabled, the system will hang. This particular printk hasn't caused a problem yet, but it could, so this fixes it. See also 0ff9514b579b ("PCI: Don't print anything while decoding is disabled"). Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/probe.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index dd710b12d34c..3bc149b848a8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -174,7 +174,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
174 u64 l64, sz64, mask64; 174 u64 l64, sz64, mask64;
175 u16 orig_cmd; 175 u16 orig_cmd;
176 struct pci_bus_region region, inverted_region; 176 struct pci_bus_region region, inverted_region;
177 bool bar_too_big = false, bar_too_high = false; 177 bool bar_too_big = false, bar_too_high = false, bar_invalid = false;
178 178
179 mask = type ? PCI_ROM_ADDRESS_MASK : ~0; 179 mask = type ? PCI_ROM_ADDRESS_MASK : ~0;
180 180
@@ -289,11 +289,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
289 * be claimed by the device. 289 * be claimed by the device.
290 */ 290 */
291 if (inverted_region.start != region.start) { 291 if (inverted_region.start != region.start) {
292 dev_info(&dev->dev, "reg 0x%x: initial BAR value %pa invalid; forcing reassignment\n",
293 pos, &region.start);
294 res->flags |= IORESOURCE_UNSET; 292 res->flags |= IORESOURCE_UNSET;
295 res->end -= res->start;
296 res->start = 0; 293 res->start = 0;
294 res->end = region.end - region.start;
295 bar_invalid = true;
297 } 296 }
298 297
299 goto out; 298 goto out;
@@ -312,6 +311,9 @@ out:
312 if (bar_too_high) 311 if (bar_too_high)
313 dev_info(&dev->dev, "reg 0x%x: can't handle BAR above 4G (bus address %#010llx)\n", 312 dev_info(&dev->dev, "reg 0x%x: can't handle BAR above 4G (bus address %#010llx)\n",
314 pos, (unsigned long long) l64); 313 pos, (unsigned long long) l64);
314 if (bar_invalid)
315 dev_info(&dev->dev, "reg 0x%x: initial BAR value %#010llx invalid\n",
316 pos, (unsigned long long) region.start);
315 if (res->flags) 317 if (res->flags)
316 dev_printk(KERN_DEBUG, &dev->dev, "reg 0x%x: %pR\n", pos, res); 318 dev_printk(KERN_DEBUG, &dev->dev, "reg 0x%x: %pR\n", pos, res);
317 319