genirq: fix the affinity setting in setup_irq

The affinity setting in setup irq is called before the NO_BALANCING
flag is checked and might therefore override affinity settings from the
calling code with the default setting.

Move the NO_BALANCING flag check before the call to the affinity
setting.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Thomas Gleixner and committed by Ingo Molnar 612e3684 f6d87f4b

+5 -5
+5 -5
kernel/irq/manage.c
··· 123 123 * Preserve an userspace affinity setup, but make sure that 124 124 * one of the targets is online. 125 125 */ 126 - if (desc->status & IRQ_AFFINITY_SET) { 126 + if (desc->status & (IRQ_AFFINITY_SET | IRQ_NO_BALANCING)) { 127 127 if (cpus_intersects(desc->affinity, cpu_online_map)) 128 128 mask = desc->affinity; 129 129 else ··· 483 483 /* Undo nested disables: */ 484 484 desc->depth = 1; 485 485 486 + /* Exclude IRQ from balancing if requested */ 487 + if (new->flags & IRQF_NOBALANCING) 488 + desc->status |= IRQ_NO_BALANCING; 489 + 486 490 /* Set default affinity mask once everything is setup */ 487 491 do_irq_select_affinity(irq, desc); 488 492 ··· 500 496 } 501 497 502 498 *p = new; 503 - 504 - /* Exclude IRQ from balancing */ 505 - if (new->flags & IRQF_NOBALANCING) 506 - desc->status |= IRQ_NO_BALANCING; 507 499 508 500 /* Reset broken irq detection when installing new handler */ 509 501 desc->irq_count = 0;