From patchwork Thu Feb 13 06:50:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 24568 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 70298202E2 for ; Thu, 13 Feb 2014 06:52:46 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 131sf33727190ykp.1 for ; Wed, 12 Feb 2014 22:52:45 -0800 (PST) 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:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=70L5TvpXAd+g3bhyVvvo90EB8HL5wmCCT4nC96C3LKY=; b=DTegb6N+kyS3I6k+hNW3f+3wBYvMeeTcERi0ws9W1m5naxriu1RzvH1VU/cIZ10TC8 K8DSdNp3lCA+fmh8CdfL3QOBx5nzlggYDS9+0MuNQaUmrRkav6gAmRtaQozJBhDLjSBG 8PUZMgoqEkjXRoSqdhPUi9HyXlgePPsOFLSS12GId42RbJGp7AsAQCJOKuQMAsUyTnIY oAZZ3iHny38jjnPsrHWfLa5UwfCL1ldaE3Qfyq5F+FxvbE385SmLHMC9iKkRtLN0ySQT ViIZl4aPblDzTvljaDDSAduTW3YBvmLHgKC2eGVvJ0sOHBS0ee6j1czfOP+2hL5JY4yP IhBA== X-Gm-Message-State: ALoCoQlq9HvHmf1Hg0fLiW6cKzcLNmJlQ64q/0ojphnjJA/mrh26WC1hd6+HjQ3xvXOiwE/1iudd X-Received: by 10.58.221.74 with SMTP id qc10mr3349293vec.35.1392274365424; Wed, 12 Feb 2014 22:52:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.235 with SMTP id l98ls3242973qgl.90.gmail; Wed, 12 Feb 2014 22:52:45 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr35318099vcx.1.1392274365344; Wed, 12 Feb 2014 22:52:45 -0800 (PST) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id e9si339781vct.109.2014.02.12.22.52.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 22:52:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id le5so7850876vcb.16 for ; Wed, 12 Feb 2014 22:52:45 -0800 (PST) X-Received: by 10.221.22.71 with SMTP id qv7mr65652vcb.34.1392274365243; Wed, 12 Feb 2014 22:52:45 -0800 (PST) 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.220.174.196 with SMTP id u4csp3227vcz; Wed, 12 Feb 2014 22:52:44 -0800 (PST) X-Received: by 10.66.193.202 with SMTP id hq10mr44334848pac.57.1392274364319; Wed, 12 Feb 2014 22:52:44 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si981002pbk.23.2014.02.12.22.52.14; Wed, 12 Feb 2014 22:52:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbaBMGu4 (ORCPT + 27 others); Thu, 13 Feb 2014 01:50:56 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:35910 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002AbaBMGux (ORCPT ); Thu, 13 Feb 2014 01:50:53 -0500 Received: by mail-we0-f172.google.com with SMTP id p61so7112296wes.17 for ; Wed, 12 Feb 2014 22:50:52 -0800 (PST) X-Received: by 10.180.105.65 with SMTP id gk1mr5177968wib.12.1392274252168; Wed, 12 Feb 2014 22:50:52 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id ci4sm2065034wjc.21.2014.02.12.22.50.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 22:50:51 -0800 (PST) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.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, jinchoi@broadcom.com, tianyu.lan@intel.com, sebastian.capella@linaro.org, jhbird.choi@samsung.com, Viresh Kumar Subject: [PATCH V5 2/7] cpufreq: suspend governors from dpm_{suspend|resume}() Date: Thu, 13 Feb 2014 12:20:17 +0530 Message-Id: <545a227f55cf67ed7deb82504b63f943fbc166a6.1392273723.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-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: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Previous patch added support for suspending governors, with callbacks being 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 da49882..0f82012 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -582,7 +582,6 @@ static void dpm_resume_noirq(pm_message_t state) dpm_show_time(starttime, state, "noirq"); resume_device_irqs(); cpuidle_resume(); - cpufreq_resume(); } /** @@ -858,6 +857,8 @@ void dpm_resume(pm_message_t state) mutex_unlock(&dpm_list_mtx); async_synchronize_full(); dpm_show_time(starttime, state, NULL); + + cpufreq_resume(); } /** @@ -1063,7 +1064,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); @@ -1415,6 +1415,8 @@ int dpm_suspend(pm_message_t state) might_sleep(); + cpufreq_suspend(); + mutex_lock(&dpm_list_mtx); pm_transition = state; async_error = 0;