From patchwork Tue Feb 12 18:03:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 219927 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 883A82C0080 for ; Wed, 13 Feb 2013 05:03:40 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933624Ab3BLSDK (ORCPT ); Tue, 12 Feb 2013 13:03:10 -0500 Received: from mail-vb0-f44.google.com ([209.85.212.44]:42314 "EHLO mail-vb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932370Ab3BLSDI (ORCPT ); Tue, 12 Feb 2013 13:03:08 -0500 Received: by mail-vb0-f44.google.com with SMTP id fr13so216788vbb.31 for ; Tue, 12 Feb 2013 10:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=s9kXQOoEeJvnFFa4k73m+kWZDCaBAdy498ahymSXNYE=; b=p7TlYDP++R4yI0GunBbLy3FRaS289W7p6hMWFeHZyBfcKbXD+kncqdX542kmusESwy P0Jmr8kjBJwYrkFyBXZ6MvbFguGGyfpfR59RIcE9lEvG3xnP4vkQ1LI9P/WVdxYsrFNq VlOSFW02yE+d7zN3zo6aWjp9aOkdK9xSofo3sABMEWvAW3nP18NQYXJU7gsspsaC5PCX ppokr4xvvl4oa7ObYOkZdAsznwqdXNS70KhwsQ4cCXO0wND7/9cc408GhMewrGWbfDDD /UmU5fF7yps9ukHGlamAnpdom5vIqYEmgYUPZDybGf/85R2czxTqWIJf27V3ot/217ph Fw+Q== X-Received: by 10.220.151.144 with SMTP id c16mr25678321vcw.18.1360692187118; Tue, 12 Feb 2013 10:03:07 -0800 (PST) Received: from [192.168.0.98] (pool-108-7-58-246.bstnma.fios.verizon.net. [108.7.58.246]) by mx.google.com with ESMTPS id cd16sm65981850vdb.0.2013.02.12.10.03.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 12 Feb 2013 10:03:06 -0800 (PST) Message-ID: <511A83D8.7020202@kernel.org> Date: Tue, 12 Feb 2013 13:03:04 -0500 From: Len Brown User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Sam Ravnborg CC: Stephen Rothwell , Len Brown , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, Linux PM list Subject: Re: Should SPARC use cpuidle? References: <20130211183409.7519b73ca320baeac5ec886f@canb.auug.org.au> <51197D8B.6010407@kernel.org> <20130212173505.GA2155@merkur.ravnborg.org> <511A837B.8020804@kernel.org> In-Reply-To: <511A837B.8020804@kernel.org> Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org >> Can you please move the definition of sparc_idle to processor_32.h >> It is sparc32 specific - and then we do not need the __ASSEMBLY__ guards >> as the sparc32 variant are not used from assembler. > > sure, let me know if attached works. ugh, not accustomed to sending patches via thunderbird. hopefully this attachment works... Acked-by: Sam Ravnborg From 358ca5d7e02c4559ad3fbf8135421e4a3753e979 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sat, 9 Feb 2013 23:27:26 -0500 Subject: [PATCH] sparc idle: rename pm_idle to sparc_idle Reply-To: Len Brown Organization: Intel Open Source Technology Center (pm_idle)() is being removed from linux/pm.h because Linux does not have such a cross-architecture concept. sparc uses an idle function pointer in its architecture specific code. So we re-name sparc use of pm_idle to sparc_idle. Maybe some day, SPARC will cut over to cpuidle... Signed-off-by: Len Brown Acked-by: David S. Miller --- arch/sparc/include/asm/processor_32.h | 1 + arch/sparc/kernel/apc.c | 3 ++- arch/sparc/kernel/leon_pmc.c | 5 +++-- arch/sparc/kernel/pmc.c | 3 ++- arch/sparc/kernel/process_32.c | 7 +++---- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h index c1e0191..2c7baa4 100644 --- a/arch/sparc/include/asm/processor_32.h +++ b/arch/sparc/include/asm/processor_32.h @@ -118,6 +118,7 @@ extern unsigned long get_wchan(struct task_struct *); extern struct task_struct *last_task_used_math; #define cpu_relax() barrier() +extern void (*sparc_idle)(void); #endif diff --git a/arch/sparc/kernel/apc.c b/arch/sparc/kernel/apc.c index 348fa1a..eefda32 100644 --- a/arch/sparc/kernel/apc.c +++ b/arch/sparc/kernel/apc.c @@ -20,6 +20,7 @@ #include #include #include +#include /* Debugging * @@ -158,7 +159,7 @@ static int apc_probe(struct platform_device *op) /* Assign power management IDLE handler */ if (!apc_no_idle) - pm_idle = apc_swift_idle; + sparc_idle = apc_swift_idle; printk(KERN_INFO "%s: power management initialized%s\n", APC_DEVNAME, apc_no_idle ? " (CPU idle disabled)" : ""); diff --git a/arch/sparc/kernel/leon_pmc.c b/arch/sparc/kernel/leon_pmc.c index 4e17432..708bca4 100644 --- a/arch/sparc/kernel/leon_pmc.c +++ b/arch/sparc/kernel/leon_pmc.c @@ -9,6 +9,7 @@ #include #include #include +#include /* List of Systems that need fixup instructions around power-down instruction */ unsigned int pmc_leon_fixup_ids[] = { @@ -69,9 +70,9 @@ static int __init leon_pmc_install(void) if (sparc_cpu_model == sparc_leon) { /* Assign power management IDLE handler */ if (pmc_leon_need_fixup()) - pm_idle = pmc_leon_idle_fixup; + sparc_idle = pmc_leon_idle_fixup; else - pm_idle = pmc_leon_idle; + sparc_idle = pmc_leon_idle; printk(KERN_INFO "leon: power management initialized\n"); } diff --git a/arch/sparc/kernel/pmc.c b/arch/sparc/kernel/pmc.c index dcbb62f..8b7297f 100644 --- a/arch/sparc/kernel/pmc.c +++ b/arch/sparc/kernel/pmc.c @@ -17,6 +17,7 @@ #include #include #include +#include /* Debug * @@ -63,7 +64,7 @@ static int pmc_probe(struct platform_device *op) #ifndef PMC_NO_IDLE /* Assign power management IDLE handler */ - pm_idle = pmc_swift_idle; + sparc_idle = pmc_swift_idle; #endif printk(KERN_INFO "%s: power management initialized\n", PMC_DEVNAME); diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index be8e862..62eede1 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c @@ -43,8 +43,7 @@ * Power management idle function * Set in pm platform drivers (apc.c and pmc.c) */ -void (*pm_idle)(void); -EXPORT_SYMBOL(pm_idle); +void (*sparc_idle)(void); /* * Power-off handler instantiation for pm.h compliance @@ -75,8 +74,8 @@ void cpu_idle(void) /* endless idle loop with no priority at all */ for (;;) { while (!need_resched()) { - if (pm_idle) - (*pm_idle)(); + if (sparc_idle) + (*sparc_idle)(); else cpu_relax(); } -- 1.8.1.3.535.ga923c31