From patchwork Tue Mar 18 05:43: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: 26449 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B823020143 for ; Tue, 18 Mar 2014 05:43:48 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf26813675oag.10 for ; Mon, 17 Mar 2014 22:43:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=NUlZ7SSfOU8qaIG+UkG5EmZIB/HIVQdQ6pens6/L2bg=; b=OdNJmpKsaIKG4sOfuP4q2UdLjYluNoJvjE4h2IYByNR6TjzxNJP1g2X/OazohjHOuy h/a5LTqur9jH0fkVwkmbFQsqBptMFkl5iXp1Cc3onSCNqWp1Xrgrt5xjI8n8iIWdAnA5 VuunHldPz2pJhEmFOg8/tzlIWxcSA3UMqXdCze6is2DVGUSobfJZdgtfksioj/EJAPNt iIo+nWdS71F7/xwT4UsQkuuiPFTW3AeuJeM1xfn/7ueM2a3xGbPa556+WsZghsM1hOQh SAfZmGtIoVxdT2ADTpQtFOQwTlORLnklQpzlIgM2AmNDlqCt1mDir26p3ufbI4mstilo Yq9w== X-Gm-Message-State: ALoCoQk8iepb4p9ZArspODD3womFEvTBfxTCL1PcoK1DfhZ+9/82uNctxnRkOQQSdRjFy8Elvsxm X-Received: by 10.50.129.74 with SMTP id nu10mr7086515igb.7.1395121427753; Mon, 17 Mar 2014 22:43:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.233 with SMTP id p96ls1782614qgd.33.gmail; Mon, 17 Mar 2014 22:43:47 -0700 (PDT) X-Received: by 10.220.104.210 with SMTP id q18mr13689123vco.9.1395121427636; Mon, 17 Mar 2014 22:43:47 -0700 (PDT) Received: from mail-vc0-x235.google.com (mail-vc0-x235.google.com [2607:f8b0:400c:c03::235]) by mx.google.com with ESMTPS id nc1si3366486vec.78.2014.03.17.22.43.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 22:43:47 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::235; Received: by mail-vc0-f181.google.com with SMTP id id10so6563977vcb.40 for ; Mon, 17 Mar 2014 22:43:47 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr5432880vdx.28.1395121427546; Mon, 17 Mar 2014 22:43:47 -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.220.78.9 with SMTP id i9csp178910vck; Mon, 17 Mar 2014 22:43:47 -0700 (PDT) X-Received: by 10.68.203.135 with SMTP id kq7mr30148423pbc.85.1395121426495; Mon, 17 Mar 2014 22:43:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn1si8975343pbc.278.2014.03.17.22.43.45; Mon, 17 Mar 2014 22:43:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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 S1751829AbaCRFnK (ORCPT + 11 others); Tue, 18 Mar 2014 01:43:10 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:37740 "EHLO mail-vc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750923AbaCRFnJ (ORCPT ); Tue, 18 Mar 2014 01:43:09 -0400 Received: by mail-vc0-f173.google.com with SMTP id il7so6577316vcb.4 for ; Mon, 17 Mar 2014 22:43:08 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.147.238 with SMTP id tn14mr19448260vdb.23.1395121388390; Mon, 17 Mar 2014 22:43:08 -0700 (PDT) Received: by 10.52.169.226 with HTTP; Mon, 17 Mar 2014 22:43:08 -0700 (PDT) In-Reply-To: <3229882.l5W5UxujLO@vostro.rjw.lan> References: <16035918.jZXKnQ3yiq@vostro.rjw.lan> <1394831037-15553-1-git-send-email-dirk.j.brandewie@intel.com> <1394831037-15553-2-git-send-email-dirk.j.brandewie@intel.com> <3229882.l5W5UxujLO@vostro.rjw.lan> Date: Tue, 18 Mar 2014 11:13:08 +0530 Message-ID: Subject: Re: [PATCH v2 1/2] cpufreq: Add exit_prepare callback to cpufreq_driver interface From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Dirk Brandewie , Linux PM list , "linux-kernel@vger.kernel.org" , Patrick Marlier , Dirk Brandewie Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::235 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; dkim=neutral (no key for signature) header.i=@gmail.com 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: , On Sat, Mar 15, 2014 at 7:34 AM, Rafael J. Wysocki wrote: > On Friday, March 14, 2014 02:03:56 PM dirk.brandewie@gmail.com wrote: >> +++ b/drivers/cpufreq/cpufreq.c >> @@ -1338,6 +1338,9 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, >> } >> } >> >> + if (cpufreq_driver->stop) > > What about doing > > + if (cpufreq_driver->setpolicy && cpufreq_driver->stop) > > here instead? That would make it clear where the new callback belongs. This is called after stopping governor and so might be useful for ->target() drivers. So, wouldn't be a bad option if we keep it available for all.. @Dirk: I thought about the solution I mentioned in another mail. And it looks like I will end up getting a similar solution. So, we will go with your solution. Just few changes for your solution.. You need to call ->stop() only for the last CPU of every policy and not for every CPU, so you need something like this: return 0; --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 19d25a8..78d41c0 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1371,6 +1371,8 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, __func__, new_cpu, cpu); } } + } else if (cpufreq_driver->stop) { + cpufreq_driver->stop(policy); }