Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1bef7dc00caa7bcbff4fdb55e599e2591461fafa
Commit:     1bef7dc00caa7bcbff4fdb55e599e2591461fafa
Parent:     05e31754d18169555f2c8b54b5fa8631c6be6e7f
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Sat Sep 29 09:06:21 2007 +1000
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Sep 28 16:21:10 2007 -0700

    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 <[EMAIL PROTECTED]>
    Acked-by: Linas Vepstas <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/pci/quirks.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7dcaa09..50f2dd9 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1444,7 +1444,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, 
PCI_ANY_ID, quirk_netmos);
 static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
 {
        u16 command;
-       u32 bar;
        u8 __iomem *csr;
        u8 cmd_hi;
 
@@ -1476,12 +1475,12 @@ static void __devinit quirk_e100_interrupt(struct 
pci_dev *dev)
         * re-enable them when it's ready.
         */
        pci_read_config_word(dev, PCI_COMMAND, &command);
-       pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar);
 
-       if (!(command & PCI_COMMAND_MEMORY) || !bar)
+       if (!(command & PCI_COMMAND_MEMORY) || !pci_resource_start(dev, 0))
                return;
 
-       csr = ioremap(bar, 8);
+       /* Convert from PCI bus to resource space.  */
+       csr = ioremap(pci_resource_start(dev, 0), 8);
        if (!csr) {
                printk(KERN_WARNING "PCI: Can't map %s e100 registers\n",
                        pci_name(dev));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to