aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2012-09-26 06:44:39 -0400
committerJoerg Roedel <joro@8bytes.org>2013-01-28 06:17:26 -0500
commit373dd7a27f2469020e7b56744cf47b82986b9749 (patch)
tree1fb77f5d3b11ad5d2c97c1244e1460cabb94593a /arch/x86/kernel/apic
parent5afba62cc8a16716508605e02c1b02ee5f969184 (diff)
x86, io_apic: Introduce set_affinity function pointer
With interrupt remapping a special function is used to change the affinity of an IO-APIC interrupt. Abstract this with a function pointer. Signed-off-by: Joerg Roedel <joro@8bytes.org> Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/io_apic.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index d4b045e018fb..d9ca3be9636c 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2369,9 +2369,10 @@ int __ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask,
2369 return 0; 2369 return 0;
2370} 2370}
2371 2371
2372static int 2372
2373ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, 2373int native_ioapic_set_affinity(struct irq_data *data,
2374 bool force) 2374 const struct cpumask *mask,
2375 bool force)
2375{ 2376{
2376 unsigned int dest, irq = data->irq; 2377 unsigned int dest, irq = data->irq;
2377 unsigned long flags; 2378 unsigned long flags;
@@ -2570,8 +2571,7 @@ static void irq_remap_modify_chip_defaults(struct irq_chip *chip)
2570 chip->irq_print_chip = ir_print_prefix; 2571 chip->irq_print_chip = ir_print_prefix;
2571 chip->irq_ack = ir_ack_apic_edge; 2572 chip->irq_ack = ir_ack_apic_edge;
2572 chip->irq_eoi = ir_ack_apic_level; 2573 chip->irq_eoi = ir_ack_apic_level;
2573 2574 chip->irq_set_affinity = x86_io_apic_ops.set_affinity;
2574 chip->irq_set_affinity = set_remapped_irq_affinity;
2575} 2575}
2576#endif /* CONFIG_IRQ_REMAP */ 2576#endif /* CONFIG_IRQ_REMAP */
2577 2577
@@ -2582,7 +2582,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
2582 .irq_unmask = unmask_ioapic_irq, 2582 .irq_unmask = unmask_ioapic_irq,
2583 .irq_ack = ack_apic_edge, 2583 .irq_ack = ack_apic_edge,
2584 .irq_eoi = ack_apic_level, 2584 .irq_eoi = ack_apic_level,
2585 .irq_set_affinity = ioapic_set_affinity, 2585 .irq_set_affinity = native_ioapic_set_affinity,
2586 .irq_retrigger = ioapic_retrigger_irq, 2586 .irq_retrigger = ioapic_retrigger_irq,
2587}; 2587};
2588 2588
@@ -3694,10 +3694,7 @@ void __init setup_ioapic_dest(void)
3694 else 3694 else
3695 mask = apic->target_cpus(); 3695 mask = apic->target_cpus();
3696 3696
3697 if (irq_remapping_enabled) 3697 x86_io_apic_ops.set_affinity(idata, mask, false);
3698 set_remapped_irq_affinity(idata, mask, false);
3699 else
3700 ioapic_set_affinity(idata, mask, false);
3701 } 3698 }
3702 3699
3703} 3700}