From patchwork Mon Feb 17 09:25:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 24749 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C530C202B2 for ; Mon, 17 Feb 2014 09:25:45 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id gq1sf57980737obb.0 for ; Mon, 17 Feb 2014 01:25: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: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=VWEmJFFaMzpIILan3BTdIdlPadmwe/xhKHub8GCWaHo=; b=WNyrVdUUfK1dbAti/HdqSbrFegAOC8SkFEVJPfMZ6WfGqx3f+XB/RrTwoOEkwqfWxl F5ATRJWTmhmtWTVoRqJw5vYyns6aMpvkQjL2D+Ks6rXQpOzrnJoslpAZsy6H1TLmhqat U+SfjphgGbfxQd3HZSg8y99pavA6tdCLbRIl8oRDE1l8WBO5+cmIncsm7JDIGndGjIlw 3alyggpkaG0vdKNfnKMlYMOx2BxStbn4FYhgNjxGDsQWG0951G+Gb5bZgW6s0DOieoqL Ga48WkCnF/f+CLbEwRvu/mbi2t4vYXsOsSLMKT3J1XP8YcjDnAbx88Xe/8o//DM4gUlz PBbg== X-Gm-Message-State: ALoCoQn7RJPLr6mLEtu1/BZIg1qNKJKfG4gMPRuww2RSwqiNAOfkOsHy4E5qUUERg/iq+H2D10CR X-Received: by 10.42.119.209 with SMTP id c17mr9009392icr.17.1392629144692; Mon, 17 Feb 2014 01:25:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.71 with SMTP id d65ls810893qgf.60.gmail; Mon, 17 Feb 2014 01:25:44 -0800 (PST) X-Received: by 10.52.89.230 with SMTP id br6mr13993140vdb.20.1392629144591; Mon, 17 Feb 2014 01:25:44 -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 b20si142004veu.30.2014.02.17.01.25.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 01:25:44 -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 le5so11677079vcb.30 for ; Mon, 17 Feb 2014 01:25:44 -0800 (PST) X-Received: by 10.220.89.4 with SMTP id c4mr9955vcm.53.1392629144513; Mon, 17 Feb 2014 01:25:44 -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 u4csp123628vcz; Mon, 17 Feb 2014 01:25:44 -0800 (PST) X-Received: by 10.68.92.98 with SMTP id cl2mr25301715pbb.81.1392629143542; Mon, 17 Feb 2014 01:25:43 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ez5si14163216pab.19.2014.02.17.01.25.42; Mon, 17 Feb 2014 01:25:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of cpufreq-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 S1751829AbaBQJZk (ORCPT + 6 others); Mon, 17 Feb 2014 04:25:40 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:48529 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbaBQJZh (ORCPT ); Mon, 17 Feb 2014 04:25:37 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so1931159wgh.1 for ; Mon, 17 Feb 2014 01:25:35 -0800 (PST) X-Received: by 10.194.85.168 with SMTP id i8mr525877wjz.81.1392629135586; Mon, 17 Feb 2014 01:25:35 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id j9sm35233240wjz.13.2014.02.17.01.25.31 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 17 Feb 2014 01:25:34 -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 V6 2/7] cpufreq: suspend governors from dpm_{suspend|resume}() Date: Mon, 17 Feb 2014 14:55:08 +0530 Message-Id: <5b79cd9aa706d988d242d80d73cfe67c0e6c5b3d.1392629003.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: cpufreq-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: cpufreq@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;