summaryrefslogtreecommitdiffstats
path: root/genirq-Fix-forced-threading-merge-fallout.patch
blob: 74bb1066bc41618e13d4e7f63de025d844b79a2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From c31203974fe6f8a2c5ac9320fdfc8cd81e75f518 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>
---
 kernel/irq/manage.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 588efd8..69ffae8 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -567,10 +567,12 @@ 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)
 {
 again:
 	chip_bus_lock(irq, desc);
+#ifndef CONFIG_PREEMPT_RT
 	raw_spin_lock_irq(&desc->lock);
 
 	/*
@@ -594,6 +596,9 @@ again:
 		desc->chip->unmask(irq);
 	}
 	raw_spin_unlock_irq(&desc->lock);
+#else
+	preempt_hardirq_thread_done(desc, action);
+#endif
 	chip_bus_sync_unlock(irq, desc);
 }
 
@@ -667,7 +672,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.0.4