From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Gleixner Subject: [patch 15/18] sh: Use generic idle thread allocation Date: Fri, 20 Apr 2012 13:05:54 -0000 Message-ID: <20120420124557.855203626@linutronix.de> References: <20120420122120.097464672@linutronix.de> Return-path: Content-Disposition: inline; filename=sh-use-generic-idle-thread-allocation.patch Sender: linux-kernel-owner@vger.kernel.org To: LKML Cc: linux-arch@vger.kernel.org, Peter Zijlstra , Rusty Russell , "Paul E. McKenney" , Ingo Molnar , "Srivatsa S. Bhat" , Paul Mundt List-Id: linux-arch.vger.kernel.org Signed-off-by: Thomas Gleixner Cc: Paul Mundt --- arch/sh/Kconfig | 1 + arch/sh/include/asm/processor.h | 4 ---- arch/sh/kernel/smp.c | 14 +------------- 3 files changed, 2 insertions(+), 17 deletions(-) Index: linux-2.6/arch/sh/Kconfig =================================================================== --- linux-2.6.orig/arch/sh/Kconfig +++ linux-2.6/arch/sh/Kconfig @@ -28,6 +28,7 @@ config SUPERH select RTC_LIB select GENERIC_ATOMIC64 select GENERIC_IRQ_SHOW + select GENERIC_SMP_IDLE_THREAD help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast Index: linux-2.6/arch/sh/include/asm/processor.h =================================================================== --- linux-2.6.orig/arch/sh/include/asm/processor.h +++ linux-2.6/arch/sh/include/asm/processor.h @@ -85,10 +85,6 @@ struct sh_cpuinfo { struct tlb_info itlb; struct tlb_info dtlb; -#ifdef CONFIG_SMP - struct task_struct *idle; -#endif - unsigned int phys_bits; unsigned long flags; } __attribute__ ((aligned(L1_CACHE_BYTES))); Index: linux-2.6/arch/sh/kernel/smp.c =================================================================== --- linux-2.6.orig/arch/sh/kernel/smp.c +++ linux-2.6/arch/sh/kernel/smp.c @@ -220,22 +220,10 @@ extern struct { void *thread_info; } stack_start; -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tsk) { - struct task_struct *tsk; unsigned long timeout; - tsk = cpu_data[cpu].idle; - if (!tsk) { - tsk = fork_idle(cpu); - if (IS_ERR(tsk)) { - pr_err("Failed forking idle task for cpu %d\n", cpu); - return PTR_ERR(tsk); - } - - cpu_data[cpu].idle = tsk; - } - per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; /* Fill in data in head.S for secondary cpus */ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www.linutronix.de ([62.245.132.108]:44807 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752593Ab2DTNF7 (ORCPT ); Fri, 20 Apr 2012 09:05:59 -0400 Message-ID: <20120420124557.855203626@linutronix.de> Date: Fri, 20 Apr 2012 13:05:54 -0000 From: Thomas Gleixner Subject: [patch 15/18] sh: Use generic idle thread allocation References: <20120420122120.097464672@linutronix.de> Content-Disposition: inline; filename=sh-use-generic-idle-thread-allocation.patch Sender: linux-arch-owner@vger.kernel.org List-ID: To: LKML Cc: linux-arch@vger.kernel.org, Peter Zijlstra , Rusty Russell , "Paul E. McKenney" , Ingo Molnar , "Srivatsa S. Bhat" , Paul Mundt Message-ID: <20120420130554.e-xiV4cmXrcf9qql78G8tIBX4HCEBEYUVQ6m5NbE88g@z> Signed-off-by: Thomas Gleixner Cc: Paul Mundt --- arch/sh/Kconfig | 1 + arch/sh/include/asm/processor.h | 4 ---- arch/sh/kernel/smp.c | 14 +------------- 3 files changed, 2 insertions(+), 17 deletions(-) Index: linux-2.6/arch/sh/Kconfig =================================================================== --- linux-2.6.orig/arch/sh/Kconfig +++ linux-2.6/arch/sh/Kconfig @@ -28,6 +28,7 @@ config SUPERH select RTC_LIB select GENERIC_ATOMIC64 select GENERIC_IRQ_SHOW + select GENERIC_SMP_IDLE_THREAD help The SuperH is a RISC processor targeted for use in embedded systems and consumer electronics; it was also used in the Sega Dreamcast Index: linux-2.6/arch/sh/include/asm/processor.h =================================================================== --- linux-2.6.orig/arch/sh/include/asm/processor.h +++ linux-2.6/arch/sh/include/asm/processor.h @@ -85,10 +85,6 @@ struct sh_cpuinfo { struct tlb_info itlb; struct tlb_info dtlb; -#ifdef CONFIG_SMP - struct task_struct *idle; -#endif - unsigned int phys_bits; unsigned long flags; } __attribute__ ((aligned(L1_CACHE_BYTES))); Index: linux-2.6/arch/sh/kernel/smp.c =================================================================== --- linux-2.6.orig/arch/sh/kernel/smp.c +++ linux-2.6/arch/sh/kernel/smp.c @@ -220,22 +220,10 @@ extern struct { void *thread_info; } stack_start; -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tsk) { - struct task_struct *tsk; unsigned long timeout; - tsk = cpu_data[cpu].idle; - if (!tsk) { - tsk = fork_idle(cpu); - if (IS_ERR(tsk)) { - pr_err("Failed forking idle task for cpu %d\n", cpu); - return PTR_ERR(tsk); - } - - cpu_data[cpu].idle = tsk; - } - per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; /* Fill in data in head.S for secondary cpus */