]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | Subject: Update default_server during migrate_irqs_away |
2 | From: Milton Miller <miltonm@bga.com> | |
3 | References: 460566 - LTC50723 | |
4 | ||
5 | Currently, every time we determine which irq server to use, we check if | |
6 | default_server, which is the id of the bootcpu, is still online. But | |
7 | default_server is a hardware cpu, not the logical cpu id needed to index | |
8 | cpu_online_map. | |
9 | ||
10 | Since the default server can only go offline during a cpu hotplug event, | |
11 | explicitly check the default server and choose the new one when we move | |
12 | irqs away from the cpu being offlined. | |
13 | ||
14 | This has the added benefit of only needing the boot_cpuid to be updated | |
15 | and not relying on the cpu being marked offline during migrate_irqs_away. | |
16 | ||
17 | Also, since xics_update_irq_servers only reads device tree information, we | |
18 | can call it before xics_init_host in xics_init_IRQ and then default_server | |
19 | will always be valid when we can reach get_irq_server via the host ops. | |
20 | ||
21 | Signed-off-by: Milton Miller <miltonm@bga.com> | |
22 | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> | |
23 | Signed-off-by: Olaf Hering <olh@suse.de> | |
24 | --- | |
25 | arch/powerpc/platforms/pseries/xics.c | 9 +++++---- | |
26 | 1 file changed, 5 insertions(+), 4 deletions(-) | |
27 | ||
28 | --- a/arch/powerpc/platforms/pseries/xics.c | |
29 | +++ b/arch/powerpc/platforms/pseries/xics.c | |
30 | @@ -208,9 +208,6 @@ static int get_irq_server(unsigned int v | |
31 | cpumask_t cpumask = irq_desc[virq].affinity; | |
32 | cpumask_t tmp = CPU_MASK_NONE; | |
33 | ||
34 | - if (! cpu_isset(default_server, cpu_online_map)) | |
35 | - xics_update_irq_servers(); | |
36 | - | |
37 | if (!distribute_irqs) | |
38 | return default_server; | |
39 | ||
40 | @@ -659,8 +656,8 @@ void __init xics_init_IRQ(void) | |
41 | if (found == 0) | |
42 | return; | |
43 | ||
44 | - xics_init_host(); | |
45 | xics_update_irq_servers(); | |
46 | + xics_init_host(); | |
47 | ||
48 | if (firmware_has_feature(FW_FEATURE_LPAR)) | |
49 | ppc_md.get_irq = xics_get_irq_lpar; | |
50 | @@ -753,6 +750,10 @@ void xics_migrate_irqs_away(void) | |
51 | int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id(); | |
52 | unsigned int irq, virq; | |
53 | ||
54 | + /* If we used to be the default server, move to the new "boot_cpuid" */ | |
55 | + if (hw_cpu == default_server) | |
56 | + xics_update_irq_servers(); | |
57 | + | |
58 | /* Reject any interrupt that was queued to us... */ | |
59 | xics_set_cpu_priority(0); | |
60 |