From patchwork Tue Mar 17 14:34:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 45881 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B68FF21547 for ; Tue, 17 Mar 2015 14:35:03 +0000 (UTC) Received: by labgq15 with SMTP id gq15sf2187490lab.0 for ; Tue, 17 Mar 2015 07:35:02 -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=Vc4CHzxuXNC8sCc6XkHIgzVEGRDFIakBqx4EtiLyuKE=; b=ar/+q6X5Ck6G8jsAGBeD9CnAgpM3ozK04wKJUw9PK1tiXt56fY/w5V1MhE6NeGDRRy LgeJHC8D3G80q2gl6JEbQK/dTu+RYO8xZdUudtuY3OTSjdwWC0nFesjjDhzXc9xFaWUE nBuBhCryOAX6hB+peBNbiMD1mt2WP4jWUvQtfEUaBy2Glc4BlzyYG1deNtIu3f8ds4ud E8sPCzEouUVoE6QzjfWfPpRz0lwHCr/v407TLfKqjkmY4TYon+95NATbf5yUDDaRQWcq d4pwc/H/Mi8jqhIDtODSdyEsH5EZizRQ6pgZKqJ8DuH39Ig7OBd56mn6/0i8mx/t2v2m 12Eg== X-Gm-Message-State: ALoCoQklmdYYJaf066C1vYSKc9Q0lMT6VOQ5SUBdTAi5H6sMtOTvm8lLXC2IuZp4/j/CbV92g4DB X-Received: by 10.112.167.131 with SMTP id zo3mr5580414lbb.7.1426602902620; Tue, 17 Mar 2015 07:35:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.105 with SMTP id db9ls38652lad.87.gmail; Tue, 17 Mar 2015 07:35:02 -0700 (PDT) X-Received: by 10.112.236.40 with SMTP id ur8mr25782690lbc.18.1426602902405; Tue, 17 Mar 2015 07:35:02 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id s1si10663251lbf.154.2015.03.17.07.35.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 07:35:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcds1 with SMTP id ds1so8415362lbc.3 for ; Tue, 17 Mar 2015 07:35:02 -0700 (PDT) X-Received: by 10.112.150.39 with SMTP id uf7mr10518170lbb.72.1426602902139; Tue, 17 Mar 2015 07:35:02 -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 h5csp549400lbj; Tue, 17 Mar 2015 07:35:01 -0700 (PDT) X-Received: by 10.70.136.202 with SMTP id qc10mr148754985pdb.117.1426602900360; Tue, 17 Mar 2015 07:35:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ki9si29691494pdb.160.2015.03.17.07.34.59; Tue, 17 Mar 2015 07:35:00 -0700 (PDT) Received-SPF: none (google.com: linux-pm-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 S1753306AbbCQOe5 (ORCPT + 11 others); Tue, 17 Mar 2015 10:34:57 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:35878 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753718AbbCQOe4 (ORCPT ); Tue, 17 Mar 2015 10:34:56 -0400 Received: by wetk59 with SMTP id k59so9205589wet.3 for ; Tue, 17 Mar 2015 07:34:54 -0700 (PDT) X-Received: by 10.194.94.1 with SMTP id cy1mr130262032wjb.127.1426602894687; Tue, 17 Mar 2015 07:34:54 -0700 (PDT) Received: from mai.lan (135-224-190-109.dsl.ovh.fr. [109.190.224.135]) by mx.google.com with ESMTPSA id hl15sm2947110wib.3.2015.03.17.07.34.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2015 07:34:53 -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] ARM: shmobile: cpuidle: Remove the pointless default driver Date: Tue, 17 Mar 2015 15:34:52 +0100 Message-Id: <1426602892-17208-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@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.217.171 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/common.h | 3 --- arch/arm/mach-shmobile/cpuidle.c | 37 ------------------------------------- arch/arm/mach-shmobile/pm-sh7372.c | 2 +- 3 files changed, 1 insertion(+), 41 deletions(-) diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 309025e..29b3088 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); @@ -51,7 +49,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 index 0afeb5c..e69de29 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -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) {}