From patchwork Mon Dec 2 05:52:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 3263931 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 96DF99F377 for ; Mon, 2 Dec 2013 05:54:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AFA7820295 for ; Mon, 2 Dec 2013 05:54:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE27E202A1 for ; Mon, 2 Dec 2013 05:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840Ab3LBFyu (ORCPT ); Mon, 2 Dec 2013 00:54:50 -0500 Received: from mail-qe0-f44.google.com ([209.85.128.44]:37448 "EHLO mail-qe0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752624Ab3LBFwp (ORCPT ); Mon, 2 Dec 2013 00:52:45 -0500 Received: by mail-qe0-f44.google.com with SMTP id nd7so12050491qeb.17 for ; Sun, 01 Dec 2013 21:52:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=y6Us2OLLLZFeIAXvefY9QzhFOsUP8uFs0AuN6UajfA8=; b=Rrq4Zt9v+5/99kULynVmySuAC5MTmeCn2s+s5VT54TaQyGfr3QywXoSzprqJViUDfZ ju6nH910xlU6YxWAUDHBUGmjJN7yiTRtpSds7FwNbE9FjmuRjiSXBDi3peO4s1Ooc8T8 cktA+8eOBCjU45KW+9MsXNJkFN1aikEnoMH/RtCwpsJkShQMD7zMCuihCZxbafsGSg7H R4W0kNAYa06ucSw/qxDCF+i74usNa+eiN/kisV0xzplxL/RzUX1MeAKN+k59rtlSenSO ZxINUyy2y7aPe3La8CYopfdEH55JWTdJSeuV8zuxhY2Sw+FMGw2zwfLijOU1pIcirMh/ fCzg== X-Gm-Message-State: ALoCoQmSkZnS7nhOYo04PmZlkhVM1fr8/61B71yrzllbrV28HTy7oNiJhcTMryNBJQAeLCul1ITb X-Received: by 10.49.106.37 with SMTP id gr5mr58710550qeb.75.1385963564702; Sun, 01 Dec 2013 21:52:44 -0800 (PST) Received: from localhost (git.linaro.org. [54.235.93.228]) by mx.google.com with ESMTPSA id r5sm204390843qaj.13.2013.12.01.21.52.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 01 Dec 2013 21:52:44 -0800 (PST) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, nm@ti.com, swarren@wwwdotorg.org, kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, tianyu.lan@intel.com, jhbird.choi@samsung.com, Viresh Kumar Subject: [PATCH V4 1/6] cpufreq: suspend governors from dpm_{suspend|resume}() Date: Mon, 2 Dec 2013 11:22:31 +0530 Message-Id: <6b3eed450097f1c3309b26a3b9c319385559314b.1385962528.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Recently support for suspending governors has been added in cpufreq and callbacks are called from dpm_{suspend|resume}_noirq(). The problem here is that most of the devices (i.e. devices with ->suspend() callbacks) have already been suspended by now and so if drivers want to change frequency before suspending, then it might not be possible for many platforms (which depend on other peripherals like i2c, regulators, etc). So, we actually need to do this from dpm_{suspend|resume}() instead. This patch does it. Tested-by: Lan Tianyu Tested-by: Nishanth Menon Tested-by: Stephen Warren Signed-off-by: Viresh Kumar --- drivers/base/power/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index e3219df..c9fbb9d 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -541,7 +541,6 @@ static void dpm_resume_noirq(pm_message_t state) dpm_show_time(starttime, state, "noirq"); resume_device_irqs(); cpuidle_resume(); - cpufreq_resume(); } /** @@ -791,6 +790,8 @@ void dpm_resume(pm_message_t state) mutex_unlock(&dpm_list_mtx); async_synchronize_full(); dpm_show_time(starttime, state, NULL); + + cpufreq_resume(); } /** @@ -957,7 +958,6 @@ static int dpm_suspend_noirq(pm_message_t state) ktime_t starttime = ktime_get(); int error = 0; - cpufreq_suspend(); cpuidle_pause(); suspend_device_irqs(); mutex_lock(&dpm_list_mtx); @@ -1262,6 +1262,8 @@ int dpm_suspend(pm_message_t state) might_sleep(); + cpufreq_suspend(); + mutex_lock(&dpm_list_mtx); pm_transition = state; async_error = 0;