x86/irq: Move check of cfg->move_in_progress into send_cleanup_vector()
authorJiang Liu <jiang.liu@linux.intel.com>
Tue, 14 Apr 2015 02:30:02 +0000 (10:30 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 24 Apr 2015 13:36:54 +0000 (15:36 +0200)
Move check of cfg->move_in_progress into send_cleanup_vector() to
prepare for simplifying struct irq_cfg.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Tested-by: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: iommu@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Joerg Roedel <joro@8bytes.org>
Link: http://lkml.kernel.org/r/1428978610-28986-26-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/vector.c
arch/x86/platform/uv/uv_irq.c
drivers/iommu/amd_iommu.c
drivers/iommu/intel_irq_remapping.c

index 1aea62d60cf26923fde6ad2e59ef959d8257d8c3..0092a6e0d5ee6e79c0306e020f4560a0e0f98e00 100644 (file)
@@ -494,7 +494,7 @@ static struct irq_chip lapic_controller = {
 };
 
 #ifdef CONFIG_SMP
-void send_cleanup_vector(struct irq_cfg *cfg)
+static void __send_cleanup_vector(struct irq_cfg *cfg)
 {
        cpumask_var_t cleanup_mask;
 
@@ -512,6 +512,12 @@ void send_cleanup_vector(struct irq_cfg *cfg)
        cfg->move_in_progress = 0;
 }
 
+void send_cleanup_vector(struct irq_cfg *cfg)
+{
+       if (cfg->move_in_progress)
+               __send_cleanup_vector(cfg);
+}
+
 asmlinkage __visible void smp_irq_move_cleanup_interrupt(void)
 {
        unsigned vector, me;
@@ -582,7 +588,7 @@ static void __irq_complete_move(struct irq_cfg *cfg, unsigned vector)
        me = smp_processor_id();
 
        if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
-               send_cleanup_vector(cfg);
+               __send_cleanup_vector(cfg);
 }
 
 void irq_complete_move(struct irq_cfg *cfg)
index 54af6e388a12e527a8ade55b9de8e95ef038bb10..091b36ac44c4015ca3ee099b7255586583252bfc 100644 (file)
@@ -63,8 +63,7 @@ uv_set_irq_affinity(struct irq_data *data, const struct cpumask *mask,
        ret = parent->chip->irq_set_affinity(parent, mask, force);
        if (ret >= 0) {
                uv_program_mmr(cfg, data->chip_data);
-               if (cfg->move_in_progress)
-                       send_cleanup_vector(cfg);
+               send_cleanup_vector(cfg);
        }
 
        return ret;
index b5d903cb280435395c44d0d802700614415eefb4..cbe8c1f28a95d710143e35f74f6e902eb4037ea9 100644 (file)
@@ -4327,8 +4327,7 @@ static int amd_ir_set_affinity(struct irq_data *data,
         * at the new destination. So, time to cleanup the previous
         * vector allocation.
         */
-       if (cfg->move_in_progress)
-               send_cleanup_vector(cfg);
+       send_cleanup_vector(cfg);
 
        return IRQ_SET_MASK_OK_DONE;
 }
index 34642d3f7fbd34d71cadfcefcf3c8b740fa59a6f..14d95694fc1b5748f1ee5e381be9cdaf1f40c424 100644 (file)
@@ -1003,8 +1003,7 @@ intel_ir_set_affinity(struct irq_data *data, const struct cpumask *mask,
         * at the new destination. So, time to cleanup the previous
         * vector allocation.
         */
-       if (cfg->move_in_progress)
-               send_cleanup_vector(cfg);
+       send_cleanup_vector(cfg);
 
        return IRQ_SET_MASK_OK_DONE;
 }