]> git.karo-electronics.de Git - linux-beck.git/commitdiff
MIPS: PCI: Prevent hang on XLP reg read
authorJayachandran C <jchandra@broadcom.com>
Mon, 14 Jan 2013 15:11:58 +0000 (15:11 +0000)
committerJohn Crispin <blogic@openwrt.org>
Sat, 16 Feb 2013 23:15:20 +0000 (00:15 +0100)
Reading PCI extended register at 0x255 on a bridge will hang if there
is no device connected on the link. Make PCI read routine skip this
register.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/4789/
Signed-off-by: John Crispin <blogic@openwrt.org>
arch/mips/pci/pci-xlp.c

index 5077148bd67debc0985834016340c987743db7de..fbf001a068a46611a65d37fd6f63f9f61b44b19f 100644 (file)
@@ -64,8 +64,12 @@ static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn,
        u32 data;
        u32 *cfgaddr;
 
+       where &= ~3;
+       if (bus->number == 0 && PCI_SLOT(devfn) == 1 && where == 0x954)
+               return 0xffffffff;
+
        cfgaddr = (u32 *)(pci_config_base +
-                       pci_cfg_addr(bus->number, devfn, where & ~3));
+                       pci_cfg_addr(bus->number, devfn, where));
        data = *cfgaddr;
        return data;
 }