Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934523AbcKVSlz (ORCPT ); Tue, 22 Nov 2016 13:41:55 -0500 Received: from mail-wj0-f180.google.com ([209.85.210.180]:36443 "EHLO mail-wj0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932508AbcKVSls (ORCPT ); Tue, 22 Nov 2016 13:41:48 -0500 X-Greylist: delayed 374 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Nov 2016 13:41:35 EST MIME-Version: 1.0 In-Reply-To: References: <20161121150708.j4gosfr2uetc7mwp@rob-hp-laptop> <20161122031717.GE10014@vireshk-i7> From: Vincent Guittot Date: Tue, 22 Nov 2016 19:34:59 +0100 Message-ID: Subject: Re: [PATCH 1/2] PM / Domains: Introduce domain-performance-state binding To: Kevin Hilman Cc: Viresh Kumar , Rob Herring , Rafael Wysocki , "linaro-kernel@lists.linaro.org" , "linux-pm@vger.kernel.org" , linux-kernel , Mark Rutland , Ulf Hansson , Lina Iyer , "devicetree@vger.kernel.org" , Stephen Boyd , Nayak Rajendra Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4253 Lines: 91 On 22 November 2016 at 19:12, Kevin Hilman wrote: > Viresh Kumar writes: > >> On 21-11-16, 09:07, Rob Herring wrote: >>> On Fri, Nov 18, 2016 at 02:53:12PM +0530, Viresh Kumar wrote: >>> > Some platforms have the capability to configure the performance state of >>> > their Power Domains. The performance levels are represented by positive >>> > integer values, a lower value represents lower performance state. >>> > >>> > The power-domains until now were only concentrating on the idle state >>> > management of the device and this needs to change in order to reuse the >>> > infrastructure of power domains for active state management. >>> > >>> > This patch introduces a new optional property for the consumers of the >>> > power-domains: domain-performance-state. >>> > >>> > If the consumers don't need the capability of switching to different >>> > domain performance states at runtime, then they can simply define their >>> > required domain performance state in their node directly. Otherwise the >>> > consumers can define their requirements with help of other >>> > infrastructure, for example the OPP table. >>> > >>> > Signed-off-by: Viresh Kumar >>> > --- >>> > Documentation/devicetree/bindings/power/power_domain.txt | 6 ++++++ >>> > 1 file changed, 6 insertions(+) >>> > >>> > diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt >>> > index e1650364b296..db42eacf8b5c 100644 >>> > --- a/Documentation/devicetree/bindings/power/power_domain.txt >>> > +++ b/Documentation/devicetree/bindings/power/power_domain.txt >>> > @@ -106,6 +106,12 @@ domain provided by the 'parent' power controller. >>> > - power-domains : A phandle and PM domain specifier as defined by bindings of >>> > the power controller specified by phandle. >>> > >>> > +Optional properties: >>> > +- domain-performance-state: A positive integer value representing the minimum >>> > + performance level (of the parent domain) required by the consumer for its >>> > + working. The integer value '1' represents the lowest performance level and the >>> > + highest value represents the highest performance level. >>> >>> How does one come up with the range of values? >> >> Why would we need a range here? The value here represents the minimum 'state' >> and the assumption is that everything above that level would be fine. So the >> range is automatically: domain-performance-state -> MAX. >> >>> It seems like you are >>> just making up numbers. Couldn't the domain performance level be an OPP >>> in the sense that it is a collection of clock frequencies and voltage >>> settings? >> >> The clock is going to be handled by the device itself (at least for the case we >> have today) and the performance-state lies with the power-domain which is >> configured separately. If the performance level includes both clk and voltage, >> then why would we need to show the clock rates in the DT ? Wouldn't a >> performance level be enough in such cases? > > I think the question is: what does the performance-level of a domain > actually mean? Or, what are the units? > > Depending on the SoC, there's probably a few things this could mean. It > might mean is that an underlying bus/interconnect can be configured to > guarantee a specific bandwidth or throughput. That in turn might mean > that that bus/interconnect might have to be set at a specific > frequency/voltage. > > In your case, IIUC, you're just passing some magic value to some > firmware running on a micro-controller, but under the hood that uC is > probably configuring a frequency/voltage someplace. In the case described by Viresh, it's only about setting the voltage of a power domain that is shared between different devices. these devices wants to run at different frequency (set by the devices) but we have to select a Volateg value that will match with the constraint of all devices (in this case the highest voltage) > > So, if we're going to have a generic DT binding for this, it needs to be > something that's useful on platforms that are not using magic numbers > managed by a uC as well. > > Kevin > > > > > > > >