Skip to content

Commit

Permalink
x86: apic honour irq affinity which was set in early boot
Browse files Browse the repository at this point in the history
setup_ioapic_dest() is called after the non boot cpus have been
brought up. It sets the irq affinity of all already configured
interrupts to all cpus and ignores affinity settings which were
done by the early bootup code.

If the IRQ_NO_BALANCING or IRQ_AFFINITY_SET flags are set then use the
affinity mask from the irq descriptor and not TARGET_CPUS.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Nov 9, 2008
1 parent 612e368 commit 6c2e940
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3761,7 +3761,9 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
void __init setup_ioapic_dest(void)
{
int pin, ioapic, irq, irq_entry;
struct irq_desc *desc;
struct irq_cfg *cfg;
cpumask_t mask;

if (skip_ioapic_setup == 1)
return;
Expand All @@ -3778,16 +3780,30 @@ void __init setup_ioapic_dest(void)
* cpu is online.
*/
cfg = irq_cfg(irq);
if (!cfg->vector)
if (!cfg->vector) {
setup_IO_APIC_irq(ioapic, pin, irq,
irq_trigger(irq_entry),
irq_polarity(irq_entry));
continue;

}

/*
* Honour affinities which have been set in early boot
*/
desc = irq_to_desc(irq);
if (desc->status &
(IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
mask = desc->affinity;
else
mask = TARGET_CPUS;

#ifdef CONFIG_INTR_REMAP
else if (intr_remapping_enabled)
set_ir_ioapic_affinity_irq(irq, TARGET_CPUS);
#endif
if (intr_remapping_enabled)
set_ir_ioapic_affinity_irq(irq, mask);
else
set_ioapic_affinity_irq(irq, TARGET_CPUS);
#endif
set_ioapic_affinity_irq(irq, mask);
}

}
Expand Down

0 comments on commit 6c2e940

Please sign in to comment.