Skip to contentSkip to conversation

cpumask: remove the now-obsoleted pcibus_to_cpumask(): sh

PATCH New Rusty Russell 2 participants 6 messages Jun 12, 2009 – Jun 15, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 4/17 cpumask: remove the now-obsoleted pcibus_to_cpumask(): sh

cpumask_of_pcibus() is the new version.

---
 arch/sh/include/asm/topology.h |    3 ---
 1 file changed, 3 deletions(-)
arch/sh/include/asm/topology.h +0 -3
@@ -35,9 +35,6 @@
 #define cpumask_of_node(node)	((void)node, cpu_online_mask)
 
 #define pcibus_to_node(bus)	((void)(bus), -1)
-#define pcibus_to_cpumask(bus)	(pcibus_to_node(bus) == -1 ? \
-					CPU_MASK_ALL : \
-					node_to_cpumask(pcibus_to_node(bus)))
 #define cpumask_of_pcibus(bus)	(pcibus_to_node(bus) == -1 ? \
 					CPU_MASK_ALL_PTR : \
 					cpumask_of_node(pcibus_to_node(bus)))
#1 lore raw

PATCH 5/13 cpumask: Use accessors for cpu_*_mask: sh

Use the accessors rather than frobbing bits directly (the new versions are const).

---
 arch/sh/kernel/cpu/sh4a/smp-shx3.c |    5 ++---
 arch/sh/kernel/smp.c               |    6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)
arch/sh/kernel/cpu/sh4a/smp-shx3.c +2 -3
@@ -19,8 +19,7 @@ void __init plat_smp_setup(void)
 	unsigned int cpu = 0;
 	int i, num;
 
-	cpus_clear(cpu_possible_map);
-	cpu_set(cpu, cpu_possible_map);
+	init_cpu_possible(cpumask_of(cpu));
 
 	__cpu_number_map[0] = 0;
 	__cpu_logical_map[0] = 0;
@@ -30,7 +29,7 @@ void __init plat_smp_setup(void)
 	 * for the total number of cores.
 	 */
 	for (i = 1, num = 0; i < NR_CPUS; i++) {
-		cpu_set(i, cpu_possible_map);
+		set_cpu_possible(i, true);
 		__cpu_number_map[i] = ++num;
 		__cpu_logical_map[num] = i;
 	}
arch/sh/kernel/smp.c +3 -3
@@ -52,7 +52,7 @@ void __init smp_prepare_cpus(unsigned in
 	plat_prepare_cpus(max_cpus);
 
 #ifndef CONFIG_HOTPLUG_CPU
-	cpu_present_map = cpu_possible_map;
+	init_cpu_present(&cpu_possible_map);
 #endif
 }
 
@@ -63,8 +63,8 @@ void __devinit smp_prepare_boot_cpu(void
 	__cpu_number_map[0] = cpu;
 	__cpu_logical_map[0] = cpu;
 
-	cpu_set(cpu, cpu_online_map);
-	cpu_set(cpu, cpu_possible_map);
+	set_cpu_online(cpu, true);
+	set_cpu_possible(cpu, true);
 }
 
 asmlinkage void __cpuinit start_secondary(void)
#2 lore raw
Quoted 1 line · Rusty Russell

cpumask_of_pcibus() is the new version.

Quoted 3 lines · Rusty Russell

We're weaning the core code off handing cpumask's around on-stack. This introduces arch_send_call_function_ipi_mask(), and by defining it, the old arch_send_call_function_ipi is defined by the core code.

Quoted 4 lines · Rusty Russell

Makes code futureproof against the impending change to mm->cpu_vm_mask.

It's also a chance to use the new cpumask_ ops which take a pointer (the older ones are deprecated, but there's no hurry for arch code).

Quoted 2 lines · Rusty Russell

Use the accessors rather than frobbing bits directly (the new versions are const).

I've taken these in to the sh tree, thanks. They'll be included in the next round of updates for -rc1.

I'm not sure how you want to handle the remaining patches. The outstanding ones obviously touch code all over the place and should probably go in in one go after the merge window has settled down a bit.

#3 lore raw
Quoted 6 lines · Paul Mundt

I've taken these in to the sh tree, thanks. They'll be included in the next round of updates for -rc1.

I'm not sure how you want to handle the remaining patches. The outstanding ones obviously touch code all over the place and should probably go in in one go after the merge window has settled down a bit.

Thanks, that's the basic plan. They'll sit in linux-next until then.

(The other option was for you to just ack them and they'll go with the rest to Linus; in fact, that's going to happen to maintainers who don't respond anyway :)

Cheers,
Rusty.

#4 lore raw

PATCH 11/13 cpumask: use mm_cpumask() wrapper: sh

Makes code futureproof against the impending change to mm->cpu_vm_mask.

It's also a chance to use the new cpumask_ ops which take a pointer (the older ones are deprecated, but there's no hurry for arch code).

---
 arch/sh/include/asm/mmu_context.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sh/include/asm/mmu_context.h +2 -2
@@ -117,11 +117,11 @@ static inline void switch_mm(struct mm_s
 	unsigned int cpu = smp_processor_id();
 
 	if (likely(prev != next)) {
-		cpu_set(cpu, next->cpu_vm_mask);
+		cpumask_set_cpu(cpu, mm_cpumask(next));
 		set_TTB(next->pgd);
 		activate_context(next, cpu);
 	} else
-		if (!cpu_test_and_set(cpu, next->cpu_vm_mask))
+		if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)))
 			activate_context(next, cpu);
 }
 #else
#5 lore raw

PATCH 5/7 cpumask: arch_send_call_function_ipi_mask: sh

We're weaning the core code off handing cpumask's around on-stack. This introduces arch_send_call_function_ipi_mask(), and by defining it, the old arch_send_call_function_ipi is defined by the core code.

---
 arch/sh/include/asm/smp.h |    3 ++-
 arch/sh/kernel/smp.c      |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/sh/include/asm/smp.h +2 -1
@@ -43,7 +43,8 @@ void plat_send_ipi(unsigned int cpu, uns
 void plat_send_ipi(unsigned int cpu, unsigned int message);
 
 void arch_send_call_function_single_ipi(int cpu);
-void arch_send_call_function_ipi(cpumask_t mask);
+extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
+#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
 
 #else
 
arch/sh/kernel/smp.c +2 -2
@@ -171,11 +171,11 @@ void smp_send_stop(void)
 	smp_call_function(stop_this_cpu, 0, 0);
 }
 
-void arch_send_call_function_ipi(cpumask_t mask)
+void arch_send_call_function_ipi_mask(const struct cpumask *mask)
 {
 	int cpu;
 
-	for_each_cpu_mask(cpu, mask)
+	for_each_cpu(cpu, mask)
 		plat_send_ipi(cpu, SMP_MSG_FUNCTION);
 }