aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2008-10-09 21:56:28 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-12 19:55:47 -0400
commit302905a3473d9a1f00e4b2fe373d2763a041a93d (patch)
treeed2405daf2551491edb7afbcb71a7f8bb49e95d8 /arch/powerpc/platforms/pseries
parent8767e9badca7cdf0adc2564d7524092d47ababf3 (diff)
powerpc/xics: Update default_server during migrate_irqs_away
Currently, every time we determine which irq server to use, we check if default_server, which is the id of the bootcpu, is still online. But default_server is a hardware cpu, not the logical cpu id needed to index cpu_online_map. Since the default server can only go offline during a cpu hotplug event, explicitly check the default server and choose the new one when we move irqs away from the cpu being offlined. This has the added benefit of only needing the boot_cpuid to be updated and not relying on the cpu being marked offline during migrate_irqs_away. Also, since xics_update_irq_servers only reads device tree information, we can call it before xics_init_host in xics_init_IRQ and then default_server will always be valid when we can reach get_irq_server via the host ops. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r--arch/powerpc/platforms/pseries/xics.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 1bccd4a56b57..c95697912fea 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -208,9 +208,6 @@ static int get_irq_server(unsigned int virq, unsigned int strict_check)
208 cpumask_t cpumask = irq_desc[virq].affinity; 208 cpumask_t cpumask = irq_desc[virq].affinity;
209 cpumask_t tmp = CPU_MASK_NONE; 209 cpumask_t tmp = CPU_MASK_NONE;
210 210
211 if (! cpu_isset(default_server, cpu_online_map))
212 xics_update_irq_servers();
213
214 if (!distribute_irqs) 211 if (!distribute_irqs)
215 return default_server; 212 return default_server;
216 213
@@ -685,8 +682,8 @@ void __init xics_init_IRQ(void)
685 if (found == 0) 682 if (found == 0)
686 return; 683 return;
687 684
688 xics_init_host();
689 xics_update_irq_servers(); 685 xics_update_irq_servers();
686 xics_init_host();
690 687
691 if (firmware_has_feature(FW_FEATURE_LPAR)) 688 if (firmware_has_feature(FW_FEATURE_LPAR))
692 ppc_md.get_irq = xics_get_irq_lpar; 689 ppc_md.get_irq = xics_get_irq_lpar;
@@ -779,6 +776,10 @@ void xics_migrate_irqs_away(void)
779 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id(); 776 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
780 unsigned int irq, virq; 777 unsigned int irq, virq;
781 778
779 /* If we used to be the default server, move to the new "boot_cpuid" */
780 if (hw_cpu == default_server)
781 xics_update_irq_servers();
782
782 /* Reject any interrupt that was queued to us... */ 783 /* Reject any interrupt that was queued to us... */
783 xics_set_cpu_priority(0); 784 xics_set_cpu_priority(0);
784 785