Skip to content

Commit

Permalink
ARM: consolidate SMP cross call implementation
Browse files Browse the repository at this point in the history
Rather than having each platform class provide a mach/smp.h header for
smp_cross_call(), arrange for them to register the function with the
core ARM SMP code instead.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed May 23, 2011
1 parent 43b3e18 commit 0f7b332
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 162 deletions.
6 changes: 2 additions & 4 deletions arch/arm/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include <linux/cpumask.h>
#include <linux/thread_info.h>

#include <mach/smp.h>

#ifndef CONFIG_SMP
# error "<asm/smp.h> included in non-SMP build"
#endif
Expand Down Expand Up @@ -47,9 +45,9 @@ extern void smp_init_cpus(void);


/*
* Raise an IPI cross call on CPUs in callmap.
* Provide a function to raise an IPI cross call on CPUs in callmap.
*/
extern void smp_cross_call(const struct cpumask *mask, int ipi);
extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));

/*
* Boot a secondary CPU, and assign it the specified idle task.
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
}
}

static void (*smp_cross_call)(const struct cpumask *, unsigned int);

void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
{
smp_cross_call = fn;
}

void arch_send_call_function_ipi_mask(const struct cpumask *mask)
{
smp_cross_call(mask, IPI_CALL_FUNC);
Expand Down
19 changes: 0 additions & 19 deletions arch/arm/mach-exynos4/include/mach/smp.h

This file was deleted.

5 changes: 4 additions & 1 deletion arch/arm/mach-exynos4/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/io.h>

#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
#include <asm/smp_scu.h>
#include <asm/unified.h>

Expand Down Expand Up @@ -104,7 +105,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* the boot monitor to read the system wide flags register,
* and branch to the address found there.
*/
smp_cross_call(cpumask_of(cpu), 1);
gic_raise_softirq(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down Expand Up @@ -147,6 +148,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
23 changes: 0 additions & 23 deletions arch/arm/mach-msm/include/mach/smp.h

This file was deleted.

4 changes: 3 additions & 1 deletion arch/arm/mach-msm/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* the boot monitor to read the system wide flags register,
* and branch to the address found there.
*/
smp_cross_call(cpumask_of(cpu), 1);
gic_raise_softirq(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down Expand Up @@ -151,6 +151,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < NR_CPUS; i++)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/mach-omap2/omap-smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/io.h>

#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
#include <asm/smp_scu.h>
#include <mach/hardware.h>
#include <mach/omap4-common.h>
Expand Down Expand Up @@ -63,7 +64,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
omap_modify_auxcoreboot0(0x200, 0xfffffdff);
flush_cache_all();
smp_wmb();
smp_cross_call(cpumask_of(cpu), 1);
gic_raise_softirq(cpumask_of(cpu), 1);

/*
* Now the secondary core is starting up let it run its
Expand Down Expand Up @@ -118,6 +119,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
14 changes: 0 additions & 14 deletions arch/arm/mach-realview/include/mach/smp.h

This file was deleted.

3 changes: 3 additions & 0 deletions arch/arm/mach-realview/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/io.h>

#include <mach/hardware.h>
#include <asm/hardware/gic.h>
#include <asm/mach-types.h>
#include <asm/smp_scu.h>
#include <asm/unified.h>
Expand Down Expand Up @@ -61,6 +62,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
16 changes: 0 additions & 16 deletions arch/arm/mach-shmobile/include/mach/smp.h

This file was deleted.

3 changes: 3 additions & 0 deletions arch/arm/mach-shmobile/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/device.h>
#include <linux/smp.h>
#include <linux/io.h>
#include <asm/hardware/gic.h>
#include <asm/localtimer.h>
#include <asm/mach-types.h>
#include <mach/common.h>
Expand Down Expand Up @@ -57,6 +58,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
14 changes: 0 additions & 14 deletions arch/arm/mach-tegra/include/mach/smp.h

This file was deleted.

3 changes: 3 additions & 0 deletions arch/arm/mach-tegra/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/io.h>

#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/smp_scu.h>
Expand Down Expand Up @@ -122,6 +123,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < ncores; i++)
cpu_set(i, cpu_possible_map);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
24 changes: 0 additions & 24 deletions arch/arm/mach-ux500/include/mach/smp.h

This file was deleted.

5 changes: 4 additions & 1 deletion arch/arm/mach-ux500/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/io.h>

#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
#include <asm/smp_scu.h>
#include <mach/hardware.h>
#include <mach/setup.h>
Expand Down Expand Up @@ -94,7 +95,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
*/
write_pen_release(cpu);

smp_cross_call(cpumask_of(cpu), 1);
gic_raise_softirq(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down Expand Up @@ -162,6 +163,8 @@ void __init smp_init_cpus(void)

for (i = 0; i < ncores; i++)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-vexpress/ct-ca9x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ static void ct_ca9x4_init_cpu_map(void)

for (i = 0; i < ncores; ++i)
set_cpu_possible(i, true);

set_smp_cross_call(gic_raise_softirq);
}

static void ct_ca9x4_smp_enable(unsigned int max_cpus)
Expand Down
13 changes: 0 additions & 13 deletions arch/arm/mach-vexpress/include/mach/smp.h

This file was deleted.

30 changes: 0 additions & 30 deletions arch/arm/plat-omap/include/plat/smp.h

This file was deleted.

3 changes: 2 additions & 1 deletion arch/arm/plat-versatile/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/smp.h>

#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>

/*
* control for which core is the next to come out of the secondary
Expand Down Expand Up @@ -83,7 +84,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* the boot monitor to read the system wide flags register,
* and branch to the address found there.
*/
smp_cross_call(cpumask_of(cpu), 1);
gic_raise_softirq(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down

0 comments on commit 0f7b332

Please sign in to comment.