Skip to content

Commit 1371be0

Browse files
committed
cpumask: Use cpu_*_mask accessors code: alpha
Impact: use new API, fix SMP bug. Use the new accessors rather than frobbing bits directly. This also removes the bug introduced in ee0c468b (alpha: compile fixes) which had Alpha setting bits on an on-stack cpumask, not the cpu_online_map. Cc: Richard Henderson <rth@twiddle.net> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Acked-by: Ingo Molnar <mingo@elte.hu>
1 parent a0abd52 commit 1371be0

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎arch/alpha/kernel/process.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ common_shutdown_1(void *generic_ptr)
9393
if (cpuid != boot_cpuid) {
9494
flags |= 0x00040000UL; /* "remain halted" */
9595
*pflags = flags;
96-
cpu_clear(cpuid, cpu_present_map);
97-
cpu_clear(cpuid, cpu_possible_map);
96+
set_cpu_present(cpuid, false);
97+
set_cpu_possible(cpuid, false);
9898
halt();
9999
}
100100
#endif
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr)
120120

121121
#ifdef CONFIG_SMP
122122
/* Wait for the secondaries to halt. */
123-
cpu_clear(boot_cpuid, cpu_present_map);
124-
cpu_clear(boot_cpuid, cpu_possible_map);
123+
set_cpu_present(boot_cpuid, false);
124+
set_cpu_possible(boot_cpuid, false);
125125
while (cpus_weight(cpu_present_map))
126126
barrier();
127127
#endif

‎arch/alpha/kernel/smp.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ void __cpuinit
120120
smp_callin(void)
121121
{
122122
int cpuid = hard_smp_processor_id();
123-
cpumask_t mask = cpu_online_map;
124123

125-
if (cpu_test_and_set(cpuid, mask)) {
124+
if (cpu_online(cpuid)) {
126125
printk("??, cpu 0x%x already present??\n", cpuid);
127126
BUG();
128127
}
128+
set_cpu_online(cpuid, true);
129129

130130
/* Turn on machine checks. */
131131
wrmces(7);
@@ -436,8 +436,8 @@ setup_smp(void)
436436
((char *)cpubase + i*hwrpb->processor_size);
437437
if ((cpu->flags & 0x1cc) == 0x1cc) {
438438
smp_num_probed++;
439-
cpu_set(i, cpu_possible_map);
440-
cpu_set(i, cpu_present_map);
439+
set_cpu_possible(i, true);
440+
set_cpu_present(i, true);
441441
cpu->pal_revision = boot_cpu_palrev;
442442
}
443443

@@ -470,8 +470,8 @@ smp_prepare_cpus(unsigned int max_cpus)
470470

471471
/* Nothing to do on a UP box, or when told not to. */
472472
if (smp_num_probed == 1 || max_cpus == 0) {
473-
cpu_possible_map = cpumask_of_cpu(boot_cpuid);
474-
cpu_present_map = cpumask_of_cpu(boot_cpuid);
473+
init_cpu_possible(cpumask_of(boot_cpuid));
474+
init_cpu_present(cpumask_of(boot_cpuid));
475475
printk(KERN_INFO "SMP mode deactivated.\n");
476476
return;
477477
}

0 commit comments

Comments
 (0)