lkml.org 
[lkml]   [2021]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] PM: domains: not update genpd status when power on fail
On Tue, 6 Jul 2021 at 11:31, <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> When _genpd_power_on fail, the generic power domain status
> should not be changed to GENPD_STATE_ON.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/base/power/domain.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index ab0b740cc0f1..754a5d384479 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -1101,6 +1101,7 @@ static void genpd_sync_power_on(struct generic_pm_domain *genpd, bool use_lock,
> unsigned int depth)
> {
> struct gpd_link *link;
> + int ret;
>
> if (genpd_status_on(genpd))
> return;
> @@ -1117,8 +1118,9 @@ static void genpd_sync_power_on(struct generic_pm_domain *genpd, bool use_lock,
> genpd_unlock(link->parent);
> }
>
> - _genpd_power_on(genpd, false);
> - genpd->status = GENPD_STATE_ON;
> + ret = _genpd_power_on(genpd, false);
> + if (!ret)

To support this error path, a lot more code needs to be added. Just
have a look at the callers of genpd_sync_power_on() and compare it
with genpd_power_on().

In my opinion, supporting this error path isn't really worth it, at
least until someone comes with a valid use case. Do you have one - or
did you send the $subject patch based solely on code inspection?

> + genpd->status = GENPD_STATE_ON;
> }
>
> /**
> --
> 2.30.0
>

Kind regards
Uffe

\
 
 \ /
  Last update: 2021-07-06 11:47    [W:0.054 / U:1.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site