Skip to content

Commit

Permalink
ARM: SMP: pass an ipi number to smp_cross_call()
Browse files Browse the repository at this point in the history
This allows us to use smp_cross_call() to trigger a number of different
software generated interrupts, rather than combining them all on one
SGI.  Recover the SGI number via do_IPI.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Dec 3, 2010
1 parent d92e047 commit ad3b699
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 30 deletions.
4 changes: 2 additions & 2 deletions arch/arm/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern void show_ipi_list(struct seq_file *p);
/*
* Called from assembly code, this handles an IPI.
*/
asmlinkage void do_IPI(struct pt_regs *regs);
asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);

/*
* Setup the set of possible CPUs (via set_cpu_possible)
Expand All @@ -53,7 +53,7 @@ extern void smp_store_cpu_info(unsigned int cpuid);
/*
* Raise an IPI cross call on CPUs in callmap.
*/
extern void smp_cross_call(const struct cpumask *mask);
extern void smp_cross_call(const struct cpumask *mask, int ipi);

/*
* Boot a secondary CPU, and assign it the specified idle task.
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/entry-armv.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
ALT_SMP(test_for_ipi r0, r6, r5, lr)
ALT_UP_B(9997f)
movne r0, sp
movne r1, sp
adrne lr, BSYM(1b)
bne do_IPI

Expand Down
10 changes: 2 additions & 8 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static void send_ipi_message(const struct cpumask *mask, enum ipi_msg_type msg)
/*
* Call the platform specific cross-CPU call function.
*/
smp_cross_call(mask);
smp_cross_call(mask, 1);

local_irq_restore(flags);
}
Expand Down Expand Up @@ -537,14 +537,8 @@ static void ipi_cpu_stop(unsigned int cpu)

/*
* Main handler for inter-processor interrupts
*
* For ARM, the ipimask now only identifies a single
* category of IPI (Bit 1 IPIs have been replaced by a
* different mechanism):
*
* Bit 0 - Inter-processor function call
*/
asmlinkage void __exception do_IPI(struct pt_regs *regs)
asmlinkage void __exception do_IPI(int ipinr, struct pt_regs *regs)
{
unsigned int cpu = smp_processor_id();
struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/include/mach/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@

#include <asm/hardware/gic.h>

static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap-smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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));
smp_cross_call(cpumask_of(cpu), 1);

/*
* Now the secondary core is starting up let it run its
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-realview/include/mach/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/*
* We use IRQ1 as the IPI
*/
static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-realview/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
* Use smp_cross_call() for this, since there's little
* point duplicating the code here
*/
smp_cross_call(cpumask_of(cpu));
smp_cross_call(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-s5pv310/include/mach/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ extern void __iomem *gic_cpu_base_addr;
/*
* We use IRQ1 as the IPI
*/
static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}

#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-s5pv310/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,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));
smp_cross_call(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-tegra/include/mach/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/*
* We use IRQ1 as the IPI
*/
static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}

#endif
4 changes: 2 additions & 2 deletions arch/arm/mach-ux500/include/mach/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ extern void u8500_secondary_startup(void);
/*
* We use IRQ1 as the IPI
*/
static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}
#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-ux500/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
__cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1);

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

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-vexpress/include/mach/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/*
* We use IRQ1 as the IPI
*/
static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}
#endif
2 changes: 1 addition & 1 deletion arch/arm/mach-vexpress/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,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));
smp_cross_call(cpumask_of(cpu), 1);

timeout = jiffies + (1 * HZ);
while (time_before(jiffies, timeout)) {
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/plat-omap/include/plat/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ extern u32 omap_read_auxcoreboot0(void);
/*
* We use Soft IRQ1 as the IPI
*/
static inline void smp_cross_call(const struct cpumask *mask)
static inline void smp_cross_call(const struct cpumask *mask, int ipi)
{
gic_raise_softirq(mask, 1);
gic_raise_softirq(mask, ipi);
}

#endif

0 comments on commit ad3b699

Please sign in to comment.