From: Bjorn Andersson <andersson@kernel.org>
To: Abel Vesa <abel.vesa@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>, Pavel Machek <pavel@ucw.cz>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Gross <agross@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Mike Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Saravana Kannan <saravanak@google.com>,
linux-pm@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
Doug Anderson <dianders@chromium.org>,
Matthias Kaehlcke <mka@chromium.org>
Subject: Re: [PATCH v3 2/4] soc: qcom: rpmhpd: Do proper power off when state synced
Date: Mon, 10 Apr 2023 20:06:30 -0700 [thread overview]
Message-ID: <20230411030630.z5nl5ynjl6wzp3bh@ripper> (raw)
In-Reply-To: <20230327193829.3756640-3-abel.vesa@linaro.org>
On Mon, Mar 27, 2023 at 10:38:27PM +0300, Abel Vesa wrote:
> Instead of aggregating different corner values on sync state callback,
> call the genpd API for queuing up the power off. This will also mark the
> domain as powered off in the debugfs genpd summary. Also, until sync
> state has been reached, return busy on power off request, in order to
> allow genpd core to know that the actual domain hasn't been powered of
> from the "disable unused" late initcall.
>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> drivers/soc/qcom/rpmhpd.c | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
> index f20e2a49a669..ec7926820772 100644
> --- a/drivers/soc/qcom/rpmhpd.c
> +++ b/drivers/soc/qcom/rpmhpd.c
> @@ -649,8 +649,12 @@ static int rpmhpd_power_off(struct generic_pm_domain *domain)
> mutex_lock(&rpmhpd_lock);
>
> ret = rpmhpd_aggregate_corner(pd, 0);
> - if (!ret)
> - pd->enabled = false;
> + if (!ret) {
> + if (!pd->state_synced)
> + ret = -EBUSY;
> + else
> + pd->enabled = false;
> + }
>
> mutex_unlock(&rpmhpd_lock);
>
> @@ -810,10 +814,8 @@ static void rpmhpd_sync_state(struct device *dev)
> {
> const struct rpmhpd_desc *desc = of_device_get_match_data(dev);
> struct rpmhpd **rpmhpds = desc->rpmhpds;
> - unsigned int corner;
> struct rpmhpd *pd;
> unsigned int i;
> - int ret;
>
> mutex_lock(&rpmhpd_lock);
> for (i = 0; i < desc->num_pds; i++) {
> @@ -822,14 +824,7 @@ static void rpmhpd_sync_state(struct device *dev)
> continue;
>
> pd->state_synced = true;
> - if (pd->enabled)
> - corner = max(pd->corner, pd->enable_corner);
Note that the intent of this line is to lower the corner from max to
either a requested performance_state or the lowest non-disabled corner.
I don't think your solution maintains this behavior?
> - else
> - corner = 0;
> -
> - ret = rpmhpd_aggregate_corner(pd, corner);
> - if (ret)
> - dev_err(dev, "failed to sync %s\n", pd->res_name);
> + pm_genpd_queue_power_off(&pd->pd);
In the event that the power-domain has a single device attached, and no
subdomains, wouldn't pm_genpd_queue_power_off() pass straight through
all checks and turn off the power domain? Perhaps I'm just missing
something?
Regards,
Bjorn
> }
> mutex_unlock(&rpmhpd_lock);
> }
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-04-11 3:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 19:38 [PATCH v3 0/4] Allow genpd providers to power off domains on sync state Abel Vesa
2023-03-27 19:38 ` [PATCH v3 1/4] PM: domains: Allow power off queuing from providers Abel Vesa
2023-03-27 19:38 ` [PATCH v3 2/4] soc: qcom: rpmhpd: Do proper power off when state synced Abel Vesa
2023-04-11 3:06 ` Bjorn Andersson [this message]
2023-03-27 19:38 ` [PATCH v3 3/4] clk: qcom: gdsc: Avoid actual power off until sync state Abel Vesa
2023-03-27 19:38 ` [PATCH v3 4/4] clk: qcom: Add sync state callback to all providers Abel Vesa
2023-03-28 0:17 ` [PATCH v3 0/4] Allow genpd providers to power off domains on sync state Saravana Kannan
2023-03-30 11:27 ` Abel Vesa
2023-03-30 19:50 ` Saravana Kannan
2023-03-31 4:59 ` Abel Vesa
2023-04-05 14:11 ` Ulf Hansson
2023-04-06 9:26 ` Abel Vesa
2023-04-06 10:59 ` 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=20230411030630.z5nl5ynjl6wzp3bh@ripper \
--to=andersson@kernel.org \
--cc=abel.vesa@linaro.org \
--cc=agross@kernel.org \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=len.brown@intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mka@chromium.org \
--cc=mturquette@baylibre.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=saravanak@google.com \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@linaro.org \
/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
all inboxes | Powered by JetHome®