From: Viresh Kumar <viresh.kumar@linaro.org>
To: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Cc: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] OPP: Call dev_pm_opp_set_opp() for required OPPs
Date: Wed, 25 Oct 2023 13:06:34 +0530 [thread overview]
Message-ID: <20231025073634.4et5epfog25o2pxf@vireshk-i7> (raw)
In-Reply-To: <ZTeoGiMQZ-OoYJBG@kernkonzept.com>
Thanks a lot for taking this up, really appreciate it Stephan.
On 24-10-23, 13:18, Stephan Gerhold wrote:
> Unfortunately this patch breaks scaling the performance state of the
> virtual genpd devices completely. As far as I can tell it just keeps
> setting level = 0 for every OPP switch (this is on MSM8909 with [1],
> a single "perf" power domain attached to the CPU):
>
> [ 457.252255] cpu cpu0: _set_opp: switching OPP: Freq 998400000 -> 799999804 Hz, Level 0 -> 0, Bw 3200000 -> 1600000
> [ 457.253739] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 998400000 -> 799999804 Hz, Level 0 -> 0, Bw 3200000 -> 1600000
The thing I was more worried about worked fine it seems (recursively calling
dev_pm_opp_set_opp() i.e.).
> [ 457.304581] cpu cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000
> [ 457.306091] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000
> [ 457.323489] cpu cpu0: _set_opp: switching OPP: Freq 533333202 -> 399999902 Hz, Level 0 -> 0, Bw 1600000 -> 800000
> [ 457.352792] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 533333202 -> 399999902 Hz, Level 0 -> 0, Bw 1600000 -> 800000
> [ 457.353056] cpu cpu0: _set_opp: switching OPP: Freq 399999902 -> 199999951 Hz, Level 0 -> 0, Bw 800000 -> 800000
> [ 457.355285] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 399999902 -> 199999951 Hz, Level 0 -> 0, Bw 800000 -> 800000
>
> Where do you handle setting the pstate specified in the "required-opps"
> of the OPP table with this patch? I've looked at your changes for some
> time but must admit I haven't really understood how it is supposed to
> work. :-)
Thanks for the debug print, they helped me find the issue.
> [ 457.304581] cpu cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000
> [ 457.306091] genpd genpd:1:cpu0: _set_opp: switching OPP: Freq 799999804 -> 533333202 Hz, Level 0 -> 0, Bw 1600000 -> 1600000
The second line shouldn't have had freq/bw/etc, but just level. Hopefully this
will fix it. Pushed to my branch too. Thanks. Please try again.
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 056b51abc501..cb2b353129c6 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1070,7 +1070,7 @@ static int _set_required_opps(struct device *dev, struct opp_table *opp_table,
while (index != target) {
if (devs[index]) {
- ret = dev_pm_opp_set_opp(devs[index], opp);
+ ret = dev_pm_opp_set_opp(devs[index], opp->required_opps[index]);
if (ret)
return ret;
}
--
viresh
next prev parent reply other threads:[~2023-10-25 7:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 10:21 [RFT PATCH 0/2] OPP: Simplify required-opp handling Viresh Kumar
2023-10-19 10:22 ` [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case Viresh Kumar
2023-10-19 11:16 ` Ulf Hansson
2023-10-20 3:45 ` Viresh Kumar
2023-10-20 10:02 ` Ulf Hansson
2023-10-20 10:56 ` Viresh Kumar
2023-10-20 11:09 ` Ulf Hansson
2023-10-25 6:54 ` Viresh Kumar
2023-10-25 10:40 ` Ulf Hansson
2023-10-25 10:48 ` Viresh Kumar
2023-10-25 13:47 ` Stephan Gerhold
2023-10-25 15:24 ` Viresh Kumar
2023-10-25 16:16 ` Stephan Gerhold
2023-10-26 9:53 ` Ulf Hansson
2023-10-30 10:29 ` Viresh Kumar
2023-11-03 11:58 ` Ulf Hansson
2023-11-06 7:08 ` Viresh Kumar
2023-11-10 13:50 ` Ulf Hansson
2023-11-15 5:32 ` Viresh Kumar
2023-11-16 10:44 ` Viresh Kumar
2023-10-19 10:22 ` [PATCH 2/2] OPP: Call dev_pm_opp_set_opp() for required OPPs Viresh Kumar
2023-10-24 11:18 ` Stephan Gerhold
2023-10-25 7:36 ` Viresh Kumar [this message]
2023-10-25 12:17 ` Stephan Gerhold
2023-10-25 15:20 ` Viresh Kumar
2023-10-25 16:03 ` Ulf Hansson
2023-10-26 7:44 ` Viresh Kumar
2023-10-25 13:51 ` Ulf Hansson
2023-10-25 15:09 ` Viresh Kumar
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=20231025073634.4et5epfog25o2pxf@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=nm@ti.com \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.org \
--cc=stephan.gerhold@kernkonzept.com \
--cc=ulf.hansson@linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=vireshk@kernel.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;
as well as URLs for NNTP newsgroup(s).