diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-07 11:05:08 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-19 06:58:07 -0500 |
commit | 569bda8df11effa03e618729293c7961696abb10 (patch) | |
tree | b0aed74a4b00a481738dc76a739f6f67e09a99c1 /kernel/irq/manage.c | |
parent | b008207cbd0d5ce606a1a2ac52826e0ab37d0b99 (diff) |
genirq: Always apply cpu online mask
If the affinity had been set by the user, then a later request_irq()
will honour that setting. But online cpus can have changed. So apply
the online mask and for this case as well.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 591c927b135c..ade65bfb466d 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -256,6 +256,8 @@ EXPORT_SYMBOL_GPL(irq_set_affinity_notifier); | |||
256 | */ | 256 | */ |
257 | static int setup_affinity(unsigned int irq, struct irq_desc *desc) | 257 | static int setup_affinity(unsigned int irq, struct irq_desc *desc) |
258 | { | 258 | { |
259 | struct cpumask *set = irq_default_affinity; | ||
260 | |||
259 | /* Excludes PER_CPU and NO_BALANCE interrupts */ | 261 | /* Excludes PER_CPU and NO_BALANCE interrupts */ |
260 | if (!irq_can_set_affinity(irq)) | 262 | if (!irq_can_set_affinity(irq)) |
261 | return 0; | 263 | return 0; |
@@ -265,15 +267,13 @@ static int setup_affinity(unsigned int irq, struct irq_desc *desc) | |||
265 | * one of the targets is online. | 267 | * one of the targets is online. |
266 | */ | 268 | */ |
267 | if (desc->status & (IRQ_AFFINITY_SET)) { | 269 | if (desc->status & (IRQ_AFFINITY_SET)) { |
268 | if (cpumask_any_and(desc->irq_data.affinity, cpu_online_mask) | 270 | if (cpumask_intersects(desc->irq_data.affinity, |
269 | < nr_cpu_ids) | 271 | cpu_online_mask)) |
270 | goto set_affinity; | 272 | set = desc->irq_data.affinity; |
271 | else | 273 | else |
272 | desc->status &= ~IRQ_AFFINITY_SET; | 274 | desc->status &= ~IRQ_AFFINITY_SET; |
273 | } | 275 | } |
274 | 276 | cpumask_and(desc->irq_data.affinity, cpu_online_mask, set); | |
275 | cpumask_and(desc->irq_data.affinity, cpu_online_mask, irq_default_affinity); | ||
276 | set_affinity: | ||
277 | desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false); | 277 | desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false); |
278 | 278 | ||
279 | return 0; | 279 | return 0; |