Skip to content

Commit 755528c

Browse files
author
Linus Torvalds
committed
Ignore disabled ROM resources at setup
Writing even a disabled value seems to mess up some matrox graphics cards. It may be a card-related issue, but we may also be writing reserved low bits in the result. This was a fall-out of switching x86 over to the generic PCI resource allocation code, and needs more debugging. In particular, the old x86 code defaulted to not doing any resource allocations at all for ROM resources. In the meantime, this has been reported to make X happier by Helge Hafting <helgehaf@aitel.hist.no>. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 26aad69 commit 755528c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pci/setup-res.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
5353
if (resno < 6) {
5454
reg = PCI_BASE_ADDRESS_0 + 4 * resno;
5555
} else if (resno == PCI_ROM_RESOURCE) {
56-
new |= res->flags & IORESOURCE_ROM_ENABLE;
56+
if (!(res->flags & IORESOURCE_ROM_ENABLE))
57+
return;
58+
new |= PCI_ROM_ADDRESS_ENABLE;
5759
reg = dev->rom_base_reg;
5860
} else {
5961
/* Hmm, non-standard resource. */

0 commit comments

Comments
 (0)