Skip to content

Commit b1cffeb

Browse files
author
Rob Herring
committed
ARM: GIC: remove direct use of gic_raise_softirq
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 <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: David Brown <davidb@codeaurora.org> Cc: Daniel Walker <dwalker@fifo99.com> Cc: Bryan Huntsman <bryanh@codeaurora.org> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Magnus Damm <magnus.damm@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: Shiraz Hashim <shiraz.hashim@st.com> Acked-by: Stephen Warren <swarren@nvidia.com> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Linus Walleij <linus.walleij@linaro.org> Acked-by: Olof Johansson <olof@lixom.net>
1 parent 428fef8 commit b1cffeb

18 files changed

Lines changed: 33 additions & 57 deletions

File tree

‎arch/arm/common/gic.c‎

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,27 @@ static void __init gic_pm_init(struct gic_chip_data *gic)
617617
}
618618
#endif
619619

620+
#ifdef CONFIG_SMP
621+
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
622+
{
623+
int cpu;
624+
unsigned long map = 0;
625+
626+
/* Convert our logical CPU mask into a physical one. */
627+
for_each_cpu(cpu, mask)
628+
map |= 1 << cpu_logical_map(cpu);
629+
630+
/*
631+
* Ensure that stores to Normal memory are visible to the
632+
* other CPUs before issuing the IPI.
633+
*/
634+
dsb();
635+
636+
/* this always happens on GIC0 */
637+
writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
638+
}
639+
#endif
640+
620641
static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
621642
irq_hw_number_t hw)
622643
{
@@ -743,6 +764,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
743764
if (WARN_ON(!gic->domain))
744765
return;
745766

767+
#ifdef CONFIG_SMP
768+
set_smp_cross_call(gic_raise_softirq);
769+
#endif
746770
gic_chip.flags |= gic_arch_extn.flags;
747771
gic_dist_init(gic);
748772
gic_cpu_init(gic);
@@ -756,27 +780,6 @@ void __cpuinit gic_secondary_init(unsigned int gic_nr)
756780
gic_cpu_init(&gic_data[gic_nr]);
757781
}
758782

759-
#ifdef CONFIG_SMP
760-
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
761-
{
762-
int cpu;
763-
unsigned long map = 0;
764-
765-
/* Convert our logical CPU mask into a physical one. */
766-
for_each_cpu(cpu, mask)
767-
map |= gic_cpu_map[cpu];
768-
769-
/*
770-
* Ensure that stores to Normal memory are visible to the
771-
* other CPUs before issuing the IPI.
772-
*/
773-
dsb();
774-
775-
/* this always happens on GIC0 */
776-
writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
777-
}
778-
#endif
779-
780783
#ifdef CONFIG_OF
781784
static int gic_cnt __initdata = 0;
782785

‎arch/arm/include/asm/hardware/gic.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ int gic_of_init(struct device_node *node, struct device_node *parent);
4040
void gic_secondary_init(unsigned int);
4141
void gic_handle_irq(struct pt_regs *regs);
4242
void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
43-
void gic_raise_softirq(const struct cpumask *mask, unsigned int irq);
4443

4544
static inline void gic_init(unsigned int nr, int start,
4645
void __iomem *dist , void __iomem *cpu)

‎arch/arm/kernel/smp.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ static void (*smp_cross_call)(const struct cpumask *, unsigned int);
416416

417417
void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
418418
{
419-
smp_cross_call = fn;
419+
if (!smp_cross_call)
420+
smp_cross_call = fn;
420421
}
421422

422423
void arch_send_call_function_ipi_mask(const struct cpumask *mask)

‎arch/arm/mach-exynos/platsmp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct
149149

150150
__raw_writel(virt_to_phys(exynos4_secondary_startup),
151151
cpu_boot_reg(phys_cpu));
152-
gic_raise_softirq(cpumask_of(cpu), 0);
152+
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
153153

154154
if (pen_release == -1)
155155
break;
@@ -190,8 +190,6 @@ static void __init exynos_smp_init_cpus(void)
190190

191191
for (i = 0; i < ncores; i++)
192192
set_cpu_possible(i, true);
193-
194-
set_smp_cross_call(gic_raise_softirq);
195193
}
196194

197195
static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)

‎arch/arm/mach-highbank/platsmp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu)
3333
static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
3434
{
3535
highbank_set_cpu_jump(cpu, secondary_startup);
36-
gic_raise_softirq(cpumask_of(cpu), 0);
36+
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
3737
return 0;
3838
}
3939

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

5757
for (i = 0; i < ncores; i++)
5858
set_cpu_possible(i, true);
59-
60-
set_smp_cross_call(gic_raise_softirq);
6159
}
6260

6361
static void __init highbank_smp_prepare_cpus(unsigned int max_cpus)

‎arch/arm/mach-imx/platsmp.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ static void __init imx_smp_init_cpus(void)
7171

7272
for (i = 0; i < ncores; i++)
7373
set_cpu_possible(i, true);
74-
75-
set_smp_cross_call(gic_raise_softirq);
7674
}
7775

7876
void imx_smp_prepare(void)

‎arch/arm/mach-msm/platsmp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *id
115115
* the boot monitor to read the system wide flags register,
116116
* and branch to the address found there.
117117
*/
118-
gic_raise_softirq(cpumask_of(cpu), 0);
118+
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
119119

120120
timeout = jiffies + (1 * HZ);
121121
while (time_before(jiffies, timeout)) {
@@ -153,8 +153,6 @@ static void __init msm_smp_init_cpus(void)
153153

154154
for (i = 0; i < ncores; i++)
155155
set_cpu_possible(i, true);
156-
157-
set_smp_cross_call(gic_raise_softirq);
158156
}
159157

160158
static void __init msm_smp_prepare_cpus(unsigned int max_cpus)

‎arch/arm/mach-omap2/omap-smp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
157157
booted = true;
158158
}
159159

160-
gic_raise_softirq(cpumask_of(cpu), 0);
160+
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
161161

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

232232
for (i = 0; i < ncores; i++)
233233
set_cpu_possible(i, true);
234-
235-
set_smp_cross_call(gic_raise_softirq);
236234
}
237235

238236
static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)

‎arch/arm/mach-realview/platsmp.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/io.h>
1515

1616
#include <mach/hardware.h>
17-
#include <asm/hardware/gic.h>
1817
#include <asm/mach-types.h>
1918
#include <asm/smp_scu.h>
2019

@@ -59,8 +58,6 @@ static void __init realview_smp_init_cpus(void)
5958

6059
for (i = 0; i < ncores; i++)
6160
set_cpu_possible(i, true);
62-
63-
set_smp_cross_call(gic_raise_softirq);
6461
}
6562

6663
static void __init realview_smp_prepare_cpus(unsigned int max_cpus)

‎arch/arm/mach-shmobile/platsmp.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,4 @@ void __init shmobile_smp_init_cpus(unsigned int ncores)
2626

2727
for (i = 0; i < ncores; i++)
2828
set_cpu_possible(i, true);
29-
30-
set_smp_cross_call(gic_raise_softirq);
3129
}

0 commit comments

Comments
 (0)