Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190216
b: refs/heads/master
c: 45aa23b
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Apr 22, 2010
1 parent de10a3a commit cf8175c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4352aa5bbf1d0080c2dcf904ce1e4be0a1cb5937
refs/heads/master: 45aa23b4cbd37408678c96cd113241860d3321f6
23 changes: 7 additions & 16 deletions trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,14 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
pci_read_config_dword(dev, pos, &sz);
pci_write_config_dword(dev, pos, l);

if (!sz)
goto fail; /* BAR not implemented */

/*
* All bits set in sz means the device isn't working properly.
* If it's a memory BAR or a ROM, bit 0 must be clear; if it's
* an io BAR, bit 1 must be clear.
* If the BAR isn't implemented, all bits must be 0. If it's a
* memory BAR or a ROM, bit 0 must be clear; if it's an io BAR, bit
* 1 must be clear.
*/
if (sz == 0xffffffff) {
dev_err(&dev->dev, "reg %x: invalid size %#x; broken device?\n",
pos, sz);
if (!sz || sz == 0xffffffff)
goto fail;
}

/*
* I don't know how l can have all bits set. Copied from old code.
Expand Down Expand Up @@ -249,17 +244,13 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
pos, res);
}
} else {
u32 size = pci_size(l, sz, mask);
sz = pci_size(l, sz, mask);

if (!size) {
dev_err(&dev->dev, "reg %x: invalid size "
"(l %#x sz %#x mask %#x); broken device?",
pos, l, sz, mask);
if (!sz)
goto fail;
}

res->start = l;
res->end = l + size;
res->end = l + sz;

dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
}
Expand Down

0 comments on commit cf8175c

Please sign in to comment.