All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Kevin Hilman <khilman@kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Len Brown <len.brown@intel.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH] PM: domains: not update genpd status when power on fail
Date: Tue, 6 Jul 2021 11:44:32 +0200	[thread overview]
Message-ID: <CAPDyKFo-r0b1+wwoAyi8VRQpeAbXaxnDeFXGrjZV-zaqWZ7ojQ@mail.gmail.com> (raw)
In-Reply-To: <20210706100519.13851-1-peng.fan@oss.nxp.com>

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

  reply	other threads:[~2021-07-06  9:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 10:05 [PATCH] PM: domains: not update genpd status when power on fail peng.fan
2021-07-06  9:44 ` Ulf Hansson [this message]
2021-07-06  9:52   ` Peng Fan (OSS)
2021-07-07  9:50     ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFo-r0b1+wwoAyi8VRQpeAbXaxnDeFXGrjZV-zaqWZ7ojQ@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=khilman@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.