Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: [MIPS] irq_cpu: use handle_percpu_irq handler to avoid dropping interrupts.
Date: Thu, 22 Nov 2007 18:43:14 +0000	[thread overview]
Message-ID: <20071122184314.GA14223@linux-mips.org> (raw)
In-Reply-To: <20071123.004132.61510296.anemo@mba.ocn.ne.jp>

On Fri, Nov 23, 2007 at 12:41:32AM +0900, Atsushi Nemoto wrote:

> This might broke probe_irq_on()/probe_irq_off(), since
> handle_percpu_irq() does not check IRQ_WAITING bit.
> 
> This is a quick fix.  But I'm not sure where is the right place to fix...

Here's a cleaner version.  I guess I should scatter a few more
set_irq_noprobe calls over arch/mips - just not into i8259.c.

  Ralf

diff --git a/arch/mips/kernel/irq-rm7000.c b/arch/mips/kernel/irq-rm7000.c
index 971adf6..a92f2d0 100644
--- a/arch/mips/kernel/irq-rm7000.c
+++ b/arch/mips/kernel/irq-rm7000.c
@@ -42,7 +42,9 @@ void __init rm7k_cpu_irq_init(void)
 
 	clear_c0_intcontrol(0x00000f00);		/* Mask all */
 
-	for (i = base; i < base + 4; i++)
+	for (i = base; i < base + 4; i++) {
 		set_irq_chip_and_handler(i, &rm7k_irq_controller,
 					 handle_percpu_irq);
+		set_irq_noprobe(i);
+	}
 }
diff --git a/arch/mips/kernel/irq-rm9000.c b/arch/mips/kernel/irq-rm9000.c
index 7b04583..3f21538 100644
--- a/arch/mips/kernel/irq-rm9000.c
+++ b/arch/mips/kernel/irq-rm9000.c
@@ -105,4 +105,5 @@ void __init rm9k_cpu_irq_init(void)
 	rm9000_perfcount_irq = base + 1;
 	set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,
 				 handle_percpu_irq);
+	set_irq_noprobe(rm9000_perfcount_irq);
 }
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index d06e9c9..c2e3279 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -130,6 +130,24 @@ asmlinkage void spurious_interrupt(void)
 	atomic_inc(&irq_err_count);
 }
 
+void set_irq_noprobe(unsigned int irq)
+{
+	unsigned long flags;
+	struct irq_desc *desc;
+
+	if (irq >= NR_IRQS) {
+		printk(KERN_ERR
+		       "Trying to install type control for IRQ%d\n", irq);
+		return;
+	}
+
+	desc = irq_desc + irq;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	desc->status |= IRQ_NOPROBE;
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
+
 #ifdef CONFIG_KGDB
 extern void breakpoint(void);
 extern void set_debug_traps(void);
diff --git a/arch/mips/kernel/irq_cpu.c b/arch/mips/kernel/irq_cpu.c
index 0ee2567..810f65d 100644
--- a/arch/mips/kernel/irq_cpu.c
+++ b/arch/mips/kernel/irq_cpu.c
@@ -114,7 +114,9 @@ void __init mips_cpu_irq_init(void)
 		for (i = irq_base; i < irq_base + 2; i++)
 			set_irq_chip(i, &mips_mt_cpu_irq_controller);
 
-	for (i = irq_base + 2; i < irq_base + 8; i++)
+	for (i = irq_base + 2; i < irq_base + 8; i++) {
 		set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
 					 handle_percpu_irq);
+		set_irq_noprobe(i);
+	}
 }
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index a58f0ee..6b60d2a 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -160,4 +160,6 @@ extern void free_irqno(unsigned int irq);
 extern int cp0_compare_irq;
 extern int cp0_perfcount_irq;
 
+extern void set_irq_noprobe(unsigned int irq);
+
 #endif /* _ASM_IRQ_H */

      parent reply	other threads:[~2007-11-22 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <S20032632AbXKOURg/20071115201736Z+24020@ftp.linux-mips.org>
2007-11-22 15:41 ` [MIPS] irq_cpu: use handle_percpu_irq handler to avoid dropping interrupts Atsushi Nemoto
2007-11-22 16:19   ` Ralf Baechle
2007-11-22 17:23     ` Ralf Baechle
2007-11-22 18:43   ` Ralf Baechle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071122184314.GA14223@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox