Subject: Indigo2 patch

From: "Andrew R. Baker" <[email-masked]>
Date: Thu, 3 Jun 1999 14:57:30 -0500 (CDT)

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 ([email-masked])
  * Copyright (C) 1997, 1998 Ralf Baechle ([email-masked])
- * Copyright (C) 1999 Andrew R. Baker ([email-masked]) - Indigo2 changes
+ * Copyright (C) 1999 Andrew R. Baker ([email-masked]) 
+ *                    - 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)

---

From: "Andrew R. Baker" <[email-masked]>
Date: Fri, 4 Jun 1999 15:07:52 -0500 (CDT)

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

BTW, with this patch, I have managed to successfully boot my Indigo2 and
have gone as far as installing hardhat on it.  It hasn't crashed so far,
even after I got it up to a load average of 164... ;)  However, I do
consistently get "signal 11" errors while trying to compile a kernel on
it.

Please beat it up as much as possible and let me know what I still need to
do.  ;)

-Andrew