aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-12-31 11:30:53 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-01-15 07:44:01 -0500
commit90a2282e23f0522e4b3f797ad447c5e91bf7fe32 (patch)
tree8038e0e6ce97abe95d108b29c7f0d0fb25aac172
parent56d7d2f4bbd00fb198b7907cb3ab657d06115a42 (diff)
x86/irq: Call irq_force_move_complete with irq descriptor
First of all there is no point in looking up the irq descriptor again, but we also need the descriptor for the final cleanup race fix in the next patch. Make that change seperate. No functional difference. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Borislav Petkov <bp@alien8.de> Tested-by: Joe Lawrence <joe.lawrence@stratus.com> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Jeremiah Mahler <jmmahler@gmail.com> Cc: andy.shevchenko@gmail.com Cc: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org #4.3+ Link: http://lkml.kernel.org/r/20151231160107.125211743@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/include/asm/irq.h5
-rw-r--r--arch/x86/kernel/apic/vector.c11
-rw-r--r--arch/x86/kernel/irq.c2
3 files changed, 11 insertions, 7 deletions
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 881b4768644a..e7de5c9a4fbd 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -23,11 +23,13 @@ extern void irq_ctx_init(int cpu);
23 23
24#define __ARCH_HAS_DO_SOFTIRQ 24#define __ARCH_HAS_DO_SOFTIRQ
25 25
26struct irq_desc;
27
26#ifdef CONFIG_HOTPLUG_CPU 28#ifdef CONFIG_HOTPLUG_CPU
27#include <linux/cpumask.h> 29#include <linux/cpumask.h>
28extern int check_irq_vectors_for_cpu_disable(void); 30extern int check_irq_vectors_for_cpu_disable(void);
29extern void fixup_irqs(void); 31extern void fixup_irqs(void);
30extern void irq_force_complete_move(int); 32extern void irq_force_complete_move(struct irq_desc *desc);
31#endif 33#endif
32 34
33#ifdef CONFIG_HAVE_KVM 35#ifdef CONFIG_HAVE_KVM
@@ -37,7 +39,6 @@ extern void kvm_set_posted_intr_wakeup_handler(void (*handler)(void));
37extern void (*x86_platform_ipi_callback)(void); 39extern void (*x86_platform_ipi_callback)(void);
38extern void native_init_IRQ(void); 40extern void native_init_IRQ(void);
39 41
40struct irq_desc;
41extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs); 42extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
42 43
43extern __visible unsigned int do_IRQ(struct pt_regs *regs); 44extern __visible unsigned int do_IRQ(struct pt_regs *regs);
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index a7fa11e49582..5f7883578880 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -630,10 +630,14 @@ void irq_complete_move(struct irq_cfg *cfg)
630 __irq_complete_move(cfg, ~get_irq_regs()->orig_ax); 630 __irq_complete_move(cfg, ~get_irq_regs()->orig_ax);
631} 631}
632 632
633void irq_force_complete_move(int irq) 633/*
634 * Called with @desc->lock held and interrupts disabled.
635 */
636void irq_force_complete_move(struct irq_desc *desc)
634{ 637{
635 struct irq_cfg *cfg = irq_cfg(irq); 638 struct irq_data *irqdata = irq_desc_get_irq_data(desc);
636 struct apic_chip_data *data; 639 struct apic_chip_data *data = apic_chip_data(irqdata);
640 struct irq_cfg *cfg = data ? &data->cfg : NULL;
637 641
638 if (!cfg) 642 if (!cfg)
639 return; 643 return;
@@ -647,7 +651,6 @@ void irq_force_complete_move(int irq)
647 * the way out. 651 * the way out.
648 */ 652 */
649 raw_spin_lock(&vector_lock); 653 raw_spin_lock(&vector_lock);
650 data = container_of(cfg, struct apic_chip_data, cfg);
651 cpumask_clear_cpu(smp_processor_id(), data->old_domain); 654 cpumask_clear_cpu(smp_processor_id(), data->old_domain);
652 raw_spin_unlock(&vector_lock); 655 raw_spin_unlock(&vector_lock);
653} 656}
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index c0b58dd1ca04..61521dc19c10 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -462,7 +462,7 @@ void fixup_irqs(void)
462 * non intr-remapping case, we can't wait till this interrupt 462 * non intr-remapping case, we can't wait till this interrupt
463 * arrives at this cpu before completing the irq move. 463 * arrives at this cpu before completing the irq move.
464 */ 464 */
465 irq_force_complete_move(irq); 465 irq_force_complete_move(desc);
466 466
467 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { 467 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
468 break_affinity = 1; 468 break_affinity = 1;