Skip to content

Commit

Permalink
ARM: GIC: remove direct use of gic_raise_softirq
Browse files Browse the repository at this point in the history
In preparation of moving gic code to drivers/irqchip, remove the direct
platform dependencies on gic_raise_softirq. Move the setup of
smp_cross_call into the gic code and use arch_send_wakeup_ipi_mask
function to trigger wake-up IPIs.

Signed-off-by: Rob Herring <[email protected]>
Cc: Russell King <[email protected]>
Cc: Kukjin Kim <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: David Brown <[email protected]>
Cc: Daniel Walker <[email protected]>
Cc: Bryan Huntsman <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Magnus Damm <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
Cc: Shiraz Hashim <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Cc: Srinidhi Kasagar <[email protected]>
Cc: Linus Walleij <[email protected]>
Acked-by: Olof Johansson <[email protected]>
  • Loading branch information
Rob Herring committed Jan 10, 2013
1 parent 428fef8 commit b1cffeb
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 57 deletions.
45 changes: 24 additions & 21 deletions arch/arm/common/gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,27 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
}
#endif

#ifdef CONFIG_SMP
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
{
int cpu;
unsigned long map = 0;

/* Convert our logical CPU mask into a physical one. */
for_each_cpu(cpu, mask)
map |= 1 << cpu_logical_map(cpu);

/*
* Ensure that stores to Normal memory are visible to the
* other CPUs before issuing the IPI.
*/
dsb();

/* this always happens on GIC0 */
writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
}
#endif

static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
irq_hw_number_t hw)
{
Expand Down Expand Up @@ -743,6 +764,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
if (WARN_ON(!gic->domain))
return;

#ifdef CONFIG_SMP
set_smp_cross_call(gic_raise_softirq);
#endif
gic_chip.flags |= gic_arch_extn.flags;
gic_dist_init(gic);
gic_cpu_init(gic);
Expand All @@ -756,27 +780,6 @@ void __cpuinit gic_secondary_init(unsigned int gic_nr)
gic_cpu_init(&gic_data[gic_nr]);
}

#ifdef CONFIG_SMP
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
{
int cpu;
unsigned long map = 0;

/* Convert our logical CPU mask into a physical one. */
for_each_cpu(cpu, mask)
map |= gic_cpu_map[cpu];

/*
* Ensure that stores to Normal memory are visible to the
* other CPUs before issuing the IPI.
*/
dsb();

/* this always happens on GIC0 */
writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
}
#endif

#ifdef CONFIG_OF
static int gic_cnt __initdata = 0;

Expand Down
1 change: 0 additions & 1 deletion arch/arm/include/asm/hardware/gic.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ int gic_of_init(struct device_node *node, struct device_node *parent);
void gic_secondary_init(unsigned int);
void gic_handle_irq(struct pt_regs *regs);
void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);

static inline void gic_init(unsigned int nr, int start,
void __iomem *dist , void __iomem *cpu)
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ 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;
if (!smp_cross_call)
smp_cross_call = fn;
}

void arch_send_call_function_ipi_mask(const struct cpumask *mask)
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-exynos/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct

__raw_writel(virt_to_phys(exynos4_secondary_startup),
cpu_boot_reg(phys_cpu));
gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));

if (pen_release == -1)
break;
Expand Down Expand Up @@ -190,8 +190,6 @@ static void __init exynos_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-highbank/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)
static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
highbank_set_cpu_jump(cpu, secondary_startup);
gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
return 0;
}

Expand All @@ -56,8 +56,6 @@ static void __init highbank_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-imx/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ static void __init imx_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

void imx_smp_prepare(void)
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-msm/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *id
* the boot monitor to read the system wide flags register,
* and branch to the address found there.
*/
gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));

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

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-omap2/omap-smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
booted = true;
}

gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));

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

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-realview/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/io.h>

#include <mach/hardware.h>
#include <asm/hardware/gic.h>
#include <asm/mach-types.h>
#include <asm/smp_scu.h>

Expand Down Expand Up @@ -59,8 +58,6 @@ static void __init realview_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-shmobile/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@ void __init shmobile_smp_init_cpus(unsigned int ncores)

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

set_smp_cross_call(gic_raise_softirq);
}
2 changes: 1 addition & 1 deletion arch/arm/mach-shmobile/smp-emev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct *
/* Tell ROM loader about our vector (in headsmp.S) */
emev2_set_boot_vector(__pa(shmobile_secondary_vector));

gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-socfpga/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ static void __init socfpga_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-spear13xx/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ static void __init spear13xx_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-tegra/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ static void __init tegra_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-ux500/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *
*/
write_pen_release(cpu_logical_map(cpu));

gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));

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

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-vexpress/ct-ca9x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ static void __init 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 __init ct_ca9x4_smp_enable(unsigned int max_cpus)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-vexpress/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ static void __init vexpress_dt_smp_init_cpus(void)

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

set_smp_cross_call(gic_raise_softirq);
}

static void __init vexpress_dt_smp_prepare_cpus(unsigned int max_cpus)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-versatile/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idl
* the boot monitor to read the system wide flags register,
* and branch to the address found there.
*/
gic_raise_softirq(cpumask_of(cpu), 0);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));

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

0 comments on commit b1cffeb

Please sign in to comment.