Skip to contentSkip to conversation

gt64260_mask_irq bug fix

PATCH Dale Farnsworth 1 participant 1 message Mar 11, 2003

lore
Share & tools
lore
#0 lore raw

This patch two fixes.
First, it removes the spinlock calls from gt64260_unmask_irq and gt64260_mask_irq. I was the one who added these in a misguided attempt to fix the problem addressed by the second fix.

Second, after the irq is masked, we wait for the gt64260's internal pipeline to drain before returning. Apparently this bit someone on irq 36, but it is necessary for all irqs.

-Dale

Patch vs. linuxppc_2_4_devel

===== gt64260_pic.c 1.10 vs edited =====

gt64260_pic.c renamed from arch/ppc/kernel/gt64260_pic.c +7 -12
@@ -283,10 +283,7 @@
 void
 gt64260_unmask_irq(unsigned int irq)
 {
-    	unsigned long flags;
-
 	irq -= gt64260_irq_base;
-	spin_lock_irqsave(&gt64260_lock, flags);
 
 	if (irq > 31) {
 		if (irq > 63) {
@@ -304,7 +301,6 @@
 		set_bit(irq, &ppc_cached_irq_mask[0]);
 		gt_write(GT64260_IC_CPU_INTR_MASK_LO, ppc_cached_irq_mask[0]);
 	}
-	spin_unlock_irqrestore(&gt64260_lock, flags);
 }
 
 
@@ -325,10 +321,8 @@
 static void
 gt64260_mask_irq(unsigned int irq)
 {
-    	unsigned long flags;
-
 	irq -= gt64260_irq_base;
-	spin_lock_irqsave(&gt64260_lock, flags);
+
 	if (irq > 31) {
 		if (irq > 63) {
 			/* mask GPP irq */
@@ -345,11 +339,12 @@
 		clear_bit(irq, &ppc_cached_irq_mask[0]);
 		gt_write(GT64260_IC_CPU_INTR_MASK_LO, ppc_cached_irq_mask[0]);
 	}
-	spin_unlock_irqrestore(&gt64260_lock, flags);
-
-	if (irq == 36) { /* Seems necessary for SDMA interrupts */
-		udelay(1);
-	}
+	/*
+	 * Need to drain the gt64260 pipeline to ensure that the irq has
+	 * been masked before returning.  Reading any gt64260 register
+	 * is sufficient.
+	 */
+	(void) gt_read(GT64260_GPP_INTR_MASK);
 }
 
 

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/