aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-06-04 16:31:34 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-06-10 08:43:29 -0400
commit53b94fdc8fa0ccd88f97b72a6149672d7ddc0c50 (patch)
tree97bd921130a776d20ee6a34a527cbec4b418d8cf /arch/x86/xen
parent405010df1dd657151543d93b01578b0c533788b5 (diff)
xen/smp: Coalesce the free_irq calls in one function.
There are two functions that do a bunch of 'free_irq' on the per_cpu IRQ. Instead of having duplicate code just move it to one function. This is just code movement. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/smp.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index fb44426fe931..19fc9f39e9cc 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -98,6 +98,23 @@ static void __cpuinit cpu_bringup_and_idle(void)
98 cpu_startup_entry(CPUHP_ONLINE); 98 cpu_startup_entry(CPUHP_ONLINE);
99} 99}
100 100
101static void xen_smp_intr_free(unsigned int cpu)
102{
103 if (per_cpu(xen_resched_irq, cpu) >= 0)
104 unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL);
105 if (per_cpu(xen_callfunc_irq, cpu) >= 0)
106 unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
107 if (per_cpu(xen_debug_irq, cpu) >= 0)
108 unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
109 if (per_cpu(xen_callfuncsingle_irq, cpu) >= 0)
110 unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu),
111 NULL);
112 if (xen_hvm_domain())
113 return;
114
115 if (per_cpu(xen_irq_work, cpu) >= 0)
116 unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);
117};
101static int xen_smp_intr_init(unsigned int cpu) 118static int xen_smp_intr_init(unsigned int cpu)
102{ 119{
103 int rc; 120 int rc;
@@ -165,21 +182,7 @@ static int xen_smp_intr_init(unsigned int cpu)
165 return 0; 182 return 0;
166 183
167 fail: 184 fail:
168 if (per_cpu(xen_resched_irq, cpu) >= 0) 185 xen_smp_intr_free(cpu);
169 unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL);
170 if (per_cpu(xen_callfunc_irq, cpu) >= 0)
171 unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
172 if (per_cpu(xen_debug_irq, cpu) >= 0)
173 unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
174 if (per_cpu(xen_callfuncsingle_irq, cpu) >= 0)
175 unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu),
176 NULL);
177 if (xen_hvm_domain())
178 return rc;
179
180 if (per_cpu(xen_irq_work, cpu) >= 0)
181 unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);
182
183 return rc; 186 return rc;
184} 187}
185 188
@@ -432,12 +435,7 @@ static void xen_cpu_die(unsigned int cpu)
432 current->state = TASK_UNINTERRUPTIBLE; 435 current->state = TASK_UNINTERRUPTIBLE;
433 schedule_timeout(HZ/10); 436 schedule_timeout(HZ/10);
434 } 437 }
435 unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL); 438 xen_smp_intr_free(cpu);
436 unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
437 unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
438 unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);
439 if (!xen_hvm_domain())
440 unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);
441 xen_uninit_lock_cpu(cpu); 439 xen_uninit_lock_cpu(cpu);
442 xen_teardown_timer(cpu); 440 xen_teardown_timer(cpu);
443} 441}