linux-mips
[Top] [All Lists]

Indigo2 patch

To: Linux SGI <linux@cthulhu.engr.sgi.com>
Subject: Indigo2 patch
From: "Andrew R. Baker" <andrewb@uab.edu>
Date: Thu, 3 Jun 1999 14:57:30 -0500 (CDT)
Sender: owner-linux@cthulhu.engr.sgi.com
Here is the latest patch for the Indigo2, it looks good so far...
Things still left to do:
        allow 8254 timer acks (it actually works on the Indigo2)
        clean up IRQ data structure
        enable 2nd SCSI controller

I am going to work on these once I get back from USENIX.        

-Andrew
--- indy_int.c.orig     Tue Jun  1 07:27:58 1999
+++ indy_int.c  Wed Jun  2 10:56:46 1999
@@ -5,7 +5,9 @@
  *
  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
  * Copyright (C) 1997, 1998 Ralf Baechle (ralf@gnu.org)
- * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) - Indigo2 changes
+ * Copyright (C) 1999 Andrew R. Baker (andrewb@uab.edu) 
+ *                    - Indigo2 changes
+ *                    - Interrupt handling fixes
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -449,10 +451,23 @@
                action = local_irq_action[irq];
        }
 
+       /* if irq == 0, then the interrupt has already been cleared */
+       if ( irq == 0 ) { goto end; }
+       /* if action == NULL, then we do have a handler for the irq */
+       if ( action == NULL ) { goto no_handler; }
+       
        hardirq_enter(cpu);
        kstat.irqs[0][irq + 16]++;
        action->handler(irq, action->dev_id, regs);
        hardirq_exit(cpu);
+       goto end;
+
+no_handler:
+       printk("No handler for local0 irq: %i\n", irq);
+
+end:   
+       return; 
+       
 }
 
 void indy_local1_irqdispatch(struct pt_regs *regs)
@@ -473,10 +488,23 @@
                irq = lc1msk_to_irqnr[mask];
                action = local_irq_action[irq];
        }
+       /* if irq == 0, then the interrupt has already been cleared */
+       /* not sure if it is needed here, but it is needed for local0 */
+       if ( irq == 0 ) { goto end; }
+       /* if action == NULL, then we do have a handler for the irq */
+       if ( action == NULL ) { goto no_handler; }
+       
        hardirq_enter(cpu);
        kstat.irqs[0][irq + 24]++;
        action->handler(irq, action->dev_id, regs);
        hardirq_exit(cpu);
+       goto end;
+       
+no_handler:
+       printk("No handler for local1 irq: %i\n", irq);
+
+end:   
+       return; 
 }
 
 void indy_buserror_irq(struct pt_regs *regs)
<Prev in Thread] Current Thread [Next in Thread>