diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-10-08 15:50:22 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-12 10:53:38 -0400 |
commit | f19f5ecc920215decfea54f26e3eb14064506675 (patch) | |
tree | 7ee584653067f01be4c8dd98a3ad87d23a786bd9 /arch/x86 | |
parent | 5346b2a78fa3b900da672928978475acdd4632dc (diff) |
x86: Convert remapped ioapic affinity setting to new irq chip function
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 58 |
1 files changed, 20 insertions, 38 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 268c5450392b..49cc27d5658d 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2333,24 +2333,21 @@ ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
2333 | * the interrupt-remapping table entry. | 2333 | * the interrupt-remapping table entry. |
2334 | */ | 2334 | */ |
2335 | static int | 2335 | static int |
2336 | migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask) | 2336 | ir_ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, |
2337 | bool force) | ||
2337 | { | 2338 | { |
2338 | struct irq_cfg *cfg; | 2339 | struct irq_cfg *cfg = data->chip_data; |
2340 | unsigned int dest, irq = data->irq; | ||
2339 | struct irte irte; | 2341 | struct irte irte; |
2340 | unsigned int dest; | ||
2341 | unsigned int irq; | ||
2342 | int ret = -1; | ||
2343 | 2342 | ||
2344 | if (!cpumask_intersects(mask, cpu_online_mask)) | 2343 | if (!cpumask_intersects(mask, cpu_online_mask)) |
2345 | return ret; | 2344 | return -EINVAL; |
2346 | 2345 | ||
2347 | irq = desc->irq; | ||
2348 | if (get_irte(irq, &irte)) | 2346 | if (get_irte(irq, &irte)) |
2349 | return ret; | 2347 | return -EBUSY; |
2350 | 2348 | ||
2351 | cfg = get_irq_desc_chip_data(desc); | ||
2352 | if (assign_irq_vector(irq, cfg, mask)) | 2349 | if (assign_irq_vector(irq, cfg, mask)) |
2353 | return ret; | 2350 | return -EBUSY; |
2354 | 2351 | ||
2355 | dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask); | 2352 | dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask); |
2356 | 2353 | ||
@@ -2365,29 +2362,14 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask) | |||
2365 | if (cfg->move_in_progress) | 2362 | if (cfg->move_in_progress) |
2366 | send_cleanup_vector(cfg); | 2363 | send_cleanup_vector(cfg); |
2367 | 2364 | ||
2368 | cpumask_copy(desc->affinity, mask); | 2365 | cpumask_copy(data->affinity, mask); |
2369 | |||
2370 | return 0; | 2366 | return 0; |
2371 | } | 2367 | } |
2372 | 2368 | ||
2373 | /* | ||
2374 | * Migrates the IRQ destination in the process context. | ||
2375 | */ | ||
2376 | static int set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc, | ||
2377 | const struct cpumask *mask) | ||
2378 | { | ||
2379 | return migrate_ioapic_irq_desc(desc, mask); | ||
2380 | } | ||
2381 | static int set_ir_ioapic_affinity_irq(unsigned int irq, | ||
2382 | const struct cpumask *mask) | ||
2383 | { | ||
2384 | struct irq_desc *desc = irq_to_desc(irq); | ||
2385 | |||
2386 | return set_ir_ioapic_affinity_irq_desc(desc, mask); | ||
2387 | } | ||
2388 | #else | 2369 | #else |
2389 | static inline int set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc, | 2370 | static inline int |
2390 | const struct cpumask *mask) | 2371 | ir_ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, |
2372 | bool force) | ||
2391 | { | 2373 | { |
2392 | return 0; | 2374 | return 0; |
2393 | } | 2375 | } |
@@ -2662,18 +2644,18 @@ static struct irq_chip ioapic_chip __read_mostly = { | |||
2662 | }; | 2644 | }; |
2663 | 2645 | ||
2664 | static struct irq_chip ir_ioapic_chip __read_mostly = { | 2646 | static struct irq_chip ir_ioapic_chip __read_mostly = { |
2665 | .name = "IR-IO-APIC", | 2647 | .name = "IR-IO-APIC", |
2666 | .irq_startup = startup_ioapic_irq, | 2648 | .irq_startup = startup_ioapic_irq, |
2667 | .irq_mask = mask_ioapic_irq, | 2649 | .irq_mask = mask_ioapic_irq, |
2668 | .irq_unmask = unmask_ioapic_irq, | 2650 | .irq_unmask = unmask_ioapic_irq, |
2669 | #ifdef CONFIG_INTR_REMAP | 2651 | #ifdef CONFIG_INTR_REMAP |
2670 | .irq_ack = ir_ack_apic_edge, | 2652 | .irq_ack = ir_ack_apic_edge, |
2671 | .irq_eoi = ir_ack_apic_level, | 2653 | .irq_eoi = ir_ack_apic_level, |
2672 | #ifdef CONFIG_SMP | 2654 | #ifdef CONFIG_SMP |
2673 | .set_affinity = set_ir_ioapic_affinity_irq, | 2655 | .irq_set_affinity = ir_ioapic_set_affinity, |
2674 | #endif | 2656 | #endif |
2675 | #endif | 2657 | #endif |
2676 | .irq_retrigger = ioapic_retrigger_irq, | 2658 | .irq_retrigger = ioapic_retrigger_irq, |
2677 | }; | 2659 | }; |
2678 | 2660 | ||
2679 | static inline void init_IO_APIC_traps(void) | 2661 | static inline void init_IO_APIC_traps(void) |
@@ -4029,7 +4011,7 @@ void __init setup_ioapic_dest(void) | |||
4029 | mask = apic->target_cpus(); | 4011 | mask = apic->target_cpus(); |
4030 | 4012 | ||
4031 | if (intr_remapping_enabled) | 4013 | if (intr_remapping_enabled) |
4032 | set_ir_ioapic_affinity_irq_desc(desc, mask); | 4014 | ir_ioapic_set_affinity(&desc->irq_data, mask, false); |
4033 | else | 4015 | else |
4034 | ioapic_set_affinity(&desc->irq_data, mask, false); | 4016 | ioapic_set_affinity(&desc->irq_data, mask, false); |
4035 | } | 4017 | } |