From: Ingo Molnar <mingo@elte.hu>
To: Alan Cox <alan@redhat.com>
Cc: Arjan van de Ven <arjan@infradead.org>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [patch, -rc5-mm1] locking validator: special rule: 8390.c disable_irq()
Date: Thu, 1 Jun 2006 12:02:18 +0200 [thread overview]
Message-ID: <20060601100218.GA30807@elte.hu> (raw)
In-Reply-To: <20060601094643.GA22110@devserv.devel.redhat.com>
* Alan Cox <alan@redhat.com> wrote:
> On Wed, May 31, 2006 at 11:47:29PM +0200, Ingo Molnar wrote:
> > couldnt most of these problems be avoided by tracking whether a handler
> > _ever_ returned a success status? That means that irqpoll could safely
> > poll handlers for which we know that they somehow arent yet matched up
> > to any IRQ line?
>
> But you may get random positive hits from this when a real IRQ for an
> unrelated device happens to get delivered. We could poll enabled IRQs
> first then disabled ones ?
hm, you are right. Actions that are registered to the wrong IRQ might
still appear to 'work' by pure accident, if they also share the IRQ with
another (correctly routed) action.
the basic problem isnt really the polling method that irqpoll does - it
is the insensitivity of the IRQ_DISABLED flag: we dont know whether it's
disabled because the driver wants it, or because it was screaming
before. Maybe we could (ab-)use irq_desc->depth for that - if that is 0
but IRQ_DISABLED is set then you may ignore IRQ_DISABLED. Ok?
The patch below implements this logic, ontop of -rc5-mm2. Can you see
any hole in it? (It built and booted up fine on x86_64 but i dont have
any misrouted irqs.)
Ingo
------------------
Subject: fix irqpoll to honor disable_irq()
From: Ingo Molnar <mingo@elte.hu>
irqpoll/irqfixup ignored IRQ_DISABLED but that could cause lockups. So
listen to desc->depth to correctly honor disable_irq(). Also, when an
interrupt it screaming, set IRQ_DISABLED but do not touch ->depth.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Index: linux/kernel/irq/spurious.c
===================================================================
--- linux.orig/kernel/irq/spurious.c
+++ linux/kernel/irq/spurious.c
@@ -56,6 +56,15 @@ static int misrouted_irq(int irq, struct
local_irq_disable();
/* Now clean up the flags */
spin_lock(&desc->lock);
+ /*
+ * NOTE: we only listen to desc->depth here, not to
+ * IRQ_DISABLED - which might have been set due to
+ * a screaming interrupt.
+ */
+ if (desc->depth) {
+ spin_unlock(&desc->lock);
+ continue;
+ }
action = desc->action;
/*
@@ -163,10 +172,12 @@ void note_interrupt(unsigned int irq, st
__report_bad_irq(irq, desc, action_ret);
/*
* Now kill the IRQ
+ *
+ * We keep desc->depth unchanged - so that irqpoll can
+ * honor driver IRQ-disabling.
*/
printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
desc->status |= IRQ_DISABLED;
- desc->depth = 1;
desc->chip->disable(irq);
}
desc->irqs_unhandled = 0;
prev parent reply other threads:[~2006-06-01 10:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-31 20:02 [patch, -rc5-mm1] locking validator: special rule: 8390.c disable_irq() Ingo Molnar
2006-05-31 20:31 ` Arjan van de Ven
2006-05-31 21:27 ` Ingo Molnar
2006-05-31 21:41 ` Alan Cox
2006-05-31 21:43 ` Arjan van de Ven
2006-05-31 21:47 ` Ingo Molnar
2006-05-31 21:56 ` Arjan van de Ven
2006-05-31 22:00 ` Ingo Molnar
2006-05-31 22:02 ` Arjan van de Ven
2006-06-03 14:37 ` Steven Rostedt
2006-06-03 21:53 ` Alan Cox
2006-06-03 22:34 ` Steven Rostedt
2006-06-04 9:34 ` Arjan van de Ven
2006-06-04 13:16 ` Steven Rostedt
2006-06-04 15:38 ` Alan Cox
2006-06-04 15:44 ` Steven Rostedt
2006-06-04 16:10 ` Alan Cox
2006-06-04 16:22 ` Steven Rostedt
2006-06-04 21:26 ` Alan Cox
2006-06-04 21:28 ` Steven Rostedt
2006-06-04 21:44 ` Ingo Molnar
2006-06-05 1:04 ` Steven Rostedt
2006-06-06 3:33 ` [PATCH -mm] misroute-irq: Don't call desc->chip->end because of edge interrupts Steven Rostedt
2006-06-06 4:20 ` Andrew Morton
2006-06-06 10:46 ` Steven Rostedt
2006-06-06 8:01 ` Ingo Molnar
2006-06-06 10:50 ` Steven Rostedt
2006-06-06 21:48 ` Andrew Morton
2006-06-06 21:50 ` Ingo Molnar
2006-06-06 3:49 ` [RFC][PATCH -mm] postpone misrouted irqs when disabled Steven Rostedt
2006-06-01 9:46 ` [patch, -rc5-mm1] locking validator: special rule: 8390.c disable_irq() Alan Cox
2006-06-01 10:02 ` Ingo Molnar [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=20060601100218.GA30807@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=alan@redhat.com \
--cc=arjan@infradead.org \
--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