public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dimitri Sivanich <sivanich@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, hch@infradead.org,
	clameter@sgi.com, jes@sgi.com
Subject: Re: [PATCH] Add SA_PERCPU_IRQ flag support
Date: Tue, 21 Mar 2006 18:52:54 -0600	[thread overview]
Message-ID: <20060322005254.GA32379@sgi.com> (raw)
In-Reply-To: <20060321153747.79f18016.akpm@osdl.org>

On Tue, Mar 21, 2006 at 03:37:47PM -0800, Andrew Morton wrote:
> hm.  Last time around I pointed out that we should be checking that all
> handlers for this IRQ agree about the percpuness.  What happened to
> that?

I believe this version has what you are looking for.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>

Index: linux-2.6.15/kernel/irq/manage.c
===================================================================
--- linux-2.6.15.orig/kernel/irq/manage.c	2006-03-20 13:11:01.766522017 -0600
+++ linux-2.6.15/kernel/irq/manage.c	2006-03-21 18:44:52.297990979 -0600
@@ -209,10 +209,14 @@ int setup_irq(unsigned int irq, struct i
 	p = &desc->action;
 	if ((old = *p) != NULL) {
 		/* Can't share interrupts unless both agree to */
-		if (!(old->flags & new->flags & SA_SHIRQ)) {
-			spin_unlock_irqrestore(&desc->lock,flags);
-			return -EBUSY;
-		}
+		if (!(old->flags & new->flags & SA_SHIRQ))
+			goto mismatch;
+
+#if defined(ARCH_HAS_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
+		/* All handlers must agree on per-cpuness */
+		if ((old->flags & IRQ_PER_CPU) != (new->flags & IRQ_PER_CPU))
+			goto mismatch;
+#endif
 
 		/* add new interrupt at end of irq queue */
 		do {
@@ -223,7 +227,10 @@ int setup_irq(unsigned int irq, struct i
 	}
 
 	*p = new;
-
+#if defined(ARCH_HAS_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
+	if (new->flags & SA_PERCPU_IRQ)
+		desc->status |= IRQ_PER_CPU;
+#endif
 	if (!shared) {
 		desc->depth = 0;
 		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT |
@@ -241,6 +248,12 @@ int setup_irq(unsigned int irq, struct i
 	register_handler_proc(irq, new);
 
 	return 0;
+
+mismatch:
+	spin_unlock_irqrestore(&desc->lock, flags);
+	printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
+	dump_stack();
+	return -EBUSY;
 }
 
 /*

  parent reply	other threads:[~2006-03-22  0:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-21 21:38 [PATCH] Add SA_PERCPU_IRQ flag support Dimitri Sivanich
2006-03-21 23:37 ` Andrew Morton
2006-03-21 23:45   ` Christoph Lameter
2006-03-22  2:00     ` Benjamin Herrenschmidt
2006-03-22  0:52   ` Dimitri Sivanich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-03-17  0:31 Dimitri Sivanich
2006-03-17  2:09 ` Christoph Hellwig
2006-03-17 23:26 ` Andrew Morton
2006-03-18  9:49   ` Andrew Morton
2006-03-20 14:17     ` Dimitri Sivanich
2006-03-20 14:22       ` Matthew Wilcox
2006-03-20 14:25         ` Dimitri Sivanich

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=20060322005254.GA32379@sgi.com \
    --to=sivanich@sgi.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=hch@infradead.org \
    --cc=jes@sgi.com \
    --cc=linux-kernel@vger.kernel.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