Skip to content

Commit

Permalink
arm: delete __cpuinit/__CPUINIT usage from all ARM users
Browse files Browse the repository at this point in the history
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications.  For example, the fix in
commit 5e427ec ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out.  Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit  -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings.  In any case, they are temporary and harmless.

This removes all the ARM uses of the __cpuinit macros from C code,
and all __CPUINIT from assembly code.  It also had two ".previous"
section statements that were paired off against __CPUINIT
(aka .section ".cpuinit.text") that also get removed here.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
  • Loading branch information
Paul Gortmaker committed Jul 14, 2013
1 parent 078a55f commit 8bd26e3
Show file tree
Hide file tree
Showing 70 changed files with 64 additions and 140 deletions.
4 changes: 2 additions & 2 deletions arch/arm/common/mcpm_platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <asm/smp.h>
#include <asm/smp_plat.h>

static int __cpuinit mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
unsigned int mpidr, pcpu, pcluster, ret;
extern void secondary_startup(void);
Expand All @@ -40,7 +40,7 @@ static int __cpuinit mcpm_boot_secondary(unsigned int cpu, struct task_struct *i
return 0;
}

static void __cpuinit mcpm_secondary_init(unsigned int cpu)
static void mcpm_secondary_init(unsigned int cpu)
{
mcpm_cpu_powered_up();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/include/asm/arch_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static inline u64 arch_counter_get_cntvct(void)
return cval;
}

static inline void __cpuinit arch_counter_set_user_access(void)
static inline void arch_counter_set_user_access(void)
{
u32 cntkctl;

Expand Down
1 change: 0 additions & 1 deletion arch/arm/kernel/head-common.S
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ ENDPROC(lookup_processor_type)
* r5 = proc_info pointer in physical address space
* r9 = cpuid (preserved)
*/
__CPUINIT
__lookup_processor_type:
adr r3, __lookup_processor_type_data
ldmia r3, {r4 - r6}
Expand Down
1 change: 0 additions & 1 deletion arch/arm/kernel/head-nommu.S
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ ENTRY(stext)
ENDPROC(stext)

#ifdef CONFIG_SMP
__CPUINIT
ENTRY(secondary_startup)
/*
* Common entry point for secondary CPUs.
Expand Down
1 change: 0 additions & 1 deletion arch/arm/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ __turn_mmu_on_loc:
.long __turn_mmu_on_end

#if defined(CONFIG_SMP)
__CPUINIT
ENTRY(secondary_startup)
/*
* Common entry point for secondary CPUs.
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ static void reset_ctrl_regs(void *unused)
cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu));
}

static int __cpuinit dbg_reset_notify(struct notifier_block *self,
static int dbg_reset_notify(struct notifier_block *self,
unsigned long action, void *cpu)
{
if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
Expand All @@ -1029,7 +1029,7 @@ static int __cpuinit dbg_reset_notify(struct notifier_block *self,
return NOTIFY_OK;
}

static struct notifier_block __cpuinitdata dbg_reset_nb = {
static struct notifier_block dbg_reset_nb = {
.notifier_call = dbg_reset_notify,
};

Expand Down
6 changes: 3 additions & 3 deletions arch/arm/kernel/perf_event_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
* UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
* junk values out of them.
*/
static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
unsigned long action, void *hcpu)
static int cpu_pmu_notify(struct notifier_block *b, unsigned long action,
void *hcpu)
{
if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
return NOTIFY_DONE;
Expand All @@ -171,7 +171,7 @@ static int __cpuinit cpu_pmu_notify(struct notifier_block *b,
return NOTIFY_OK;
}

static struct notifier_block __cpuinitdata cpu_pmu_hotplug_notifier = {
static struct notifier_block cpu_pmu_hotplug_notifier = {
.notifier_call = cpu_pmu_notify,
};

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/kernel/psci_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@

extern void secondary_startup(void);

static int __cpuinit psci_boot_secondary(unsigned int cpu,
struct task_struct *idle)
static int psci_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
if (psci_ops.cpu_on)
return psci_ops.cpu_on(cpu_logical_map(cpu),
Expand Down
18 changes: 9 additions & 9 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct secondary_data secondary_data;
* control for which core is the next to come out of the secondary
* boot "holding pen"
*/
volatile int __cpuinitdata pen_release = -1;
volatile int pen_release = -1;

enum ipi_msg_type {
IPI_WAKEUP,
Expand Down Expand Up @@ -86,7 +86,7 @@ static unsigned long get_arch_pgd(pgd_t *pgd)
return pgdir >> ARCH_PGD_SHIFT;
}

int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
int __cpu_up(unsigned int cpu, struct task_struct *idle)
{
int ret;

Expand Down Expand Up @@ -138,7 +138,7 @@ void __init smp_init_cpus(void)
smp_ops.smp_init_cpus();
}

int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
int boot_secondary(unsigned int cpu, struct task_struct *idle)
{
if (smp_ops.smp_boot_secondary)
return smp_ops.smp_boot_secondary(cpu, idle);
Expand Down Expand Up @@ -170,7 +170,7 @@ static int platform_cpu_disable(unsigned int cpu)
/*
* __cpu_disable runs on the processor to be shutdown.
*/
int __cpuinit __cpu_disable(void)
int __cpu_disable(void)
{
unsigned int cpu = smp_processor_id();
int ret;
Expand Down Expand Up @@ -216,7 +216,7 @@ static DECLARE_COMPLETION(cpu_died);
* called on the thread which is asking for a CPU to be shutdown -
* waits until shutdown has completed, or it is timed out.
*/
void __cpuinit __cpu_die(unsigned int cpu)
void __cpu_die(unsigned int cpu)
{
if (!wait_for_completion_timeout(&cpu_died, msecs_to_jiffies(5000))) {
pr_err("CPU%u: cpu didn't die\n", cpu);
Expand Down Expand Up @@ -306,7 +306,7 @@ void __ref cpu_die(void)
* Called by both boot and secondaries to move global data into
* per-processor storage.
*/
static void __cpuinit smp_store_cpu_info(unsigned int cpuid)
static void smp_store_cpu_info(unsigned int cpuid)
{
struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);

Expand All @@ -322,7 +322,7 @@ static void percpu_timer_setup(void);
* This is the secondary CPU boot entry. We're using this CPUs
* idle thread stack, but a set of temporary page tables.
*/
asmlinkage void __cpuinit secondary_start_kernel(void)
asmlinkage void secondary_start_kernel(void)
{
struct mm_struct *mm = &init_mm;
unsigned int cpu;
Expand Down Expand Up @@ -521,7 +521,7 @@ static void broadcast_timer_set_mode(enum clock_event_mode mode,
{
}

static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
static void broadcast_timer_setup(struct clock_event_device *evt)
{
evt->name = "dummy_timer";
evt->features = CLOCK_EVT_FEAT_ONESHOT |
Expand Down Expand Up @@ -550,7 +550,7 @@ int local_timer_register(struct local_timer_ops *ops)
}
#endif

static void __cpuinit percpu_timer_setup(void)
static void percpu_timer_setup(void)
{
unsigned int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu);
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/kernel/smp_twd.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ core_initcall(twd_cpufreq_init);

#endif

static void __cpuinit twd_calibrate_rate(void)
static void twd_calibrate_rate(void)
{
unsigned long count;
u64 waitjiffies;
Expand Down Expand Up @@ -265,7 +265,7 @@ static void twd_get_clock(struct device_node *np)
/*
* Setup the local clock events for a CPU.
*/
static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
static int twd_timer_setup(struct clock_event_device *clk)
{
struct clock_event_device **this_cpu_clk;
int cpu = smp_processor_id();
Expand Down Expand Up @@ -308,7 +308,7 @@ static int __cpuinit twd_timer_setup(struct clock_event_device *clk)
return 0;
}

static struct local_timer_ops twd_lt_ops __cpuinitdata = {
static struct local_timer_ops twd_lt_ops = {
.setup = twd_timer_setup,
.stop = twd_timer_stop,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/lib/delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void __init register_current_timer_delay(const struct delay_timer *timer)
}
}

unsigned long __cpuinit calibrate_delay_is_known(void)
unsigned long calibrate_delay_is_known(void)
{
delay_calibrated = true;
return lpj_fine;
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-exynos/headsmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#include <linux/linkage.h>
#include <linux/init.h>

__CPUINIT

/*
* exynos4 specific entry point for secondary CPUs. This provides
* a "holding pen" into which all secondary cores are held until we're
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-exynos/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void __iomem *scu_base_addr(void)

static DEFINE_SPINLOCK(boot_lock);

static void __cpuinit exynos_secondary_init(unsigned int cpu)
static void exynos_secondary_init(unsigned int cpu)
{
/*
* let the primary processor know we're out of the
Expand All @@ -90,7 +90,7 @@ static void __cpuinit exynos_secondary_init(unsigned int cpu)
spin_unlock(&boot_lock);
}

static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
unsigned long timeout;
unsigned long phys_cpu = cpu_logical_map(cpu);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-highbank/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

extern void secondary_startup(void);

static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
static int highbank_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
highbank_set_cpu_jump(cpu, secondary_startup);
arch_send_wakeup_ipi_mask(cpumask_of(cpu));
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void imx_scu_standby_enable(void)
writel_relaxed(val, scu_base);
}

static int __cpuinit imx_boot_secondary(unsigned int cpu, struct task_struct *idle)
static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
imx_set_cpu_jump(cpu, v7_secondary_startup);
imx_enable_cpu(cpu, true);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-keystone/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "keystone.h"

static int __cpuinit keystone_smp_boot_secondary(unsigned int cpu,
static int keystone_smp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
{
unsigned long start = virt_to_phys(&secondary_startup);
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-msm/headsmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include <linux/linkage.h>
#include <linux/init.h>

__CPUINIT

/*
* MSM specific entry point for secondary CPUs. This provides
* a "holding pen" into which all secondary cores are held until we're
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-msm/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static inline int get_core_count(void)
return ((read_cpuid_id() >> 4) & 3) + 1;
}

static void __cpuinit msm_secondary_init(unsigned int cpu)
static void msm_secondary_init(unsigned int cpu)
{
/*
* let the primary processor know we're out of the
Expand All @@ -54,7 +54,7 @@ static void __cpuinit msm_secondary_init(unsigned int cpu)
spin_unlock(&boot_lock);
}

static __cpuinit void prepare_cold_cpu(unsigned int cpu)
static void prepare_cold_cpu(unsigned int cpu)
{
int ret;
ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup),
Expand All @@ -73,7 +73,7 @@ static __cpuinit void prepare_cold_cpu(unsigned int cpu)
"address\n");
}

static int __cpuinit msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
unsigned long timeout;
static int cold_boot_done;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static struct clocksource msm_clocksource = {
};

#ifdef CONFIG_LOCAL_TIMERS
static int __cpuinit msm_local_timer_setup(struct clock_event_device *evt)
static int msm_local_timer_setup(struct clock_event_device *evt)
{
/* Use existing clock_event for cpu 0 */
if (!smp_processor_id())
Expand All @@ -164,7 +164,7 @@ static void msm_local_timer_stop(struct clock_event_device *evt)
disable_percpu_irq(evt->irq);
}

static struct local_timer_ops msm_local_timer_ops __cpuinitdata = {
static struct local_timer_ops msm_local_timer_ops = {
.setup = msm_local_timer_setup,
.stop = msm_local_timer_stop,
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mvebu/coherency.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <asm/cacheflush.h>
#include "armada-370-xp.h"

unsigned long __cpuinitdata coherency_phys_base;
unsigned long coherency_phys_base;
static void __iomem *coherency_base;
static void __iomem *coherency_cpu_base;

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-mvebu/headsmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <linux/linkage.h>
#include <linux/init.h>

__CPUINIT

/*
* Armada XP specific entry point for secondary CPUs.
* We add the CPU to the coherency fabric and then jump to secondary
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/mach-mvebu/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ void __init set_secondary_cpus_clock(void)
}
}

static void __cpuinit armada_xp_secondary_init(unsigned int cpu)
static void armada_xp_secondary_init(unsigned int cpu)
{
armada_xp_mpic_smp_cpu_init();
}

static int __cpuinit armada_xp_boot_secondary(unsigned int cpu,
struct task_struct *idle)
static int armada_xp_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
pr_info("Booting CPU %d\n", cpu);

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-omap2/omap-headsmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

#include "omap44xx.h"

__CPUINIT

/* Physical address needed since MMU not enabled yet on secondary core */
#define AUX_CORE_BOOT0_PA 0x48281800

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/omap-mpuss-lowpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
* @cpu : CPU ID
* @power_state: CPU low power state.
*/
int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)
{
struct omap4_cpu_pm_info *pm_info = &per_cpu(omap4_pm_info, cpu);
unsigned int cpu_state = 0;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/omap-smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void __iomem *omap4_get_scu_base(void)
return scu_base;
}

static void __cpuinit omap4_secondary_init(unsigned int cpu)
static void omap4_secondary_init(unsigned int cpu)
{
/*
* Configure ACTRL and enable NS SMP bit access on CPU1 on HS device.
Expand All @@ -72,7 +72,7 @@ static void __cpuinit omap4_secondary_init(unsigned int cpu)
spin_unlock(&boot_lock);
}

static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
{
static struct clockdomain *cpu1_clkdm;
static bool booted;
Expand Down
Loading

0 comments on commit 8bd26e3

Please sign in to comment.