[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1267698622-1216-1-git-send-email-u.kleine-koenig@pengutronix.de>
Date: Thu, 4 Mar 2010 11:30:22 +0100
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: linux-kernel@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>
Subject: [PATCH] genirq: spurious irq detection for threaded irqs
For threaded irqs the top half returns IRQ_WAKE_THREAD. Don't treat
that value like IRQ_HANDLED for the spurious check. Instead check the
return value of the threaded handler to be able to detect stuck irqs
that only have threaded handlers and no top half that can detect the
problem.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...e.hu>
---
include/linux/irq.h | 2 ++
kernel/irq/handle.c | 6 ------
kernel/irq/manage.c | 7 ++++++-
kernel/irq/spurious.c | 17 +++++++++++++++--
4 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 451481c..f261765 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -323,6 +323,8 @@ static inline void generic_handle_irq(unsigned int irq)
}
/* Handling of unhandled and spurious interrupts: */
+extern void note_threaded_interrupt(unsigned int irq, struct irq_desc *desc,
+ irqreturn_t action_ret);
extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
irqreturn_t action_ret);
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 814940e..3f63947 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -383,12 +383,6 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
switch (ret) {
case IRQ_WAKE_THREAD:
/*
- * Set result to handled so the spurious check
- * does not trigger.
- */
- ret = IRQ_HANDLED;
-
- /*
* Catch drivers which return WAKE_THREAD but
* did not set up a thread function
*/
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index eb6078c..81fdc45 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -557,12 +557,17 @@ static int irq_thread(void *data)
desc->status |= IRQ_PENDING;
raw_spin_unlock_irq(&desc->lock);
} else {
+ irqreturn_t action_ret;
+
raw_spin_unlock_irq(&desc->lock);
- action->thread_fn(action->irq, action->dev_id);
+ action_ret = action->thread_fn(action->irq, action->dev_id);
if (oneshot)
irq_finalize_oneshot(action->irq, desc);
+
+ if (!noirqdebug)
+ note_threaded_interrupt(action->irq, desc, action_ret);
}
wake = atomic_dec_and_test(&desc->threads_active);
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index 89fb90a..56395fd 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -213,8 +213,8 @@ try_misrouted_irq(unsigned int irq, struct irq_desc *desc,
return action && (action->flags & IRQF_IRQPOLL);
}
-void note_interrupt(unsigned int irq, struct irq_desc *desc,
- irqreturn_t action_ret)
+void note_threaded_interrupt(unsigned int irq, struct irq_desc *desc,
+ irqreturn_t action_ret)
{
if (unlikely(action_ret != IRQ_HANDLED)) {
/*
@@ -262,6 +262,19 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
desc->irqs_unhandled = 0;
}
+void note_interrupt(unsigned int irq, struct irq_desc *desc,
+ irqreturn_t action_ret)
+{
+ if (action_ret == IRQ_WAKE_THREAD)
+ /* handled in irq_thread() when the threaded handler returns */
+ return;
+
+ /* don't report IRQ_WAKE_THREAD | IRQ_HANDLED as bogus return value */
+ action_ret &= ~IRQ_WAKE_THREAD;
+
+ note_threaded_interrupt(irq, desc, action_ret);
+}
+
int noirqdebug __read_mostly;
int noirqdebug_setup(char *str)
--
1.7.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists