Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix bogus PCI quirk for e100

Linas reported me that some machines were crashing at boot in
quirk_e100_interrupt. It appears that this quirk is doing an ioremap
directly on a PCI BAR value, which isn't legal and will cause all sorts
of bad things to happen on architectures where PCI BARs don't directly
match processor bus addresses.

This fixes it by using the proper PCI resources instead which is possible
since the quirk has been moved by a previous commit to happen late enough
for that.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Benjamin Herrenschmidt and committed by
Linus Torvalds
1bef7dc0 05e31754

+3 -4
+3 -4
drivers/pci/quirks.c
··· 1444 1444 static void __devinit quirk_e100_interrupt(struct pci_dev *dev) 1445 1445 { 1446 1446 u16 command; 1447 - u32 bar; 1448 1447 u8 __iomem *csr; 1449 1448 u8 cmd_hi; 1450 1449 ··· 1475 1476 * re-enable them when it's ready. 1476 1477 */ 1477 1478 pci_read_config_word(dev, PCI_COMMAND, &command); 1478 - pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar); 1479 1479 1480 - if (!(command & PCI_COMMAND_MEMORY) || !bar) 1480 + if (!(command & PCI_COMMAND_MEMORY) || !pci_resource_start(dev, 0)) 1481 1481 return; 1482 1482 1483 - csr = ioremap(bar, 8); 1483 + /* Convert from PCI bus to resource space. */ 1484 + csr = ioremap(pci_resource_start(dev, 0), 8); 1484 1485 if (!csr) { 1485 1486 printk(KERN_WARNING "PCI: Can't map %s e100 registers\n", 1486 1487 pci_name(dev));