diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2010-04-22 11:02:43 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-04-22 19:13:16 -0400 |
commit | 45aa23b4cbd37408678c96cd113241860d3321f6 (patch) | |
tree | be7881f74ca8c7c1571fe42af09d63493fb5a787 /drivers/pci/probe.c | |
parent | 4352aa5bbf1d0080c2dcf904ce1e4be0a1cb5937 (diff) |
PCI: revert broken device warning
This reverts c519a5a7dab2d. That change added a warning about devices that
didn't respond correctly when sizing BARs, which helped diagnose broken
devices. But the test wasn't specific enough, so it also complained about
working devices with zero-size BARs, e.g.,
https://bugzilla.kernel.org/show_bug.cgi?id=15822
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 882bd8d29fe3..c82548afcd5c 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -174,19 +174,14 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
174 | pci_read_config_dword(dev, pos, &sz); | 174 | pci_read_config_dword(dev, pos, &sz); |
175 | pci_write_config_dword(dev, pos, l); | 175 | pci_write_config_dword(dev, pos, l); |
176 | 176 | ||
177 | if (!sz) | ||
178 | goto fail; /* BAR not implemented */ | ||
179 | |||
180 | /* | 177 | /* |
181 | * All bits set in sz means the device isn't working properly. | 178 | * All bits set in sz means the device isn't working properly. |
182 | * If it's a memory BAR or a ROM, bit 0 must be clear; if it's | 179 | * If the BAR isn't implemented, all bits must be 0. If it's a |
183 | * an io BAR, bit 1 must be clear. | 180 | * memory BAR or a ROM, bit 0 must be clear; if it's an io BAR, bit |
181 | * 1 must be clear. | ||
184 | */ | 182 | */ |
185 | if (sz == 0xffffffff) { | 183 | if (!sz || sz == 0xffffffff) |
186 | dev_err(&dev->dev, "reg %x: invalid size %#x; broken device?\n", | ||
187 | pos, sz); | ||
188 | goto fail; | 184 | goto fail; |
189 | } | ||
190 | 185 | ||
191 | /* | 186 | /* |
192 | * I don't know how l can have all bits set. Copied from old code. | 187 | * I don't know how l can have all bits set. Copied from old code. |
@@ -249,17 +244,13 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
249 | pos, res); | 244 | pos, res); |
250 | } | 245 | } |
251 | } else { | 246 | } else { |
252 | u32 size = pci_size(l, sz, mask); | 247 | sz = pci_size(l, sz, mask); |
253 | 248 | ||
254 | if (!size) { | 249 | if (!sz) |
255 | dev_err(&dev->dev, "reg %x: invalid size " | ||
256 | "(l %#x sz %#x mask %#x); broken device?", | ||
257 | pos, l, sz, mask); | ||
258 | goto fail; | 250 | goto fail; |
259 | } | ||
260 | 251 | ||
261 | res->start = l; | 252 | res->start = l; |
262 | res->end = l + size; | 253 | res->end = l + sz; |
263 | 254 | ||
264 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); | 255 | dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res); |
265 | } | 256 | } |