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: 21912 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1287320DB9 for ; Mon, 2 Dec 2013 05:52:46 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf27547924yho.0 for ; Sun, 01 Dec 2013 21: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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=y6Us2OLLLZFeIAXvefY9QzhFOsUP8uFs0AuN6UajfA8=; b=PgPWCbNRvKAobw2TThKTb4AmWv95BfGiil1QF2zaPhsTloUyGiWD/SSzsJFF9Rx+df dgNLSPmV5wHq8KjgqV4N/gYMCmGMdjaPcm/xfO4ISP18Ks9LZ9W+pLnUk2RgAZv6cK2K XqED0KulRemXQQ5YvKERIl3UTAh7xOgaGJbgaiP6R4aoYWQ9OizcEQKnpDPprIWTsOvn NNNCa7lofFo6BMbHzbCl5OGU5M5OA8IQNpRCSIE5f2PGRHH87e4iW/auEbQPh7J9LDLS cVoAeO6n77tz+5M7qZOCYj6YhN3XtImaslDmGsNowIMpS1FciHUxIchlAlUVYyUfokDr XISQ== X-Gm-Message-State: ALoCoQn4nHnvglI3Acg0g5ZLkQOtFO+rEOwX3OxR+4kTurV1nAKkcWXNuWLxit1j5fJtAD9FenEj X-Received: by 10.236.13.36 with SMTP id a24mr162683yha.50.1385963565664; Sun, 01 Dec 2013 21:52:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.40 with SMTP id gb8ls4618511qeb.27.gmail; Sun, 01 Dec 2013 21:52:45 -0800 (PST) X-Received: by 10.220.209.202 with SMTP id gh10mr159101vcb.50.1385963565581; Sun, 01 Dec 2013 21:52:45 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id ef6si29016914ved.123.2013.12.01.21.52.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 01 Dec 2013 21:52:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id lh4so8320376vcb.9 for ; Sun, 01 Dec 2013 21:52:45 -0800 (PST) X-Received: by 10.52.233.197 with SMTP id ty5mr156802vdc.48.1385963565509; Sun, 01 Dec 2013 21:52:45 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp92649vcz; Sun, 1 Dec 2013 21:52:45 -0800 (PST) X-Received: by 10.49.1.10 with SMTP id 10mr110266092qei.6.1385963565020; Sun, 01 Dec 2013 21:52:45 -0800 (PST) Received: from mail-qe0-f50.google.com (mail-qe0-f50.google.com [209.85.128.50]) by mx.google.com with ESMTPS id f4si30062273qai.68.2013.12.01.21.52.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 01 Dec 2013 21:52:45 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.128.50; Received: by mail-qe0-f50.google.com with SMTP id 1so10912128qec.9 for ; Sun, 01 Dec 2013 21:52:44 -0800 (PST) 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: 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.178 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;