diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2009-10-29 11:24:59 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-04 11:59:40 -0500 |
commit | 1ed6743918abbec69c0f0b725fa56e3c3248bbab (patch) | |
tree | 01ea3d9aaf84746e42c4852c7e3c5295e1b42ce0 /drivers/pci/probe.c | |
parent | af5a8ee05404112f38fb2904747c688bdc31a746 (diff) |
PCI: fix nit in ROM BAR size probing
When probing for ROM BAR size, we should not change bits 1:10 in this
BAR, because these bits are marked as "reserved for future use" in PCI
spec, so changing them might have side effects.
No such issue for I/O or memory, as there is an implementation note in
PCI spec which explicitly allows writing 0xfffffffff there.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index bb2cc39b64ff..9cefc54a0125 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -165,12 +165,12 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
165 | { | 165 | { |
166 | u32 l, sz, mask; | 166 | u32 l, sz, mask; |
167 | 167 | ||
168 | mask = type ? ~PCI_ROM_ADDRESS_ENABLE : ~0; | 168 | mask = type ? PCI_ROM_ADDRESS_MASK : ~0; |
169 | 169 | ||
170 | res->name = pci_name(dev); | 170 | res->name = pci_name(dev); |
171 | 171 | ||
172 | pci_read_config_dword(dev, pos, &l); | 172 | pci_read_config_dword(dev, pos, &l); |
173 | pci_write_config_dword(dev, pos, mask); | 173 | pci_write_config_dword(dev, pos, l | mask); |
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 | ||