Commit 761a3ac0 authored by Jon Smirl's avatar Jon Smirl Committed by Linus Torvalds

[PATCH] PCI: Adjust PCI rom code to handle more broken ROMs

There are ROMs reporting that their size exceeds their PCI ROM
resource window. This patch returns the minimum of the resource window
size or the size in the ROM.  An example of this breakage is the XGI
Volari Z7.
Signed-off-by: default avatarJon Smirl <jonsmirl@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e96e2f14
...@@ -125,7 +125,9 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) ...@@ -125,7 +125,9 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
image += readw(pds + 16) * 512; image += readw(pds + 16) * 512;
} while (!last_image); } while (!last_image);
*size = image - rom; /* never return a size larger than the PCI resource window */
/* there are known ROMs that get the size wrong */
*size = min((size_t)(image - rom), *size);
return rom; return rom;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment