Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84ec6d57 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

arm: Use generic idle thread allocation



Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: default avatarFrank Rowand <frank.rowand@am.sony.com>
Link: http://lkml.kernel.org/r/20120420124557.448826362@linutronix.de
parent 13583bf1
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ config ARM
	select CPU_PM if (SUSPEND || CPU_IDLE)
	select CPU_PM if (SUSPEND || CPU_IDLE)
	select GENERIC_PCI_IOMAP
	select GENERIC_PCI_IOMAP
	select HAVE_BPF_JIT if NET
	select HAVE_BPF_JIT if NET
	select GENERIC_SMP_IDLE_THREAD
	help
	help
	  The ARM series is a line of low-power-consumption RISC chip designs
	  The ARM series is a line of low-power-consumption RISC chip designs
	  licensed by ARM Ltd and targeted at embedded applications and
	  licensed by ARM Ltd and targeted at embedded applications and
+0 −1
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@
struct cpuinfo_arm {
struct cpuinfo_arm {
	struct cpu	cpu;
	struct cpu	cpu;
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
	struct task_struct *idle;
	unsigned int	loops_per_jiffy;
	unsigned int	loops_per_jiffy;
#endif
#endif
};
};
+1 −25
Original line number Original line Diff line number Diff line
@@ -60,31 +60,10 @@ enum ipi_msg_type {


static DECLARE_COMPLETION(cpu_running);
static DECLARE_COMPLETION(cpu_running);


int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle)
{
{
	struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu);
	struct task_struct *idle = ci->idle;
	int ret;
	int ret;


	/*
	 * Spawn a new process manually, if not already done.
	 * Grab a pointer to its task struct so we can mess with it
	 */
	if (!idle) {
		idle = fork_idle(cpu);
		if (IS_ERR(idle)) {
			printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
			return PTR_ERR(idle);
		}
		ci->idle = idle;
	} else {
		/*
		 * Since this idle thread is being re-used, call
		 * init_idle() to reinitialize the thread structure.
		 */
		init_idle(idle, cpu);
	}

	/*
	/*
	 * We need to tell the secondary core where to find
	 * We need to tell the secondary core where to find
	 * its stack and the page tables.
	 * its stack and the page tables.
@@ -318,9 +297,6 @@ void __init smp_cpus_done(unsigned int max_cpus)


void __init smp_prepare_boot_cpu(void)
void __init smp_prepare_boot_cpu(void)
{
{
	unsigned int cpu = smp_processor_id();

	per_cpu(cpu_data, cpu).idle = current;
}
}


void __init smp_prepare_cpus(unsigned int max_cpus)
void __init smp_prepare_cpus(unsigned int max_cpus)