From: Bjorn Andersson <andersson@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-pm@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] OPP: pstate is only valid for genpd OPP tables
Date: Thu, 15 Jun 2023 18:35:53 -0500 [thread overview]
Message-ID: <lmdbpkttrawedkozfo5exh27jlj3hisulnk4zj6s2mv66yzr6n@zegr4pdzz3pn> (raw)
In-Reply-To: <5437756c65c79f9520886bc54321d39c022c8638.1686739018.git.viresh.kumar@linaro.org>
On Wed, Jun 14, 2023 at 04:07:25PM +0530, Viresh Kumar wrote:
> It is not very clear right now that the `pstate` field is only valid for
> genpd OPP tables and not consumer tables. And there is no checking for
> the same at various places.
>
> Add checks in place to verify that and make it clear to the reader.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/opp/core.c | 18 ++++++++++++++++--
> drivers/opp/debugfs.c | 4 +++-
> drivers/opp/of.c | 6 ++++++
> 3 files changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
[..]
> @@ -2686,6 +2694,12 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table,
> int dest_pstate = -EINVAL;
> int i;
>
> + /* Both OPP tables must belong to genpds */
> + if (unlikely(!src_table->is_genpd || !dst_table->is_genpd)) {
I have a platform_device, with a required-opps and with an associated
genpd which does not implement set_performance_state(), but its parent
genpd does.
This results in me arriving here with src_table of NULL, and boom...
Looking at the very next statement in this function, it seems arriving
here without src_table was valid up until this change.
Regards,
Bjorn
next prev parent reply other threads:[~2023-06-15 23:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 10:37 [PATCH 1/2] OPP: pstate is only valid for genpd OPP tables Viresh Kumar
2023-06-14 10:37 ` [PATCH 2/2] OPP: Simplify the over-designed pstate <-> level dance Viresh Kumar
2023-06-14 12:37 ` Ulf Hansson
2023-06-16 6:20 ` Viresh Kumar
2023-06-14 12:33 ` [PATCH 1/2] OPP: pstate is only valid for genpd OPP tables Ulf Hansson
2023-06-15 23:35 ` Bjorn Andersson [this message]
2023-06-16 6:18 ` Viresh Kumar
2023-06-16 14:31 ` Bjorn Andersson
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=lmdbpkttrawedkozfo5exh27jlj3hisulnk4zj6s2mv66yzr6n@zegr4pdzz3pn \
--to=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=nm@ti.com \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@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).