linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH 2/2] clk: qcom: fix domains cleanup in gdsc_unregister
Date: Tue, 29 Jun 2021 15:34:37 -0700	[thread overview]
Message-ID: <162500607734.3331010.12498813187207407633@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20210629203919.2956918-2-dmitry.baryshkov@linaro.org>

Quoting Dmitry Baryshkov (2021-06-29 13:39:19)
> Properly remove registered genpds. Also remove the provider before
> breaking parent/child links, so that the system is consistent at remove
> time.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/clk/qcom/gdsc.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index 241186d9d08c..4b211dd1764d 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -475,6 +475,9 @@ void gdsc_unregister(struct gdsc_desc *desc)
>         struct gdsc **scs = desc->scs;
>         size_t num = desc->num;
>  
> +       /* Remove provider first */

but why? A better comment would be

	/*
	 * Remove provider first so that we can remove the genpds
	 * without worrying about consumers getting them during the
	 * removal process.
	 */

> +       of_genpd_del_provider(dev->of_node);
> +
>         /* Remove subdomains */
>         for (i = 0; i < num; i++) {
>                 if (!scs[i])
> @@ -482,7 +485,13 @@ void gdsc_unregister(struct gdsc_desc *desc)
>                 if (scs[i]->parent)
>                         pm_genpd_remove_subdomain(scs[i]->parent, &scs[i]->pd);
>         }
> -       of_genpd_del_provider(dev->of_node);
> +
> +       /* Remove domains themselves */
> +       for (i = 0; i < num; i++) {
> +               if (!scs[i])
> +                       continue;
> +               pm_genpd_remove(&scs[i]->pd);
> +       }
>  }

  reply	other threads:[~2021-06-29 22:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 20:39 [PATCH 1/2] clk: qcom: fix error_path in gdsc_register Dmitry Baryshkov
2021-06-29 20:39 ` [PATCH 2/2] clk: qcom: fix domains cleanup in gdsc_unregister Dmitry Baryshkov
2021-06-29 22:34   ` Stephen Boyd [this message]
2021-06-29 22:32 ` [PATCH 1/2] clk: qcom: fix error_path in gdsc_register Stephen Boyd

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=162500607734.3331010.12498813187207407633@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    /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 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).