linux-mips
[Top] [All Lists]

[PATCH 06/10] MIPS: PCI: Prevent hang on XLP reg read

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 06/10] MIPS: PCI: Prevent hang on XLP reg read
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Mon, 14 Jan 2013 21:41:58 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <1358179922-26663-1-git-send-email-jchandra@broadcom.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1358179922-26663-1-git-send-email-jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
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>
---
 arch/mips/pci/pci-xlp.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/pci/pci-xlp.c b/arch/mips/pci/pci-xlp.c
index fe435fc..5cd95a0 100644
--- a/arch/mips/pci/pci-xlp.c
+++ b/arch/mips/pci/pci-xlp.c
@@ -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;
 }
-- 
1.7.9.5



<Prev in Thread] Current Thread [Next in Thread>