From patchwork Tue Oct 6 15:34:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Bharadwaj X-Patchwork-Id: 35123 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id BB729B85D2 for ; Wed, 7 Oct 2009 02:35:15 +1100 (EST) Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [59.145.155.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e28smtp05.in.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 30B80B7C73 for ; Wed, 7 Oct 2009 02:35:07 +1100 (EST) Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by e28smtp05.in.ibm.com (8.14.3/8.13.1) with ESMTP id n96FYsws027034 for ; Tue, 6 Oct 2009 21:04:54 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n96FYrqM2678994 for ; Tue, 6 Oct 2009 21:04:53 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id n96FYqlq015220 for ; Tue, 6 Oct 2009 21:04:53 +0530 Received: from linux.vnet.ibm.com ([9.77.122.245]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id n96FYflE014899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 6 Oct 2009 21:04:45 +0530 Date: Tue, 6 Oct 2009 21:04:40 +0530 From: Arun R Bharadwaj To: Peter Zijlstra , Joel Schopp , Benjamin Herrenschmidt , Paul Mackerras , Ingo Molnar , Vaidyanathan Srinivasan , Dipankar Sarma , Balbir Singh , Gautham R Shenoy , Venkatesh Pallipadi , Arun Bharadwaj Subject: [v7 PATCH 6/7]: POWER: add a default_idle idle loop for POWER. Message-ID: <20091006153440.GC7343@linux.vnet.ibm.com> References: <20091006152421.GA7278@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091006152421.GA7278@linux.vnet.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: arun@linux.vnet.ibm.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org * Arun R Bharadwaj [2009-10-06 20:54:21]: In arch/powerpc/kernel/idle.c create a default_idle() routine by moving the failover condition of the cpu_idle() idle loop. This is needed by cpuidle infrastructure to call default_idle when other idle routines are not yet registered. Functionality remains the same, but the code is slightly moved around. Signed-off-by: Arun R Bharadwaj --- arch/powerpc/Kconfig | 3 +++ arch/powerpc/include/asm/system.h | 1 + arch/powerpc/kernel/idle.c | 6 ++++++ 3 files changed, 10 insertions(+) Index: linux.trees.git/arch/powerpc/Kconfig =================================================================== --- linux.trees.git.orig/arch/powerpc/Kconfig +++ linux.trees.git/arch/powerpc/Kconfig @@ -91,6 +91,9 @@ config ARCH_HAS_ILOG2_U64 config ARCH_HAS_CPU_IDLE_WAIT def_bool y +config ARCH_HAS_DEFAULT_IDLE + def_bool y + config GENERIC_HWEIGHT bool default y Index: linux.trees.git/arch/powerpc/include/asm/system.h =================================================================== --- linux.trees.git.orig/arch/powerpc/include/asm/system.h +++ linux.trees.git/arch/powerpc/include/asm/system.h @@ -218,6 +218,7 @@ extern unsigned long klimit; extern void *alloc_maybe_bootmem(size_t size, gfp_t mask); extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); +extern void default_idle(void); extern int powersave_nap; /* set if nap mode can be used in idle loop */ /* Index: linux.trees.git/arch/powerpc/kernel/idle.c =================================================================== --- linux.trees.git.orig/arch/powerpc/kernel/idle.c +++ linux.trees.git/arch/powerpc/kernel/idle.c @@ -113,6 +113,12 @@ void cpu_idle_wait(void) } EXPORT_SYMBOL_GPL(cpu_idle_wait); +void default_idle(void) +{ + HMT_low(); + HMT_very_low(); +} + int powersave_nap; #ifdef CONFIG_SYSCTL