Skip to contentSkip to conversation

arm: delete __cpuinit/__CPUINIT usage from all ARM users

PATCH New Francesco VIRLINZI 3 participants 5 messages Nov 18, 2013 1 message not in the archive

Subsystems (14)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 arm: delete __cpuinit/__CPUINIT usage from all ARM users

From: Paul Gortmaker <[email protected]>

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 5e427ec2d0 ("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 <[email protected]>
Cc Will Deacon <[email protected]>
Cc linux-arm-kernel at lists.infradead.org

Conflicts:

	arch/arm/common/mcpm_platsmp.c
	arch/arm/include/asm/arch_timer.h
	arch/arm/kernel/head-common.S
	arch/arm/kernel/head-nommu.S
	arch/arm/kernel/perf_event_cpu.c
	arch/arm/kernel/psci_smp.c
	arch/arm/kernel/smp.c
	arch/arm/lib/delay.c
	arch/arm/mach-exynos/platsmp.c
	arch/arm/mach-highbank/platsmp.c
	arch/arm/mach-imx/platsmp.c
	arch/arm/mach-keystone/platsmp.c
	arch/arm/mach-msm/platsmp.c
	arch/arm/mach-mvebu/coherency.c
	arch/arm/mach-mvebu/headsmp.S
	arch/arm/mach-mvebu/platsmp.c
	arch/arm/mach-omap2/omap-headsmp.S
	arch/arm/mach-omap2/omap-smp.c
	arch/arm/mach-prima2/headsmp.S
	arch/arm/mach-prima2/platsmp.c
	arch/arm/mach-shmobile/headsmp-scu.S
	arch/arm/mach-shmobile/headsmp.S
	arch/arm/mach-shmobile/smp-emev2.c
	arch/arm/mach-shmobile/smp-r8a7779.c
	arch/arm/mach-shmobile/smp-sh73a0.c
	arch/arm/mach-socfpga/headsmp.S
	arch/arm/mach-socfpga/platsmp.c
	arch/arm/mach-spear/generic.h
	arch/arm/mach-spear/platsmp.c
	arch/arm/mach-sti/platsmp.c
	arch/arm/mach-tegra/platsmp.c
	arch/arm/mach-tegra/pm.c
	arch/arm/mach-ux500/platsmp.c
	arch/arm/mach-zynq/common.h
	arch/arm/mach-zynq/headsmp.S
	arch/arm/mach-zynq/platsmp.c
	arch/arm/mm/proc-mohawk.S
	arch/arm/mm/proc-v7-2level.S
	arch/arm/mm/proc-v7.S
	arch/arm/plat-versatile/platsmp.c

In STLinux fixed:
- arch/arm/mach-stm/platsmp.c

---
 arch/arm/common/mcpm_platsmp.c       |   84 +++++++++
 arch/arm/include/asm/arch_timer.h    |  105 +++++++++++
 arch/arm/kernel/head-common.S        |    1 -
 arch/arm/kernel/head.S               |    1 -
 arch/arm/kernel/hw_breakpoint.c      |    4 +-
 arch/arm/kernel/perf_event_cpu.c     |  322 ++++++++++++++++++++++++++++++++++
 arch/arm/kernel/psci_smp.c           |   83 +++++++++
 arch/arm/kernel/smp.c                |   14 +-
 arch/arm/kernel/smp_twd.c            |    6 +-
 arch/arm/mach-keystone/platsmp.c     |   43 +++++
 arch/arm/mach-mvebu/coherency.c      |  156 ++++++++++++++++
 arch/arm/mach-mvebu/headsmp.S        |   47 +++++
 arch/arm/mach-mvebu/platsmp.c        |  131 ++++++++++++++
 arch/arm/mach-prima2/headsmp.S       |   38 ++++
 arch/arm/mach-prima2/platsmp.c       |  148 ++++++++++++++++
 arch/arm/mach-shmobile/headsmp-scu.S |   49 +++++
 arch/arm/mach-shmobile/smp-emev2.c   |   69 +++++++
 arch/arm/mach-socfpga/headsmp.S      |   32 ++++
 arch/arm/mach-socfpga/platsmp.c      |  102 +++++++++++
 arch/arm/mach-spear/generic.h        |   56 ++++++
 arch/arm/mach-spear/platsmp.c        |  122 +++++++++++++
 arch/arm/mach-sti/platsmp.c          |  117 ++++++++++++
 arch/arm/mach-stm/platsmp.c          |   10 +-
 arch/arm/mach-tegra/pm.c             |  248 ++++++++++++++++++++++++++
 arch/arm/mach-zynq/headsmp.S         |   22 +++
 arch/arm/mach-zynq/platsmp.c         |  136 ++++++++++++++
 arch/arm/mm/proc-v7-2level.S         |    6 +-
 arch/arm/mm/proc-v7-3level.S         |    4 -
 arch/arm/mm/proc-v7.S                |   23 +++-
 29 files changed, 2153 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/common/mcpm_platsmp.c
 create mode 100644 arch/arm/include/asm/arch_timer.h
 create mode 100644 arch/arm/kernel/perf_event_cpu.c
 create mode 100644 arch/arm/kernel/psci_smp.c
 create mode 100644 arch/arm/mach-keystone/platsmp.c
 create mode 100644 arch/arm/mach-mvebu/coherency.c
 create mode 100644 arch/arm/mach-mvebu/headsmp.S
 create mode 100644 arch/arm/mach-mvebu/platsmp.c
 create mode 100644 arch/arm/mach-prima2/headsmp.S
 create mode 100644 arch/arm/mach-prima2/platsmp.c
 create mode 100644 arch/arm/mach-shmobile/headsmp-scu.S
 create mode 100644 arch/arm/mach-shmobile/smp-emev2.c
 create mode 100644 arch/arm/mach-socfpga/headsmp.S
 create mode 100644 arch/arm/mach-socfpga/platsmp.c
 create mode 100644 arch/arm/mach-spear/generic.h
 create mode 100644 arch/arm/mach-spear/platsmp.c
 create mode 100644 arch/arm/mach-sti/platsmp.c
 create mode 100644 arch/arm/mach-tegra/pm.c
 create mode 100644 arch/arm/mach-zynq/headsmp.S
 create mode 100644 arch/arm/mach-zynq/platsmp.c
arch/arm/common/mcpm_platsmp.c new file +84 -0
new file mode 100644
index 0000000..1bc34c7
@@ -0,0 +1,84 @@
+/*
+ * linux/arch/arm/mach-vexpress/mcpm_platsmp.c
+ *
+ * Created by:  Nicolas Pitre, November 2012
+ * Copyright:   (C) 2012-2013  Linaro Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Code to handle secondary CPU bringup and hotplug for the cluster power API.
+ */
+
+#include <linux/init.h>
+#include <linux/smp.h>
+#include <linux/spinlock.h>
+
+#include <asm/mcpm.h>
+#include <asm/smp.h>
+#include <asm/smp_plat.h>
+
+static int mcpm_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	unsigned int mpidr, pcpu, pcluster, ret;
+	extern void secondary_startup(void);
+
+	mpidr = cpu_logical_map(cpu);
+	pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+	pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+	pr_debug("%s: logical CPU %d is physical CPU %d cluster %d\n",
+		 __func__, cpu, pcpu, pcluster);
+
+	mcpm_set_entry_vector(pcpu, pcluster, NULL);
+	ret = mcpm_cpu_power_up(pcpu, pcluster);
+	if (ret)
+		return ret;
+	mcpm_set_entry_vector(pcpu, pcluster, secondary_startup);
+	arch_send_wakeup_ipi_mask(cpumask_of(cpu));
+	dsb_sev();
+	return 0;
+}
+
+static void mcpm_secondary_init(unsigned int cpu)
+{
+	mcpm_cpu_powered_up();
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+
+static int mcpm_cpu_disable(unsigned int cpu)
+{
+	/*
+	 * We assume all CPUs may be shut down.
+	 * This would be the hook to use for eventual Secure
+	 * OS migration requests as described in the PSCI spec.
+	 */
+	return 0;
+}
+
+static void mcpm_cpu_die(unsigned int cpu)
+{
+	unsigned int mpidr, pcpu, pcluster;
+	mpidr = read_cpuid_mpidr();
+	pcpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+	pcluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+	mcpm_set_entry_vector(pcpu, pcluster, NULL);
+	mcpm_cpu_power_down();
+}
+
+#endif
+
+static struct smp_operations __initdata mcpm_smp_ops = {
+	.smp_boot_secondary	= mcpm_boot_secondary,
+	.smp_secondary_init	= mcpm_secondary_init,
+#ifdef CONFIG_HOTPLUG_CPU
+	.cpu_disable		= mcpm_cpu_disable,
+	.cpu_die		= mcpm_cpu_die,
+#endif
+};
+
+void __init mcpm_smp_set_ops(void)
+{
+	smp_set_ops(&mcpm_smp_ops);
+}
arch/arm/include/asm/arch_timer.h new file +105 -0

105 lines not on this page · raw message

arch/arm/kernel/head-common.S +0 -1
index c1d351e..3186b38 100644
@@ -141,7 +141,6 @@ ENDPROC(lookup_processor_type)
  *	r5 = proc_info pointer in physical address space
  *	r9 = cpuid (preserved)
  */
-	__CPUINIT
 ENTRY(__lookup_processor_type)
 	adr	r3, __lookup_processor_type_data
 	ldmia	r3, {r4 - r6}
arch/arm/kernel/head.S +0 -1
index 172177d..e67921a 100644
@@ -337,7 +337,6 @@ __turn_mmu_on_loc:
 	.long	__turn_mmu_on_end
 
 #if defined(CONFIG_SMP)
-	__CPUINIT
 ENTRY(secondary_startup)
 	/*
 	 * Common entry point for secondary CPUs.
arch/arm/kernel/hw_breakpoint.c +2 -2
index 18d39ea..7cc47c1 100644
@@ -976,7 +976,7 @@ reset_regs:
 	}
 }
 
-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_ONLINE)
@@ -985,7 +985,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,
 };
 
arch/arm/kernel/perf_event_cpu.c new file +322 -0

322 lines not on this page · raw message

arch/arm/kernel/psci_smp.c new file +83 -0

83 lines not on this page · raw message

arch/arm/kernel/smp.c +10 -4
index 9940f35..6506eb1 100644
@@ -50,6 +50,12 @@
  */
 struct secondary_data secondary_data;
 
+/*
+ * control for which core is the next to come out of the secondary
+ * boot "holding pen"
+ */
+volatile int pen_release = -1;
+
 enum ipi_msg_type {
 	IPI_TIMER = 2,
 	IPI_RESCHEDULE,
@@ -236,7 +242,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);
 
@@ -251,7 +257,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;
@@ -447,7 +453,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 |
@@ -473,7 +479,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);
arch/arm/kernel/smp_twd.c +3 -3
index 146d0a0..61cc177 100644
@@ -145,7 +145,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;
@@ -228,7 +228,7 @@ static struct clk *twd_get_clock(void)
 /*
  * 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;
 
@@ -260,7 +260,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,
 };
arch/arm/mach-keystone/platsmp.c new file +43 -0

43 lines not on this page · raw message

arch/arm/mach-mvebu/coherency.c new file +156 -0

156 lines not on this page · raw message

arch/arm/mach-mvebu/headsmp.S new file +47 -0

47 lines not on this page · raw message

arch/arm/mach-mvebu/platsmp.c new file +131 -0

131 lines not on this page · raw message

arch/arm/mach-prima2/headsmp.S new file +38 -0
new file mode 100644
index 0000000..d86fe33
@@ -0,0 +1,38 @@
+/*
+ * Entry of the second core for CSR Marco dual-core SMP SoCs
+ *
+ * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+
+/*
+ * SIRFSOC specific entry point for secondary CPUs.  This provides
+ * a "holding pen" into which all secondary cores are held until we're
+ * ready for them to initialise.
+ */
+ENTRY(sirfsoc_secondary_startup)
+	bl v7_invalidate_l1
+        mrc     p15, 0, r0, c0, c0, 5
+        and     r0, r0, #15
+        adr     r4, 1f
+        ldmia   r4, {r5, r6}
+        sub     r4, r4, r5
+        add     r6, r6, r4
+pen:    ldr     r7, [r6]
+        cmp     r7, r0
+        bne     pen
+
+        /*
+         * we've been released from the holding pen: secondary_stack
+         * should now contain the SVC stack for this core
+         */
+        b       secondary_startup
+ENDPROC(sirfsoc_secondary_startup)
+
+        .align
+1:      .long   .
+        .long   pen_release
arch/arm/mach-prima2/platsmp.c new file +148 -0

148 lines not on this page · raw message

arch/arm/mach-shmobile/headsmp-scu.S new file +49 -0

49 lines not on this page · raw message

arch/arm/mach-shmobile/smp-emev2.c new file +69 -0

69 lines not on this page · raw message

arch/arm/mach-socfpga/headsmp.S new file +32 -0
new file mode 100644
index 0000000..95c115d
@@ -0,0 +1,32 @@
+/*
+ *  Copyright (c) 2003 ARM Limited
+ *  Copyright (c) u-boot contributors
+ *  Copyright (c) 2012 Pavel Machek <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/linkage.h>
+#include <linux/init.h>
+
+	.arch	armv7-a
+
+ENTRY(secondary_trampoline)
+	movw	r2, #:lower16:cpu1start_addr
+	movt  r2, #:upper16:cpu1start_addr
+
+	/* The socfpga VT cannot handle a 0xC0000000 page offset when loading
+		the cpu1start_addr, we bit clear it. Tested on HW and VT. */
+	bic	r2, r2, #0x40000000
+
+	ldr	r0, [r2]
+	ldr	r1, [r0]
+	bx	r1
+
+ENTRY(secondary_trampoline_end)
+
+ENTRY(socfpga_secondary_startup)
+       bl      v7_invalidate_l1
+       b       secondary_startup
+ENDPROC(socfpga_secondary_startup)
arch/arm/mach-socfpga/platsmp.c new file +102 -0

102 lines not on this page · raw message

arch/arm/mach-spear/generic.h new file +56 -0

56 lines not on this page · raw message

arch/arm/mach-spear/platsmp.c new file +122 -0

122 lines not on this page · raw message

arch/arm/mach-sti/platsmp.c new file +117 -0

117 lines not on this page · raw message

arch/arm/mach-stm/platsmp.c +5 -5
index 71a3174..c7f2bf5 100644
@@ -36,12 +36,12 @@ extern void stm_secondary_startup(void);
  * control for which core is the next to come out of the secondary
  * boot "holding pen"
  */
-volatile int __cpuinitdata pen_release = -1;
+extern volatile int pen_release;
 
 #ifdef CONFIG_HIBERNATION_ON_MEMORY
-void __cpuinit write_pen_release(int val)
+void write_pen_release(int val)
 #else
-static void __cpuinit write_pen_release(int val)
+static void write_pen_release(int val)
 #endif
 {
 	pen_release = val;
@@ -57,7 +57,7 @@ static inline unsigned int get_core_count(void)
 
 static DEFINE_SPINLOCK(boot_lock);
 
-void __cpuinit platform_secondary_init(unsigned int cpu)
+void platform_secondary_init(unsigned int cpu)
 {
 printk("%s(%d)\n", __FUNCTION__, cpu);
 	trace_hardirqs_off();
@@ -82,7 +82,7 @@ printk("%s(%d)\n", __FUNCTION__, cpu);
 	spin_unlock(&boot_lock);
 }
 
-int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
+int boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	unsigned long timeout;
 
arch/arm/mach-tegra/pm.c new file +248 -0

248 lines not on this page · raw message

arch/arm/mach-zynq/headsmp.S new file +22 -0
new file mode 100644
index 0000000..d4cd5f3
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2013 Steffen Trumtrar <[email protected]>
+ * Copyright (c) 2012-2013 Xilinx
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/linkage.h>
+#include <linux/init.h>
+
+ENTRY(zynq_secondary_trampoline)
+	ldr	r0, [pc]
+	bx	r0
+.globl zynq_secondary_trampoline_jump
+zynq_secondary_trampoline_jump:
+	/* Space for jumping address */
+	.word	/* cpu 1 */
+.globl zynq_secondary_trampoline_end
+zynq_secondary_trampoline_end:
+
+ENDPROC(zynq_secondary_trampoline)
arch/arm/mach-zynq/platsmp.c new file +136 -0

136 lines not on this page · raw message

arch/arm/mm/proc-v7-2level.S +1 -5
index 3a4b3e7..099c715 100644
@@ -155,8 +155,6 @@ ENDPROC(cpu_v7_set_pte_ext)
 	mcr	p15, 0, \ttbr1, c2, c0, 1	@ load TTB1
 	.endm
 
-	__CPUINIT
-
 	/*   AT
 	 *  TFR   EV X F   I D LR    S
 	 * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM
@@ -166,6 +164,4 @@ ENDPROC(cpu_v7_set_pte_ext)
 	.align	2
 	.type	v7_crval, #object
 v7_crval:
-	crval	clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
-
-	.previous
+	crval	clear=0x2120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c
arch/arm/mm/proc-v7-3level.S +0 -4
index 8de0f1d..8bcf31b 100644
@@ -133,8 +133,6 @@ ENDPROC(cpu_v7_set_pte_ext)
 	mcrr	p15, 1, \ttbr1, \zero, c2	@ load TTBR1
 	.endm
 
-	__CPUINIT
-
 	/*
 	 *   AT
 	 *  TFR   EV X F   IHD LR    S
@@ -146,5 +144,3 @@ ENDPROC(cpu_v7_set_pte_ext)
 	.type	v7_crval, #object
 v7_crval:
 	crval	clear=0x0120c302, mmuset=0x30c23c7d, ucset=0x00c01c7c
-
-	.previous
arch/arm/mm/proc-v7.S +22 -1
index c2e2b66..c7aecf3 100644
@@ -140,7 +140,28 @@ ENTRY(cpu_v7_do_resume)
 ENDPROC(cpu_v7_do_resume)
 #endif
 
-	__CPUINIT
+#ifdef CONFIG_CPU_PJ4B
+	globl_equ	cpu_pj4b_switch_mm,     cpu_v7_switch_mm
+	globl_equ	cpu_pj4b_set_pte_ext,	cpu_v7_set_pte_ext
+	globl_equ	cpu_pj4b_proc_init,	cpu_v7_proc_init
+	globl_equ	cpu_pj4b_proc_fin, 	cpu_v7_proc_fin
+	globl_equ	cpu_pj4b_reset,	   	cpu_v7_reset
+#ifdef CONFIG_PJ4B_ERRATA_4742
+ENTRY(cpu_pj4b_do_idle)
+	dsb					@ WFI may enter a low-power mode
+	wfi
+	dsb					@barrier
+	mov	pc, lr
+ENDPROC(cpu_pj4b_do_idle)
+#else
+	globl_equ	cpu_pj4b_do_idle,  	cpu_v7_do_idle
+#endif
+	globl_equ	cpu_pj4b_dcache_clean_area,	cpu_v7_dcache_clean_area
+	globl_equ	cpu_pj4b_do_suspend,	cpu_v7_do_suspend
+	globl_equ	cpu_pj4b_do_resume,	cpu_v7_do_resume
+	globl_equ	cpu_pj4b_suspend_size,	cpu_v7_suspend_size
+
+#endif
 
 /*
  *	__v7_setup
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH 1/3 arm: delete __cpuinit/__CPUINIT usage from all ARM users

Quoted 2 lines · Francesco VIRLINZI
 arch/arm/common/mcpm_platsmp.c       |   84 +++++++++
 arch/arm/include/asm/arch_timer.h    |  105 +++++++++++

I hope this isn't an indication of the quality of the ST Linux tree - where patches are badly backported to some previous kernel version without understanding what a delete/modify conflict actually is.

Several of the "new files" you introduce here are irrelevant to this change, because they didn't exist when the change was made. If they don't exist, then they don't need to be patched, and so they shouldn't be created by the patch!

#3 lore raw

PATCH 1/3 arm: delete __cpuinit/__CPUINIT usage from all ARM users

In reply to Francesco VIRLINZI
Quoted 63 lines · Francesco VIRLINZI

From: Paul Gortmaker <[email protected]>

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 5e427ec2d0 ("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 <[email protected]>
Cc Will Deacon <[email protected]>
Cc linux-arm-kernel at lists.infradead.org

Conflicts:

	arch/arm/common/mcpm_platsmp.c
	arch/arm/include/asm/arch_timer.h
	arch/arm/kernel/head-common.S
	arch/arm/kernel/head-nommu.S
	arch/arm/kernel/perf_event_cpu.c
	arch/arm/kernel/psci_smp.c
	arch/arm/kernel/smp.c
	arch/arm/lib/delay.c
	arch/arm/mach-exynos/platsmp.c
	arch/arm/mach-highbank/platsmp.c
	arch/arm/mach-imx/platsmp.c
	arch/arm/mach-keystone/platsmp.c
	arch/arm/mach-msm/platsmp.c
	arch/arm/mach-mvebu/coherency.c
	arch/arm/mach-mvebu/headsmp.S
	arch/arm/mach-mvebu/platsmp.c
	arch/arm/mach-omap2/omap-headsmp.S
	arch/arm/mach-omap2/omap-smp.c
	arch/arm/mach-prima2/headsmp.S
	arch/arm/mach-prima2/platsmp.c
	arch/arm/mach-shmobile/headsmp-scu.S
	arch/arm/mach-shmobile/headsmp.S
	arch/arm/mach-shmobile/smp-emev2.c
	arch/arm/mach-shmobile/smp-r8a7779.c
	arch/arm/mach-shmobile/smp-sh73a0.c
	arch/arm/mach-socfpga/headsmp.S
	arch/arm/mach-socfpga/platsmp.c
	arch/arm/mach-spear/generic.h
Quoted 8 lines
	arch/arm/mach-spear/platsmp.c
	arch/arm/mach-sti/platsmp.c
	arch/arm/mach-tegra/platsmp.c
	arch/arm/mach-tegra/pm.c
	arch/arm/mach-ux500/platsmp.c
	arch/arm/mach-zynq/common.h
	arch/arm/mach-zynq/headsmp.S
	arch/arm/mach-zynq/platsmp.c

What's this?
Probably incorrect setup of git send-email.

Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131118/428e84b0/attachment.sig>
#4 lore raw

PATCH 1/3 arm: delete __cpuinit/__CPUINIT usage from all ARM users

Hi all

Quoted 2 lines
Quoted 2 lines

What's this?
Probably incorrect setup of git send-email.

Yes Sorry.
Now fixed.

Regards
Francesco

#5 lore raw

PATCH 1/3 arm: delete __cpuinit/__CPUINIT usage from all ARM users

Quoted 7 lines · Francesco VIRLINZI

Hi all

Quoted 2 lines
Quoted 2 lines

What's this?
Probably incorrect setup of git send-email.

Yes Sorry.
Now fixed.

Nevertheless, you still want to fix that patch properly. :)