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: ppopov@linux-mips.org
Date: Sun, 13 Mar 2005 08:19:11 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ppopov@ftp.linux-mips.org       05/03/13 08:19:05

Modified files:
        arch/mips/au1000/common: irq.c time.c 

Log message:
        When CONFIG_PM is enabled, it uses the TOY_MATCH2 interrupt as the 
system
        timer tick. Prior to this patch, if IDE IRQ probing occured, then the
        TOY_MATCH2 interrupt would be permanently disabled, and no system timer
        tick occurs. This patch corrects this situation by correctly registering
        the TOY_MATCH2 interrupt so that IDE IRQ probing doesn't have adverse
        side effects.

diff -urN linux/arch/mips/au1000/common/irq.c 
linux/arch/mips/au1000/common/irq.c
--- linux/arch/mips/au1000/common/irq.c 2005/03/01 06:33:16     1.38
+++ linux/arch/mips/au1000/common/irq.c 2005/03/13 08:19:05     1.39
@@ -293,8 +293,30 @@
 };
 
 #ifdef CONFIG_PM
-void startup_match20_interrupt(void)
+void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *))
 {
+       static struct irqaction action;
+       /* This is a big problem.... since we didn't use request_irq
+          when kernel/irq.c calls probe_irq_xxx this interrupt will
+          be probed for usage. This will end up disabling the device :(
+
+       Give it a bogus "action" pointer -- this will keep it from
+          getting auto-probed!
+
+       By setting the status to match that of request_irq() we
+       can avoid it.  --cgray
+       */
+       action.dev_id = handler;
+       action.flags = 0;
+       action.mask = 0;
+       action.name = "Au1xxx TOY";
+       action.handler = handler;
+       action.next = NULL;
+
+       irq_desc[AU1000_TOY_MATCH2_INT].action = &action; 
+       irq_desc[AU1000_TOY_MATCH2_INT].status 
+                &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | 
IRQ_INPROGRESS);
+
        local_enable_irq(AU1000_TOY_MATCH2_INT);
 }
 #endif
@@ -517,17 +539,7 @@
 
        irq = au_ffs(intc0_req1) - 1;
        intc0_req1 &= ~(1<<irq);
-#ifdef CONFIG_PM
-       if (irq == AU1000_TOY_MATCH2_INT) {
-               mask_and_ack_rise_edge_irq(irq);
-               counter0_irq(irq, NULL, regs);
-               local_enable_irq(irq);
-       }
-       else
-#endif
-       {
-               do_IRQ(irq, regs);
-       }
+       do_IRQ(irq, regs);
 }
 
 
diff -urN linux/arch/mips/au1000/common/time.c 
linux/arch/mips/au1000/common/time.c
--- linux/arch/mips/au1000/common/time.c        2005/01/14 03:03:23     1.32
+++ linux/arch/mips/au1000/common/time.c        2005/03/13 08:19:05     1.33
@@ -50,7 +50,6 @@
 #include <linux/mc146818rtc.h>
 #include <linux/timex.h>
 
-extern void startup_match20_interrupt(void);
 extern void do_softirq(void);
 extern volatile unsigned long wall_jiffies;
 unsigned long missed_heart_beats = 0;
@@ -65,7 +64,7 @@
 
 #ifdef CONFIG_PM
 #define MATCH20_INC 328
-extern void startup_match20_interrupt(void);
+extern void startup_match20_interrupt(void (*handler)(int, void *, struct 
pt_regs *));
 static unsigned long last_pc0, last_match20;
 #endif
 
@@ -446,7 +445,7 @@
                au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
                au_sync();
                while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
-               startup_match20_interrupt();
+               startup_match20_interrupt(counter0_irq);
 
                do_gettimeoffset = do_fast_pm_gettimeoffset;
 

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