* [PATCH v3 1/2] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing [not found] <0002-cpuidle-psci-Split-psci_dt_cpu_init_idle.patch> @ 2020-03-10 10:40 ` Ulf Hansson 2020-03-14 11:05 ` Rafael J. Wysocki 0 siblings, 1 reply; 2+ messages in thread From: Ulf Hansson @ 2020-03-10 10:40 UTC (permalink / raw) To: Sudeep Holla, Lorenzo Pieralisi, linux-pm Cc: Ulf Hansson, Benjamin Gaignard, Stephen Boyd, Daniel Lezcano, Rafael J . Wysocki, Lina Iyer, Bjorn Andersson, stable, linux-arm-kernel Commit 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error"), moved of_genpd_parse_idle_states() towards allowing none compatible idle state to be found for the device node, rather than returning an error code. However, it didn't consider that the "domain-idle-states" DT property may be missing as it's optional, which makes of_count_phandle_with_args() to return -ENOENT. Let's fix this to make the behaviour consistent. Reported-by: Benjamin Gaignard <benjamin.gaignard@st.com> Fixes: 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error") Cc: <stable@vger.kernel.org> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- Changes in v3: - Resending with reviewed-tags added. --- drivers/base/power/domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 959d6d5eb000..0a01df608849 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2653,7 +2653,7 @@ static int genpd_iterate_idle_states(struct device_node *dn, ret = of_count_phandle_with_args(dn, "domain-idle-states", NULL); if (ret <= 0) - return ret; + return ret == -ENOENT ? 0 : ret; /* Loop over the phandles until all the requested entry is found */ of_for_each_phandle(&it, ret, dn, "domain-idle-states", NULL, 0) { -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3 1/2] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing 2020-03-10 10:40 ` [PATCH v3 1/2] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing Ulf Hansson @ 2020-03-14 11:05 ` Rafael J. Wysocki 0 siblings, 0 replies; 2+ messages in thread From: Rafael J. Wysocki @ 2020-03-14 11:05 UTC (permalink / raw) To: Ulf Hansson Cc: Lorenzo Pieralisi, Benjamin Gaignard, linux-pm, Stephen Boyd, Daniel Lezcano, Lina Iyer, Bjorn Andersson, stable, Sudeep Holla, linux-arm-kernel On Tuesday, March 10, 2020 11:40:23 AM CET Ulf Hansson wrote: > Commit 2c361684803e ("PM / Domains: Don't treat zero found compatible idle > states as an error"), moved of_genpd_parse_idle_states() towards allowing > none compatible idle state to be found for the device node, rather than > returning an error code. > > However, it didn't consider that the "domain-idle-states" DT property may > be missing as it's optional, which makes of_count_phandle_with_args() to > return -ENOENT. Let's fix this to make the behaviour consistent. > > Reported-by: Benjamin Gaignard <benjamin.gaignard@st.com> > Fixes: 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error") > Cc: <stable@vger.kernel.org> > Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> > --- > > Changes in v3: > - Resending with reviewed-tags added. > > --- > drivers/base/power/domain.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index 959d6d5eb000..0a01df608849 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -2653,7 +2653,7 @@ static int genpd_iterate_idle_states(struct device_node *dn, > > ret = of_count_phandle_with_args(dn, "domain-idle-states", NULL); > if (ret <= 0) > - return ret; > + return ret == -ENOENT ? 0 : ret; > > /* Loop over the phandles until all the requested entry is found */ > of_for_each_phandle(&it, ret, dn, "domain-idle-states", NULL, 0) { > Applied as 5.7 material along with the [2/2], thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-14 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <0002-cpuidle-psci-Split-psci_dt_cpu_init_idle.patch>
2020-03-10 10:40 ` [PATCH v3 1/2] PM / Domains: Allow no domain-idle-states DT property in genpd when parsing Ulf Hansson
2020-03-14 11:05 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox