aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irq_64.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-12-16 20:33:58 -0500
committerMike Travis <travis@sgi.com>2008-12-16 20:40:57 -0500
commitd7b381bb7b1ad69ff008ea063d26e988b686c8de (patch)
treea5c8cd362ff64cabc9b60c88a984f77d98007fc7 /arch/x86/kernel/irq_64.c
parentb78936e14ee47b6b2d628501a0eab5270db80132 (diff)
x86: fixup_irqs() doesnt need an argument.
Impact: cleanup, remove on-stack cpumask. The "map" arg is always cpu_online_mask. Importantly, set_affinity always ands the argument with cpu_online_mask anyway, so we don't need to do it in fixup_irqs(), avoiding a temporary. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'arch/x86/kernel/irq_64.c')
-rw-r--r--arch/x86/kernel/irq_64.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 27f2307b0a34..fca2991443f5 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -83,16 +83,17 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
83} 83}
84 84
85#ifdef CONFIG_HOTPLUG_CPU 85#ifdef CONFIG_HOTPLUG_CPU
86void fixup_irqs(cpumask_t map) 86/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
87void fixup_irqs(void)
87{ 88{
88 unsigned int irq; 89 unsigned int irq;
89 static int warned; 90 static int warned;
90 struct irq_desc *desc; 91 struct irq_desc *desc;
91 92
92 for_each_irq_desc(irq, desc) { 93 for_each_irq_desc(irq, desc) {
93 cpumask_t mask;
94 int break_affinity = 0; 94 int break_affinity = 0;
95 int set_affinity = 1; 95 int set_affinity = 1;
96 const struct cpumask *affinity;
96 97
97 if (!desc) 98 if (!desc)
98 continue; 99 continue;
@@ -102,23 +103,23 @@ void fixup_irqs(cpumask_t map)
102 /* interrupt's are disabled at this point */ 103 /* interrupt's are disabled at this point */
103 spin_lock(&desc->lock); 104 spin_lock(&desc->lock);
104 105
106 affinity = &desc->affinity;
105 if (!irq_has_action(irq) || 107 if (!irq_has_action(irq) ||
106 cpus_equal(desc->affinity, map)) { 108 cpumask_equal(affinity, cpu_online_mask)) {
107 spin_unlock(&desc->lock); 109 spin_unlock(&desc->lock);
108 continue; 110 continue;
109 } 111 }
110 112
111 cpus_and(mask, desc->affinity, map); 113 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
112 if (cpus_empty(mask)) {
113 break_affinity = 1; 114 break_affinity = 1;
114 mask = map; 115 affinity = cpu_all_mask;
115 } 116 }
116 117
117 if (desc->chip->mask) 118 if (desc->chip->mask)
118 desc->chip->mask(irq); 119 desc->chip->mask(irq);
119 120
120 if (desc->chip->set_affinity) 121 if (desc->chip->set_affinity)
121 desc->chip->set_affinity(irq, &mask); 122 desc->chip->set_affinity(irq, affinity);
122 else if (!(warned++)) 123 else if (!(warned++))
123 set_affinity = 0; 124 set_affinity = 0;
124 125