linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Mon, 11 Apr 2005 13:47:03 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/04/11 13:46:57

Modified files:
        arch/mips/pci  : fixup-cobalt.c ops-gt64111.c 
        arch/mips/cobalt: irq.c 
        include/asm-mips/cobalt: cobalt.h 

Log message:
        Add PCI retry error handler. We can drop the check for the device #6
        from pci_range_ck() as we now get a diagnostic message and the kernel
        continues the boot.

diff -urN linux/arch/mips/pci/fixup-cobalt.c linux/arch/mips/pci/fixup-cobalt.c
--- linux/arch/mips/pci/fixup-cobalt.c  2005/03/04 15:13:37     1.10
+++ linux/arch/mips/pci/fixup-cobalt.c  2005/04/11 12:46:57     1.11
@@ -102,7 +102,14 @@
                /* XXX WE MUST DO THIS ELSE GALILEO LOCKS UP! -DaveM */
                timeo = GALILEO_INL(GT_PCI0_TOR_OFS);
                /* Old Galileo, assumes PCI STOP line to VIA is disconnected. */
-               GALILEO_OUTL(0xffff, GT_PCI0_TOR_OFS);
+               GALILEO_OUTL(
+                       (0xff << 16) |          /* retry count */
+                       (0xff << 8) |           /* timeout 1   */
+                       0xff,                   /* timeout 0   */
+                       GT_PCI0_TOR_OFS);
+
+               /* enable PCI retry exceeded interrupt */
+               GALILEO_OUTL(GALILEO_INTR_RETRY_CTR | 
GALILEO_INL(GT_INTRMASK_OFS), GT_INTRMASK_OFS);
        }
 }
 
diff -urN linux/arch/mips/pci/ops-gt64111.c linux/arch/mips/pci/ops-gt64111.c
--- linux/arch/mips/pci/ops-gt64111.c   2005/03/04 15:13:37     1.2
+++ linux/arch/mips/pci/ops-gt64111.c   2005/04/11 12:46:57     1.3
@@ -18,21 +18,13 @@
 #include <asm/cobalt/cobalt.h>
 
 /*
- * Accessing device 31 hangs the GT64120.  Not sure if this will also hang
- * the GT64111, let's be paranoid for now.
- *
- * Accessing device COBALT_PCICONF_CPU hangs early units.
+ * Device 31 on the GT64111 is used to generate PCI special
+ * cycles, so we shouldn't expected to find a device there ...
  */
 static inline int pci_range_ck(struct pci_bus *bus, unsigned int devfn)
 {
-       unsigned slot;
-
-       if (bus->number == 0) {
-
-               slot = PCI_SLOT(devfn);
-               if (slot != COBALT_PCICONF_CPU && slot < 31)
-                       return 0;
-       }
+       if (bus->number == 0 && PCI_SLOT(devfn) < 31)
+               return 0;
 
        return -1;
 }
diff -urN linux/arch/mips/cobalt/irq.c linux/arch/mips/cobalt/irq.c
--- linux/arch/mips/cobalt/irq.c        2005/04/11 12:42:08     1.12
+++ linux/arch/mips/cobalt/irq.c        2005/04/11 12:46:57     1.13
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/pci.h>
 
 #include <asm/i8259.h>
 #include <asm/irq_cpu.h>
@@ -45,7 +46,7 @@
 
 static inline void galileo_irq(struct pt_regs *regs)
 {
-       unsigned int mask, pending;
+       unsigned int mask, pending, devfn;
 
        mask = GALILEO_INL(GT_INTRMASK_OFS);
        pending = GALILEO_INL(GT_INTRCAUSE_OFS) & mask;
@@ -55,6 +56,13 @@
                GALILEO_OUTL(~GALILEO_INTR_T0EXP, GT_INTRCAUSE_OFS);
                do_IRQ(COBALT_GALILEO_IRQ, regs);
 
+       } else if (pending & GALILEO_INTR_RETRY_CTR) {
+
+               devfn = GALILEO_INL(GT_PCI0_CFGADDR_OFS) >> 8;
+               GALILEO_OUTL(~GALILEO_INTR_RETRY_CTR, GT_INTRCAUSE_OFS);
+               printk(KERN_WARNING "Galileo: PCI retry count exceeded 
(%02x.%u)\n",
+                       PCI_SLOT(devfn), PCI_FUNC(devfn));
+
        } else {
 
                GALILEO_OUTL(mask & ~pending, GT_INTRMASK_OFS);
diff -urN linux/include/asm-mips/cobalt/cobalt.h 
linux/include/asm-mips/cobalt/cobalt.h
--- linux/include/asm-mips/cobalt/cobalt.h      2005/04/11 12:42:08     1.14
+++ linux/include/asm-mips/cobalt/cobalt.h      2005/04/11 12:46:57     1.15
@@ -87,6 +87,7 @@
 } while (0)
 
 #define GALILEO_INTR_T0EXP     (1 << 8)
+#define GALILEO_INTR_RETRY_CTR (1 << 20)
 
 #define GALILEO_ENTC0          0x01
 #define GALILEO_SELTC0         0x02

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