From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
stable-rt@vger.kernel.org,
Lothar Wassmann <lw@karo-electronics.de>
Subject: [PATCH RT 1/8] genirq: Unmask oneshot irqs when thread was not woken
Date: Wed, 08 Feb 2012 20:59:27 -0500 [thread overview]
Message-ID: <20120209020159.095037912@goodmis.org> (raw)
In-Reply-To: 20120209015926.851312665@goodmis.org
[-- Attachment #1: 0001-genirq-Unmask-oneshot-irqs-when-thread-was-not-woken.patch --]
[-- Type: text/plain, Size: 1960 bytes --]
From: Thomas Gleixner <tglx@linutronix.de>
When the primary handler of an interrupt which is marked IRQ_ONESHOT
does not wake the thread (e.g. due to a spurious interrupt) then
nothing ever unmasks the interrupt line again. Handle it gracefully.
Cc: stable-rt@vger.kernel.org
Reported-by: Lothar Wassmann <lw@karo-electronics.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/irq/chip.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index dc5114b..3322a34 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -312,6 +312,24 @@ out_unlock:
}
EXPORT_SYMBOL_GPL(handle_simple_irq);
+/*
+ * Called unconditionally from handle_level_irq() and only for oneshot
+ * interrupts from handle_fasteoi_irq()
+ */
+static void cond_unmask_irq(struct irq_desc *desc)
+{
+ /*
+ * We need to unmask in the following cases:
+ * - Standard level irq (IRQF_ONESHOT is not set)
+ * - Oneshot irq which did not wake the thread (caused by a
+ * spurious interrupt or a primary handler handling it
+ * completely).
+ */
+ if (!irqd_irq_disabled(&desc->irq_data) &&
+ irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot)
+ unmask_irq(desc);
+}
+
/**
* handle_level_irq - Level type irq handler
* @irq: the interrupt number
@@ -344,8 +362,8 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
handle_irq_event(desc);
- if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT))
- unmask_irq(desc);
+ cond_unmask_irq(desc);
+
out_unlock:
raw_spin_unlock(&desc->lock);
}
@@ -399,6 +417,9 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
preflow_handler(desc);
handle_irq_event(desc);
+ if (desc->istate & IRQS_ONESHOT)
+ cond_unmask_irq(desc);
+
out_eoi:
desc->irq_data.chip->irq_eoi(&desc->irq_data);
out_unlock:
--
1.7.8.3
next prev parent reply other threads:[~2012-02-09 2:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 1:59 [PATCH RT 0/8] [ANNOUNCE] 3.0.20-rt36-rc1 Steven Rostedt
2012-02-09 1:59 ` Steven Rostedt [this message]
2012-02-09 1:59 ` [PATCH RT 2/8] genirq: Handle pending irqs in irq_startup() Steven Rostedt
2012-02-09 1:59 ` [PATCH RT 3/8] signal/x86: Delay calling signals in atomic Steven Rostedt
2012-02-09 1:59 ` [PATCH RT 4/8] x86: Do not disable preemption in int3 on 32bit Steven Rostedt
2012-02-09 1:59 ` [PATCH RT 5/8] timer-fd: Prevent live lock Steven Rostedt
2012-02-09 1:59 ` [PATCH RT 6/8] genirq: Allow disabling of softirq processing in irq thread context Steven Rostedt
2012-02-09 1:59 ` [PATCH RT 7/8] futex: Fix bug on when a requeued RT task times out Steven Rostedt
2012-02-09 1:59 ` [PATCH RT 8/8] Linux 3.0.20-rt36-rc1 Steven Rostedt
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=20120209020159.095037912@goodmis.org \
--to=rostedt@goodmis.org \
--cc=C.Emde@osadl.org \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=lw@karo-electronics.de \
--cc=stable-rt@vger.kernel.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).