From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbdJPIfg (ORCPT ); Mon, 16 Oct 2017 04:35:36 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:53941 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbdJPIfe (ORCPT ); Mon, 16 Oct 2017 04:35:34 -0400 X-Google-Smtp-Source: AOwi7QC8ITiTlXRpjzfFcIZT7TJ9+FbLPOocxA0IiNLoo/WpXfoZq/XcUhhldWEJj+7nd6KOzYVTSw== From: Kevin Hilman To: Viresh Kumar Cc: Rafael Wysocki , ulf.hansson@linaro.org, linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , robh+dt@kernel.org, lina.iyer@linaro.org, rnayak@codeaurora.org, sudeep.holla@arm.com, linux-kernel@vger.kernel.org, Len Brown , Pavel Machek , Andy Gross , David Brown Subject: Re: [PATCH V13 1/7] PM / Domains: Add support to select performance-state of domains Organization: BayLibre References: <431a7a5803b4a552dfe2a71700e19b904c6d16dc.1507703370.git.viresh.kumar@linaro.org> <990605fb7b17b75abe63c542a4be2e176152b9f6.1507800860.git.viresh.kumar@linaro.org> Date: Mon, 16 Oct 2017 03:59:54 +0200 In-Reply-To: <990605fb7b17b75abe63c542a4be2e176152b9f6.1507800860.git.viresh.kumar@linaro.org> (Viresh Kumar's message of "Thu, 12 Oct 2017 15:07:23 +0530") Message-ID: <7hk1zvx36t.fsf@baylibre.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Viresh Kumar writes: > Some platforms have the capability to configure the performance state of > PM domains. This patch enhances the genpd core to support such > platforms. > > The performance levels (within the genpd core) are identified by > positive integer values, a lower value represents lower performance > state. > > This patch adds a new genpd API, which is called by user drivers (like > OPP framework): > > - int dev_pm_genpd_set_performance_state(struct device *dev, > unsigned int state); > > This updates the performance state constraint of the device on its PM > domain. On success, the genpd will have its performance state set to a > value which is >= "state" passed to this routine. The genpd core calls > the genpd->set_performance_state() callback, if implemented, > else -ENODEV is returned to the caller. > > The PM domain drivers need to implement the following callback if they > want to support performance states. > > - int (*set_performance_state)(struct generic_pm_domain *genpd, > unsigned int state); > > This is called internally by the genpd core on several occasions. The > genpd core passes the genpd pointer and the aggregate of the > performance states of the devices supported by that genpd to this > callback. This callback must update the performance state of the genpd > (in a platform dependent way). > > The power domains can avoid supplying above callback, if they don't > support setting performance-states. > > Currently we aren't propagating performance state changes of a subdomain > to its masters as we don't have hardware that needs it right now. Over > that, the performance states of subdomain and its masters may not have > one-to-one mapping and would require additional information. We can get > back to this once we have hardware that needs it. > > Tested-by: Rajendra Nayak > Signed-off-by: Viresh Kumar OK, I really like the OPP-related changes suggested by Ulf, and you've removed a lot of the complexity that made it a bit confusing to follow. It's definitley cleaned up and much easier to follow. Thanks for your persistence. This is definitely a needed feature. I have some usecases in mind where the performance state might need to be selected based on OPP voltage, but that's now a change that can be added later when that feature is needed. Reviewed-by: Kevin Hilman