From patchwork Tue Mar 17 15:25:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 45884 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C1182153C for ; Tue, 17 Mar 2015 15:25:28 +0000 (UTC) Received: by wghl18 with SMTP id l18sf2411908wgh.1 for ; Tue, 17 Mar 2015 08:25:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=S8zc24xSfJZm8Oj7IqMxhTcYcjSA6PSRiFcgVh5QmJU=; b=XE6RUEuK430DZmK1lgVib9/d0PeWZomJUIKyeP/MSC1VeAjM2Hlz/geF44mYYblHVy wkcE8n7R55MWyWE7tS7+9ngsF0so0qyVfs4frw9NR9bcK6lUh+oQQHTSCKxK9icAz7s8 0rrWRaxDn2lnFxZoBJA7BvYbHn93B/DTJBcj/fR+CnOzCMfoV97SrgQMmWxMcun/Qaez DjtLKnJy1Pu+TL32x3rJ+tos+JydHPV4DiwSp/duGAgP1Qwh75+y49K9G4NawTzlYxP7 C2hIEw5AwKQNe2Qv5rgjIkjqF4HEXLrPcIbNZXq+0N1XGY+YQDqG8OF73FmlO9A7ZtBb +DLQ== X-Gm-Message-State: ALoCoQlvSpdkKOcPy2fFr6APmIeZ9txCnN7IzI6FN11yn85wFL5L5fiAIZlQBIJJqolBUYdJMqn2 X-Received: by 10.152.164.171 with SMTP id yr11mr7260542lab.4.1426605927880; Tue, 17 Mar 2015 08:25:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.225.132 with SMTP id rk4ls55540lac.50.gmail; Tue, 17 Mar 2015 08:25:27 -0700 (PDT) X-Received: by 10.152.163.2 with SMTP id ye2mr36950463lab.89.1426605927696; Tue, 17 Mar 2015 08:25:27 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id r6si10777639laa.53.2015.03.17.08.25.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 08:25:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lamx15 with SMTP id x15so11678036lam.3 for ; Tue, 17 Mar 2015 08:25:27 -0700 (PDT) X-Received: by 10.112.181.41 with SMTP id dt9mr61910654lbc.56.1426605927255; Tue, 17 Mar 2015 08:25:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp581787lbj; Tue, 17 Mar 2015 08:25:26 -0700 (PDT) X-Received: by 10.70.131.227 with SMTP id op3mr110903666pdb.12.1426605925379; Tue, 17 Mar 2015 08:25:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hu17si29921140pdb.257.2015.03.17.08.25.24; Tue, 17 Mar 2015 08:25:25 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754284AbbCQPZU (ORCPT + 28 others); Tue, 17 Mar 2015 11:25:20 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:36640 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753465AbbCQPZR (ORCPT ); Tue, 17 Mar 2015 11:25:17 -0400 Received: by wibg7 with SMTP id g7so66225685wib.1 for ; Tue, 17 Mar 2015 08:25:15 -0700 (PDT) X-Received: by 10.180.86.35 with SMTP id m3mr2916053wiz.83.1426605915702; Tue, 17 Mar 2015 08:25:15 -0700 (PDT) Received: from mai.lan (135-224-190-109.dsl.ovh.fr. [109.190.224.135]) by mx.google.com with ESMTPSA id j7sm3143438wix.4.2015.03.17.08.25.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2015 08:25:14 -0700 (PDT) From: Daniel Lezcano To: horms@verge.net.au, magnus.damm@gmail.com Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2] ARM: shmobile: cpuidle: Remove the pointless default driver Date: Tue, 17 Mar 2015 16:25:12 +0100 Message-Id: <1426605912-28032-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The default idle driver uses one state with the WFI instruction. The default idle routine invokes WFI when no cpuidle driver is present. The default cpuidle driver is pointless and does not give more than the default idle routine and moreover it pulls all the mathematics tied with the cpuidle governor for nothing, hence consuming more energy. Remove the default driver, the related code and register the driver directly. [compiled only - no board - no test] Signed-off-by: Daniel Lezcano --- arch/arm/mach-shmobile/Makefile | 1 - arch/arm/mach-shmobile/common.h | 9 --------- arch/arm/mach-shmobile/cpuidle.c | 37 ------------------------------------- arch/arm/mach-shmobile/pm-sh7372.c | 2 +- 4 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 arch/arm/mach-shmobile/cpuidle.c diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index d53996e..c604296 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -46,7 +46,6 @@ smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o # PM objects obj-$(CONFIG_SUSPEND) += suspend.o -obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_PM_RCAR) += pm-rcar.o obj-$(CONFIG_PM_RMOBILE) += pm-rmobile.o diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 309025e..1dc0971 100644 --- a/arch/arm/mach-shmobile/common.h +++ b/arch/arm/mach-shmobile/common.h @@ -23,8 +23,6 @@ struct clk; extern int shmobile_clk_init(void); extern void shmobile_handle_irq_intc(struct pt_regs *); extern struct platform_suspend_ops shmobile_suspend_ops; -struct cpuidle_driver; -extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); #ifdef CONFIG_SUSPEND int shmobile_suspend_init(void); @@ -34,12 +32,6 @@ static inline int shmobile_suspend_init(void) { return 0; } static inline void shmobile_smp_apmu_suspend_init(void) { } #endif -#ifdef CONFIG_CPU_IDLE -int shmobile_cpuidle_init(void); -#else -static inline int shmobile_cpuidle_init(void) { return 0; } -#endif - #ifdef CONFIG_CPU_FREQ int shmobile_cpufreq_init(void); #else @@ -51,7 +43,6 @@ extern void __iomem *shmobile_scu_base; static inline void __init shmobile_init_late(void) { shmobile_suspend_init(); - shmobile_cpuidle_init(); shmobile_cpufreq_init(); } diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c deleted file mode 100644 index 0afeb5c..0000000 --- a/arch/arm/mach-shmobile/cpuidle.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CPUIdle support code for SH-Mobile ARM - * - * Copyright (C) 2011 Magnus Damm - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ - -#include -#include -#include -#include -#include -#include -#include - -static struct cpuidle_driver shmobile_cpuidle_default_driver = { - .name = "shmobile_cpuidle", - .owner = THIS_MODULE, - .states[0] = ARM_CPUIDLE_WFI_STATE, - .safe_state_index = 0, /* C1 */ - .state_count = 1, -}; - -static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver; - -void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) -{ - cpuidle_drv = drv; -} - -int __init shmobile_cpuidle_init(void) -{ - return cpuidle_register(cpuidle_drv, NULL); -} diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index c0293ae..9f19052 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -462,7 +462,7 @@ static struct cpuidle_driver sh7372_cpuidle_driver = { static void __init sh7372_cpuidle_init(void) { - shmobile_cpuidle_set_driver(&sh7372_cpuidle_driver); + return cpuidle_register(cpuidle_drv, NULL); } #else static void __init sh7372_cpuidle_init(void) {}