]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.arch/x2APIC_PATCH_11_of_41_72b1e22dfcad1daca6906148fd956ffe404bb0bc
Imported linux-2.6.27.39 suse/xen patches.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / x2APIC_PATCH_11_of_41_72b1e22dfcad1daca6906148fd956ffe404bb0bc
CommitLineData
2cb7cef9
BS
1From: Suresh Siddha <suresh.b.siddha@intel.com>
2Subject: x64, x2apic/intr-remap: generic irq migration support from process context
3References: fate #303948 and fate #303984
4Patch-Mainline: queued for .28
5Commit-ID: 72b1e22dfcad1daca6906148fd956ffe404bb0bc
6
7Signed-off-by: Thomas Renninger <trenn@suse.de>
8
9Generic infrastructure for migrating the irq from the process context in the
10presence of CONFIG_GENERIC_PENDING_IRQ.
11
12This will be used later for migrating irq in the presence of
13interrupt-remapping.
14
15Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
16Cc: akpm@linux-foundation.org
17Cc: arjan@linux.intel.com
18Cc: andi@firstfloor.org
19Cc: ebiederm@xmission.com
20Cc: jbarnes@virtuousgeek.org
21Cc: steiner@sgi.com
22Signed-off-by: Ingo Molnar <mingo@elte.hu>
23
24---
25 include/linux/irq.h | 1 +
26 kernel/irq/manage.c | 9 ++++++++-
27 2 files changed, 9 insertions(+), 1 deletion(-)
28
29Index: linux-2.6.26/include/linux/irq.h
30===================================================================
31--- linux-2.6.26.orig/include/linux/irq.h
32+++ linux-2.6.26/include/linux/irq.h
33@@ -62,6 +62,7 @@ typedef void (*irq_flow_handler_t)(unsig
34 #define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */
35 #define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */
36 #define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */
37+#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */
38
39 #ifdef CONFIG_IRQ_PER_CPU
40 # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
41Index: linux-2.6.26/kernel/irq/manage.c
42===================================================================
43--- linux-2.6.26.orig/kernel/irq/manage.c
44+++ linux-2.6.26/kernel/irq/manage.c
45@@ -89,7 +89,14 @@ int irq_set_affinity(unsigned int irq, c
46 set_balance_irq_affinity(irq, cpumask);
47
48 #ifdef CONFIG_GENERIC_PENDING_IRQ
49- set_pending_irq(irq, cpumask);
50+ if (desc->status & IRQ_MOVE_PCNTXT) {
51+ unsigned long flags;
52+
53+ spin_lock_irqsave(&desc->lock, flags);
54+ desc->chip->set_affinity(irq, cpumask);
55+ spin_unlock_irqrestore(&desc->lock, flags);
56+ } else
57+ set_pending_irq(irq, cpumask);
58 #else
59 desc->affinity = cpumask;
60 desc->chip->set_affinity(irq, cpumask);