From patchwork Sun Feb 10 05:58:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 2121501 X-Patchwork-Delegate: lenb@kernel.org Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1AE563FCD5 for ; Sun, 10 Feb 2013 06:00:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696Ab3BJF6t (ORCPT ); Sun, 10 Feb 2013 00:58:49 -0500 Received: from mail-vb0-f46.google.com ([209.85.212.46]:51069 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752477Ab3BJF6p (ORCPT ); Sun, 10 Feb 2013 00:58:45 -0500 Received: by mail-vb0-f46.google.com with SMTP id b13so3103216vby.19 for ; Sat, 09 Feb 2013 21:58:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=kx68UInsDj/rtzabKNjcZDRcIMzqo8WXCpvxxzxwe0g=; b=o3iuDZzmQ3gz13/DaM1MisAhoqjCK8ZlcD/8+mvdV4nqz77799JeRPe0mXCzjVhS6G mZAqQomuIbXi92hB8bgShE/tpiw+V8KcEl4EaMjHTtjO9lTAx1+eG1gbpBsRx3/OQrCH gw1tInX1EGhTG2zaLhTskLH5+Doo7NrcBG+/QeOB2e92eSKywU/K4WxKkz6y/vnlfo5K ScFtZRuooI6oMgzut7Ssl03S8iViBZmNREgKa05F/MU2EbTALTFWZcvsmb/wg1pAw5Nu aCC/LXtxIJirtlTSdyyyJxQ/ZVt7vmkjLn/VSlmkZd1ob38xjGaNHkyJcyjvgqCQbHvW vxyQ== X-Received: by 10.58.171.38 with SMTP id ar6mr13792042vec.23.1360475924238; Sat, 09 Feb 2013 21:58:44 -0800 (PST) Received: from x980.localdomain6 (pool-108-7-58-246.bstnma.fios.verizon.net. [108.7.58.246]) by mx.google.com with ESMTPS id p7sm42173052vdt.2.2013.02.09.21.58.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 21:58:43 -0800 (PST) From: Len Brown To: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown , linux-m32r@ml.linux-m32r.org Subject: [PATCH 10/16] m32r idle: delete pm_idle, and other dead idle code Date: Sun, 10 Feb 2013 00:58:17 -0500 Message-Id: <50145c48954ee5626107dd1aa4c2ed95dd1bc2b6.1360475150.git.len.brown@intel.com> X-Mailer: git-send-email 1.8.1.3.535.ga923c31 In-Reply-To: <1360475903-30007-1-git-send-email-lenb@kernel.org> References: <1360475903-30007-1-git-send-email-lenb@kernel.org> In-Reply-To: <2b219d07e0f287c2c713f5465fc8646158fa986e.1360475150.git.len.brown@intel.com> References: <2b219d07e0f287c2c713f5465fc8646158fa986e.1360475150.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Len Brown All paths on m32r lead to cpu_relax(). So delete the dead code and simply call cpu_relax() directly. Signed-off-by: Len Brown Cc: linux-m32r@ml.linux-m32r.org --- arch/m32r/kernel/process.c | 51 ++-------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index 765d0f5..bde899e 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c @@ -44,36 +44,10 @@ unsigned long thread_saved_pc(struct task_struct *tsk) return tsk->thread.lr; } -/* - * Powermanagement idle function, if any.. - */ -static void (*pm_idle)(void) = NULL; - void (*pm_power_off)(void) = NULL; EXPORT_SYMBOL(pm_power_off); /* - * We use this is we don't have any better - * idle routine.. - */ -static void default_idle(void) -{ - /* M32R_FIXME: Please use "cpu_sleep" mode. */ - cpu_relax(); -} - -/* - * On SMP it's slightly faster (but much more power-consuming!) - * to poll the ->work.need_resched flag instead of waiting for the - * cross-CPU IPI to arrive. Use this option with caution. - */ -static void poll_idle (void) -{ - /* M32R_FIXME */ - cpu_relax(); -} - -/* * The idle thread. There's no useful work to be * done, so just try to conserve power and have a * low exit latency (ie sit in a loop waiting for @@ -84,14 +58,8 @@ void cpu_idle (void) /* endless idle loop with no priority at all */ while (1) { rcu_idle_enter(); - while (!need_resched()) { - void (*idle)(void) = pm_idle; - - if (!idle) - idle = default_idle; - - idle(); - } + while (!need_resched()) + cpu_relax(); rcu_idle_exit(); schedule_preempt_disabled(); } @@ -120,21 +88,6 @@ void machine_power_off(void) /* M32R_FIXME */ } -static int __init idle_setup (char *str) -{ - if (!strncmp(str, "poll", 4)) { - printk("using poll in idle threads.\n"); - pm_idle = poll_idle; - } else if (!strncmp(str, "sleep", 4)) { - printk("using sleep in idle threads.\n"); - pm_idle = default_idle; - } - - return 1; -} - -__setup("idle=", idle_setup); - void show_regs(struct pt_regs * regs) { printk("\n");