aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2015-04-13 22:30:02 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-04-24 09:36:54 -0400
commitc6c2002b744215810c770dd73f45da954bcfa9d5 (patch)
tree447fdad19766f9b2416c59b6a0e095f11a36fcfb
parent68f9f4404d74f859dc84973db8731b41a51d929a (diff)
x86/irq: Move check of cfg->move_in_progress into send_cleanup_vector()
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>
-rw-r--r--arch/x86/kernel/apic/vector.c10
-rw-r--r--arch/x86/platform/uv/uv_irq.c3
-rw-r--r--drivers/iommu/amd_iommu.c3
-rw-r--r--drivers/iommu/intel_irq_remapping.c3
4 files changed, 11 insertions, 8 deletions
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 1aea62d60cf2..0092a6e0d5ee 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -494,7 +494,7 @@ static struct irq_chip lapic_controller = {
494}; 494};
495 495
496#ifdef CONFIG_SMP 496#ifdef CONFIG_SMP
497void send_cleanup_vector(struct irq_cfg *cfg) 497static void __send_cleanup_vector(struct irq_cfg *cfg)
498{ 498{
499 cpumask_var_t cleanup_mask; 499 cpumask_var_t cleanup_mask;
500 500
@@ -512,6 +512,12 @@ void send_cleanup_vector(struct irq_cfg *cfg)
512 cfg->move_in_progress = 0; 512 cfg->move_in_progress = 0;
513} 513}
514 514
515void send_cleanup_vector(struct irq_cfg *cfg)
516{
517 if (cfg->move_in_progress)
518 __send_cleanup_vector(cfg);
519}
520
515asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) 521asmlinkage __visible void smp_irq_move_cleanup_interrupt(void)
516{ 522{
517 unsigned vector, me; 523 unsigned vector, me;
@@ -582,7 +588,7 @@ static void __irq_complete_move(struct irq_cfg *cfg, unsigned vector)
582 me = smp_processor_id(); 588 me = smp_processor_id();
583 589
584 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) 590 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
585 send_cleanup_vector(cfg); 591 __send_cleanup_vector(cfg);
586} 592}
587 593
588void irq_complete_move(struct irq_cfg *cfg) 594void irq_complete_move(struct irq_cfg *cfg)
diff --git a/arch/x86/platform/uv/uv_irq.c b/arch/x86/platform/uv/uv_irq.c
index 54af6e388a12..091b36ac44c4 100644
--- a/arch/x86/platform/uv/uv_irq.c
+++ b/arch/x86/platform/uv/uv_irq.c
@@ -63,8 +63,7 @@ uv_set_irq_affinity(struct irq_data *data, const struct cpumask *mask,
63 ret = parent->chip->irq_set_affinity(parent, mask, force); 63 ret = parent->chip->irq_set_affinity(parent, mask, force);
64 if (ret >= 0) { 64 if (ret >= 0) {
65 uv_program_mmr(cfg, data->chip_data); 65 uv_program_mmr(cfg, data->chip_data);
66 if (cfg->move_in_progress) 66 send_cleanup_vector(cfg);
67 send_cleanup_vector(cfg);
68 } 67 }
69 68
70 return ret; 69 return ret;
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index b5d903cb2804..cbe8c1f28a95 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -4327,8 +4327,7 @@ static int amd_ir_set_affinity(struct irq_data *data,
4327 * at the new destination. So, time to cleanup the previous 4327 * at the new destination. So, time to cleanup the previous
4328 * vector allocation. 4328 * vector allocation.
4329 */ 4329 */
4330 if (cfg->move_in_progress) 4330 send_cleanup_vector(cfg);
4331 send_cleanup_vector(cfg);
4332 4331
4333 return IRQ_SET_MASK_OK_DONE; 4332 return IRQ_SET_MASK_OK_DONE;
4334} 4333}
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 34642d3f7fbd..14d95694fc1b 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -1003,8 +1003,7 @@ intel_ir_set_affinity(struct irq_data *data, const struct cpumask *mask,
1003 * at the new destination. So, time to cleanup the previous 1003 * at the new destination. So, time to cleanup the previous
1004 * vector allocation. 1004 * vector allocation.
1005 */ 1005 */
1006 if (cfg->move_in_progress) 1006 send_cleanup_vector(cfg);
1007 send_cleanup_vector(cfg);
1008 1007
1009 return IRQ_SET_MASK_OK_DONE; 1008 return IRQ_SET_MASK_OK_DONE;
1010} 1009}