* [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers [not found] <20180529100421.31022-1-ulf.hansson@linaro.org> @ 2018-05-29 10:04 ` Ulf Hansson 2018-05-31 3:53 ` Rob Herring 2018-05-31 6:18 ` Viresh Kumar 2018-05-29 10:04 ` [PATCH v2 6/9] PM / Domains: Don't attach devices in genpd with multi PM domains Ulf Hansson 1 sibling, 2 replies; 5+ messages in thread From: Ulf Hansson @ 2018-05-29 10:04 UTC (permalink / raw) To: Rafael J . Wysocki, linux-pm Cc: Ulf Hansson, Greg Kroah-Hartman, Jon Hunter, Geert Uytterhoeven, Todor Tomov, Rajendra Nayak, Viresh Kumar, Vincent Guittot, Kevin Hilman, linux-kernel, linux-arm-kernel, linux-tegra, Rob Herring, devicetree To be able to describe topologies where devices are partitioned across multiple power domains, let's extend the power-domain property to allow being a list of PM domain specifiers. Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Suggested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- Changes in v2: - Fixed comments from Geert. Re-worded to "PM domain specifiers" and clarified DT example. --- .../bindings/power/power_domain.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt index 4733f76cbe48..9b387f861aed 100644 --- a/Documentation/devicetree/bindings/power/power_domain.txt +++ b/Documentation/devicetree/bindings/power/power_domain.txt @@ -111,8 +111,8 @@ Example 3: ==PM domain consumers== Required properties: - - power-domains : A phandle and PM domain specifier as defined by bindings of - the power controller specified by phandle. + - power-domains : A list of PM domain specifiers, as defined by bindings of + the power controller that is the PM domain provider. Example: @@ -122,9 +122,18 @@ Example: power-domains = <&power 0>; }; -The node above defines a typical PM domain consumer device, which is located -inside a PM domain with index 0 of a power controller represented by a node -with the label "power". + leaky-device@12351000 { + compatible = "foo,i-leak-current"; + reg = <0x12351000 0x1000>; + power-domains = <&power 0>, <&power 1> ; + }; + +The first example above defines a typical PM domain consumer device, which is +located inside a PM domain with index 0 of a power controller represented by a +node with the label "power". +In the second example the consumer device are partitioned across two PM domains, +the first with index 0 and the second with index 1, of a power controller that +is represented by a node with the label "power. Optional properties: - required-opps: This contains phandle to an OPP node in another device's OPP -- 2.17.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers 2018-05-29 10:04 ` [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers Ulf Hansson @ 2018-05-31 3:53 ` Rob Herring 2018-05-31 6:18 ` Viresh Kumar 1 sibling, 0 replies; 5+ messages in thread From: Rob Herring @ 2018-05-31 3:53 UTC (permalink / raw) To: Ulf Hansson Cc: Rafael J . Wysocki, linux-pm, Greg Kroah-Hartman, Jon Hunter, Geert Uytterhoeven, Todor Tomov, Rajendra Nayak, Viresh Kumar, Vincent Guittot, Kevin Hilman, linux-kernel, linux-arm-kernel, linux-tegra, devicetree On Tue, May 29, 2018 at 12:04:17PM +0200, Ulf Hansson wrote: > To be able to describe topologies where devices are partitioned across > multiple power domains, let's extend the power-domain property to allow > being a list of PM domain specifiers. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: devicetree@vger.kernel.org > Suggested-by: Jon Hunter <jonathanh@nvidia.com> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> > --- > > Changes in v2: > - Fixed comments from Geert. Re-worded to "PM domain specifiers" and > clarified DT example. > > --- > .../bindings/power/power_domain.txt | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) Reviewed-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers 2018-05-29 10:04 ` [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers Ulf Hansson 2018-05-31 3:53 ` Rob Herring @ 2018-05-31 6:18 ` Viresh Kumar 1 sibling, 0 replies; 5+ messages in thread From: Viresh Kumar @ 2018-05-31 6:18 UTC (permalink / raw) To: Ulf Hansson Cc: Rafael J . Wysocki, linux-pm, Greg Kroah-Hartman, Jon Hunter, Geert Uytterhoeven, Todor Tomov, Rajendra Nayak, Vincent Guittot, Kevin Hilman, linux-kernel, linux-arm-kernel, linux-tegra, Rob Herring, devicetree On 29-05-18, 12:04, Ulf Hansson wrote: > To be able to describe topologies where devices are partitioned across > multiple power domains, let's extend the power-domain property to allow > being a list of PM domain specifiers. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: devicetree@vger.kernel.org > Suggested-by: Jon Hunter <jonathanh@nvidia.com> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> -- viresh ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 6/9] PM / Domains: Don't attach devices in genpd with multi PM domains [not found] <20180529100421.31022-1-ulf.hansson@linaro.org> 2018-05-29 10:04 ` [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers Ulf Hansson @ 2018-05-29 10:04 ` Ulf Hansson 2018-05-30 16:06 ` Jon Hunter 1 sibling, 1 reply; 5+ messages in thread From: Ulf Hansson @ 2018-05-29 10:04 UTC (permalink / raw) To: Rafael J . Wysocki, linux-pm Cc: Ulf Hansson, Greg Kroah-Hartman, Jon Hunter, Geert Uytterhoeven, Todor Tomov, Rajendra Nayak, Viresh Kumar, Vincent Guittot, Kevin Hilman, linux-kernel, linux-arm-kernel, linux-tegra, Rob Herring, devicetree The power-domain DT property may now contain a list of PM domain specifiers, which represents that a device are partitioned across multiple PM domains. This leads to a new situation in genpd_dev_pm_attach(), as only one PM domain can be attached per device. To remain things simple for the most common configuration, when a single PM domain is used, let's treat the multiple PM domain case as being specific. In other words, let's change genpd_dev_pm_attach() to check for multiple PM domains and prevent it from attach any PM domain for this case. Instead, leave this to be managed separately, from following changes to genpd. Cc: Rob Herring <robh+dt@kernel.org> Cc: devicetree@vger.kernel.org Suggested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- Changes in v2: - Minor update to changelog to mention "PM domain specifiers" rather than a "list of phandles". --- drivers/base/power/domain.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 7ebf7993273a..12a20f21974d 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2229,10 +2229,10 @@ static void genpd_dev_pm_sync(struct device *dev) * attaches the device to retrieved pm_domain ops. * * Returns 1 on successfully attached PM domain, 0 when the device don't need a - * PM domain or a negative error code in case of failures. Note that if a - * power-domain exists for the device, but it cannot be found or turned on, - * then return -EPROBE_DEFER to ensure that the device is not probed and to - * re-try again later. + * PM domain or when multiple power-domains exists for it, else a negative error + * code. Note that if a power-domain exists for the device, but it cannot be + * found or turned on, then return -EPROBE_DEFER to ensure that the device is + * not probed and to re-try again later. */ int genpd_dev_pm_attach(struct device *dev) { @@ -2243,10 +2243,18 @@ int genpd_dev_pm_attach(struct device *dev) if (!dev->of_node) return 0; + /* + * Devices with multiple PM domains must be attached separately, as we + * can only attach one PM domain per device. + */ + if (of_count_phandle_with_args(dev->of_node, "power-domains", + "#power-domain-cells") != 1) + return 0; + ret = of_parse_phandle_with_args(dev->of_node, "power-domains", "#power-domain-cells", 0, &pd_args); if (ret < 0) - return 0; + return ret; mutex_lock(&gpd_list_lock); pd = genpd_get_from_provider(&pd_args); -- 2.17.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 6/9] PM / Domains: Don't attach devices in genpd with multi PM domains 2018-05-29 10:04 ` [PATCH v2 6/9] PM / Domains: Don't attach devices in genpd with multi PM domains Ulf Hansson @ 2018-05-30 16:06 ` Jon Hunter 0 siblings, 0 replies; 5+ messages in thread From: Jon Hunter @ 2018-05-30 16:06 UTC (permalink / raw) To: Ulf Hansson, Rafael J . Wysocki, linux-pm Cc: Greg Kroah-Hartman, Geert Uytterhoeven, Todor Tomov, Rajendra Nayak, Viresh Kumar, Vincent Guittot, Kevin Hilman, linux-kernel, linux-arm-kernel, linux-tegra, Rob Herring, devicetree On 29/05/18 11:04, Ulf Hansson wrote: > The power-domain DT property may now contain a list of PM domain > specifiers, which represents that a device are partitioned across multiple > PM domains. This leads to a new situation in genpd_dev_pm_attach(), as only > one PM domain can be attached per device. > > To remain things simple for the most common configuration, when a single PM > domain is used, let's treat the multiple PM domain case as being specific. > > In other words, let's change genpd_dev_pm_attach() to check for multiple PM > domains and prevent it from attach any PM domain for this case. Instead, > leave this to be managed separately, from following changes to genpd. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: devicetree@vger.kernel.org > Suggested-by: Jon Hunter <jonathanh@nvidia.com> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> > --- > > Changes in v2: > - Minor update to changelog to mention "PM domain specifiers" rather > than a "list of phandles". > > --- > drivers/base/power/domain.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index 7ebf7993273a..12a20f21974d 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -2229,10 +2229,10 @@ static void genpd_dev_pm_sync(struct device *dev) > * attaches the device to retrieved pm_domain ops. > * > * Returns 1 on successfully attached PM domain, 0 when the device don't need a > - * PM domain or a negative error code in case of failures. Note that if a > - * power-domain exists for the device, but it cannot be found or turned on, > - * then return -EPROBE_DEFER to ensure that the device is not probed and to > - * re-try again later. > + * PM domain or when multiple power-domains exists for it, else a negative error > + * code. Note that if a power-domain exists for the device, but it cannot be > + * found or turned on, then return -EPROBE_DEFER to ensure that the device is > + * not probed and to re-try again later. > */ > int genpd_dev_pm_attach(struct device *dev) > { > @@ -2243,10 +2243,18 @@ int genpd_dev_pm_attach(struct device *dev) > if (!dev->of_node) > return 0; > > + /* > + * Devices with multiple PM domains must be attached separately, as we > + * can only attach one PM domain per device. > + */ > + if (of_count_phandle_with_args(dev->of_node, "power-domains", > + "#power-domain-cells") != 1) > + return 0; > + > ret = of_parse_phandle_with_args(dev->of_node, "power-domains", > "#power-domain-cells", 0, &pd_args); > if (ret < 0) > - return 0; > + return ret; > > mutex_lock(&gpd_list_lock); > pd = genpd_get_from_provider(&pd_args); > Acked-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Cheers Jon -- nvpublic ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-31 6:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180529100421.31022-1-ulf.hansson@linaro.org>
2018-05-29 10:04 ` [PATCH v2 5/9] PM / Domains: dt: Allow power-domain property to be a list of specifiers Ulf Hansson
2018-05-31 3:53 ` Rob Herring
2018-05-31 6:18 ` Viresh Kumar
2018-05-29 10:04 ` [PATCH v2 6/9] PM / Domains: Don't attach devices in genpd with multi PM domains Ulf Hansson
2018-05-30 16:06 ` Jon Hunter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox