blob: f74b282834af472714f2055b27d7f30cf1880ed4 [file] [log] [blame]
From ed0a2325fca7eef3895abee160c16c6ded3f4778 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 22 Feb 2010 16:55:03 +0100
Subject: [PATCH] genirq: Fix forced threading merge fallout
commit ddb34cf8cb1cc24764b72b608cd6d148d116a9f3 in tip.
The mainline changes for oneshot interrupts conflicted with the forced
threaded interrupts on RT, which reuse the IRQF_ONESHOT
mechanism. Shared interrupt need to keep the interrupt line disabled
until all handler threads finished.
Make finalize_oneshot_irq() aware of that.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 25642d1..1efad98 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -563,15 +563,20 @@ irq_wait_for_interrupt(struct irq_desc *desc, struct irqaction *action)
* handler finished. unmask if the interrupt has not been disabled and
* is marked MASKED.
*/
-static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)
+static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc,
+ struct irqaction *action)
{
chip_bus_lock(irq, desc);
+#ifndef CONFIG_PREEMPT_RT
raw_spin_lock_irq(&desc->lock);
if (!(desc->status & IRQ_DISABLED) && (desc->status & IRQ_MASKED)) {
desc->status &= ~IRQ_MASKED;
desc->chip->unmask(irq);
}
raw_spin_unlock_irq(&desc->lock);
+#else
+ preempt_hardirq_thread_done(desc, action);
+#endif
chip_bus_sync_unlock(irq, desc);
}
@@ -645,7 +650,7 @@ static int irq_thread(void *data)
action->thread_fn(action->irq, action->dev_id);
if (oneshot)
- irq_finalize_oneshot(action->irq, desc);
+ irq_finalize_oneshot(action->irq, desc, action);
}
wake = atomic_dec_and_test(&desc->threads_active);
--
1.7.1.1