aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic/common/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/netlogic/common/smp.c')
-rw-r--r--arch/mips/netlogic/common/smp.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c
index e743bdd6e20c..dc3e327fbbac 100644
--- a/arch/mips/netlogic/common/smp.c
+++ b/arch/mips/netlogic/common/smp.c
@@ -59,17 +59,17 @@
59 59
60void nlm_send_ipi_single(int logical_cpu, unsigned int action) 60void nlm_send_ipi_single(int logical_cpu, unsigned int action)
61{ 61{
62 int cpu, node; 62 unsigned int hwtid;
63 uint64_t picbase; 63 uint64_t picbase;
64 64
65 cpu = cpu_logical_map(logical_cpu); 65 /* node id is part of hwtid, and needed for send_ipi */
66 node = nlm_cpuid_to_node(cpu); 66 hwtid = cpu_logical_map(logical_cpu);
67 picbase = nlm_get_node(node)->picbase; 67 picbase = nlm_get_node(nlm_hwtid_to_node(hwtid))->picbase;
68 68
69 if (action & SMP_CALL_FUNCTION) 69 if (action & SMP_CALL_FUNCTION)
70 nlm_pic_send_ipi(picbase, cpu, IRQ_IPI_SMP_FUNCTION, 0); 70 nlm_pic_send_ipi(picbase, hwtid, IRQ_IPI_SMP_FUNCTION, 0);
71 if (action & SMP_RESCHEDULE_YOURSELF) 71 if (action & SMP_RESCHEDULE_YOURSELF)
72 nlm_pic_send_ipi(picbase, cpu, IRQ_IPI_SMP_RESCHEDULE, 0); 72 nlm_pic_send_ipi(picbase, hwtid, IRQ_IPI_SMP_RESCHEDULE, 0);
73} 73}
74 74
75void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action) 75void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action)
@@ -120,6 +120,7 @@ static void nlm_init_secondary(void)
120 120
121 hwtid = hard_smp_processor_id(); 121 hwtid = hard_smp_processor_id();
122 current_cpu_data.core = hwtid / NLM_THREADS_PER_CORE; 122 current_cpu_data.core = hwtid / NLM_THREADS_PER_CORE;
123 current_cpu_data.package = nlm_nodeid();
123 nlm_percpu_init(hwtid); 124 nlm_percpu_init(hwtid);
124 nlm_smp_irq_init(hwtid); 125 nlm_smp_irq_init(hwtid);
125} 126}
@@ -145,16 +146,18 @@ static cpumask_t phys_cpu_present_mask;
145 146
146void nlm_boot_secondary(int logical_cpu, struct task_struct *idle) 147void nlm_boot_secondary(int logical_cpu, struct task_struct *idle)
147{ 148{
148 int cpu, node; 149 uint64_t picbase;
150 int hwtid;
151
152 hwtid = cpu_logical_map(logical_cpu);
153 picbase = nlm_get_node(nlm_hwtid_to_node(hwtid))->picbase;
149 154
150 cpu = cpu_logical_map(logical_cpu);
151 node = nlm_cpuid_to_node(logical_cpu);
152 nlm_next_sp = (unsigned long)__KSTK_TOS(idle); 155 nlm_next_sp = (unsigned long)__KSTK_TOS(idle);
153 nlm_next_gp = (unsigned long)task_thread_info(idle); 156 nlm_next_gp = (unsigned long)task_thread_info(idle);
154 157
155 /* barrier for sp/gp store above */ 158 /* barrier for sp/gp store above */
156 __sync(); 159 __sync();
157 nlm_pic_send_ipi(nlm_get_node(node)->picbase, cpu, 1, 1); /* NMI */ 160 nlm_pic_send_ipi(picbase, hwtid, 1, 1); /* NMI */
158} 161}
159 162
160void __init nlm_smp_setup(void) 163void __init nlm_smp_setup(void)
@@ -182,7 +185,7 @@ void __init nlm_smp_setup(void)
182 __cpu_number_map[i] = num_cpus; 185 __cpu_number_map[i] = num_cpus;
183 __cpu_logical_map[num_cpus] = i; 186 __cpu_logical_map[num_cpus] = i;
184 set_cpu_possible(num_cpus, true); 187 set_cpu_possible(num_cpus, true);
185 node = nlm_cpuid_to_node(i); 188 node = nlm_hwtid_to_node(i);
186 cpumask_set_cpu(num_cpus, &nlm_get_node(node)->cpumask); 189 cpumask_set_cpu(num_cpus, &nlm_get_node(node)->cpumask);
187 ++num_cpus; 190 ++num_cpus;
188 } 191 }