* [PATCH] PM: domains: Fix domain attach for CONFIG_PM_OPP=n
@ 2021-08-24 15:23 Geert Uytterhoeven
2021-08-27 7:53 ` Niklas Söderlund
2021-08-27 13:23 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2021-08-24 15:23 UTC (permalink / raw)
To: Rajendra Nayak, Rafael J . Wysocki, Kevin Hilman, Ulf Hansson
Cc: Len Brown, Pavel Machek, Greg Kroah-Hartman, linux-pm,
linux-renesas-soc, linux-kernel, Geert Uytterhoeven
If CONFIG_PM_OPP=n, of_get_required_opp_performance_state() always
returns -EOPNOTSUPP, and all drivers for devices that are part of a PM
Domain fail to probe with:
failed to set required performance state for power-domain foo: -95
probe of bar failed with error -95
Fix this by treating -EOPNOTSUPP the same as -ENODEV.
Fixes: c016baf7dc58e77a ("PM: domains: Add support for 'required-opps' to set default perf state")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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 a10d740c4f2a1c28..7b197690e6442911 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2760,7 +2760,7 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
/* Set the default performance state */
pstate = of_get_required_opp_performance_state(dev->of_node, index);
- if (pstate < 0 && pstate != -ENODEV) {
+ if (pstate < 0 && pstate != -ENODEV && pstate != -EOPNOTSUPP) {
ret = pstate;
goto err;
} else if (pstate > 0) {
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PM: domains: Fix domain attach for CONFIG_PM_OPP=n
2021-08-24 15:23 [PATCH] PM: domains: Fix domain attach for CONFIG_PM_OPP=n Geert Uytterhoeven
@ 2021-08-27 7:53 ` Niklas Söderlund
2021-08-27 13:23 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2021-08-27 7:53 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rajendra Nayak, Rafael J . Wysocki, Kevin Hilman, Ulf Hansson,
Len Brown, Pavel Machek, Greg Kroah-Hartman, linux-pm,
linux-renesas-soc, linux-kernel
Hi Geert,
Thanks for your work.
On 2021-08-24 17:23:38 +0200, Geert Uytterhoeven wrote:
> If CONFIG_PM_OPP=n, of_get_required_opp_performance_state() always
> returns -EOPNOTSUPP, and all drivers for devices that are part of a PM
> Domain fail to probe with:
>
> failed to set required performance state for power-domain foo: -95
> probe of bar failed with error -95
>
> Fix this by treating -EOPNOTSUPP the same as -ENODEV.
>
> Fixes: c016baf7dc58e77a ("PM: domains: Add support for 'required-opps' to set default perf state")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> 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 a10d740c4f2a1c28..7b197690e6442911 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2760,7 +2760,7 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
>
> /* Set the default performance state */
> pstate = of_get_required_opp_performance_state(dev->of_node, index);
> - if (pstate < 0 && pstate != -ENODEV) {
> + if (pstate < 0 && pstate != -ENODEV && pstate != -EOPNOTSUPP) {
> ret = pstate;
> goto err;
> } else if (pstate > 0) {
> --
> 2.25.1
>
--
Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PM: domains: Fix domain attach for CONFIG_PM_OPP=n
2021-08-24 15:23 [PATCH] PM: domains: Fix domain attach for CONFIG_PM_OPP=n Geert Uytterhoeven
2021-08-27 7:53 ` Niklas Söderlund
@ 2021-08-27 13:23 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2021-08-27 13:23 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rajendra Nayak, Rafael J . Wysocki, Kevin Hilman, Len Brown,
Pavel Machek, Greg Kroah-Hartman, Linux PM, Linux-Renesas,
Linux Kernel Mailing List
On Tue, 24 Aug 2021 at 17:23, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> If CONFIG_PM_OPP=n, of_get_required_opp_performance_state() always
> returns -EOPNOTSUPP, and all drivers for devices that are part of a PM
> Domain fail to probe with:
>
> failed to set required performance state for power-domain foo: -95
> probe of bar failed with error -95
>
> Fix this by treating -EOPNOTSUPP the same as -ENODEV.
>
> Fixes: c016baf7dc58e77a ("PM: domains: Add support for 'required-opps' to set default perf state")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> 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 a10d740c4f2a1c28..7b197690e6442911 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -2760,7 +2760,7 @@ static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
>
> /* Set the default performance state */
> pstate = of_get_required_opp_performance_state(dev->of_node, index);
> - if (pstate < 0 && pstate != -ENODEV) {
> + if (pstate < 0 && pstate != -ENODEV && pstate != -EOPNOTSUPP) {
> ret = pstate;
> goto err;
> } else if (pstate > 0) {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-27 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 15:23 [PATCH] PM: domains: Fix domain attach for CONFIG_PM_OPP=n Geert Uytterhoeven
2021-08-27 7:53 ` Niklas Söderlund
2021-08-27 13:23 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).