Skip to content

Commit

Permalink
PCI: fix nit in ROM BAR size probing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael S. Tsirkin authored and Jesse Barnes committed Nov 4, 2009
1 parent af5a8ee commit 1ed6743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
{
u32 l, sz, mask;

mask = type ? ~PCI_ROM_ADDRESS_ENABLE : ~0;
mask = type ? PCI_ROM_ADDRESS_MASK : ~0;

res->name = pci_name(dev);

pci_read_config_dword(dev, pos, &l);
pci_write_config_dword(dev, pos, mask);
pci_write_config_dword(dev, pos, l | mask);
pci_read_config_dword(dev, pos, &sz);
pci_write_config_dword(dev, pos, l);

Expand Down

0 comments on commit 1ed6743

Please sign in to comment.