x86/irq: Clear move_in_progress before sending cleanup IPI
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / apic / vector.c
index 175d3ac4690e602ab61e0ef0cec0cc884757d6b7..f4c50d3f60e7611183ac23c959b943ce55fb1eec 100644 (file)
@@ -530,6 +530,8 @@ static void __send_cleanup_vector(struct apic_chip_data *data)
 {
        cpumask_var_t cleanup_mask;
 
+       raw_spin_lock(&vector_lock);
+       data->move_in_progress = 0;
        if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) {
                unsigned int i;
 
@@ -541,7 +543,7 @@ static void __send_cleanup_vector(struct apic_chip_data *data)
                apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
                free_cpumask_var(cleanup_mask);
        }
-       data->move_in_progress = 0;
+       raw_spin_unlock(&vector_lock);
 }
 
 void send_cleanup_vector(struct irq_cfg *cfg)