linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Cristian Marussi <cristian.marussi@arm.com>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>, Nikunj Kela <nkela@quicinc.com>,
	Prasad Sodagudi <psodagud@quicinc.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 13/16] OPP: Extend dev_pm_opp_data with OPP provider support
Date: Thu, 8 Jun 2023 11:37:06 +0200	[thread overview]
Message-ID: <CAPDyKFqUWhdmctKRpQoqwZ2nsx_P2FiWvLzfm_d39QdECWoytA@mail.gmail.com> (raw)
In-Reply-To: <20230608053446.ngoxh7zo7drnr32z@vireshk-i7>

On Thu, 8 Jun 2023 at 07:34, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 07-06-23, 14:46, Ulf Hansson wrote:
> > diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> > index 79b4b44ced3e..81a3418e2eaf 100644
> > --- a/drivers/opp/core.c
> > +++ b/drivers/opp/core.c
> > @@ -1112,6 +1112,15 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table,
> >                       return ret;
> >               }
> >
> > +             if (opp->provider == DEV_PM_OPP_TYPE_GENPD) {
> > +                     ret = dev_pm_genpd_set_performance_state(dev, opp->level);
> > +                     if (ret) {
> > +                             dev_err(dev, "Failed to set performance level: %d\n",
> > +                                     ret);
> > +                             return ret;
> > +                     }
> > +             }
> > +
>
> I don't like this :)
>
> We already have these calls in place from within _set_required_opps(), and we
> should try to get this done in a way that those calls themselves get the
> performance state configured.

I was looking at that, but wanted to keep things as simple as possible
in the $subject series.

The required opps are also different, as it's getting parsed from DT
both for the genpd provider and the consumer. The point is, there are
more code involved but just _set_required_opps().

For example, _set_performance_state() (which is the one that calls
dev_pm_genpd_set_performance_state()) is designed to be used for
required opps. Does it really make sense to rework
_set_performance_state() so it can be used for this case too, just to
avoid another call to dev_pm_genpd_set_performance_state() somewhere
in the code?

One improvement we can make though, is to add a helper function,
"_set_opp_level()", which we call from _set_opp(). This can then
replace the call to _set_required_opps() and the code above that I am
adding for DEV_PM_OPP_TYPE_GENPD. At least that should keep the code
_set_opp() a bit more readable.

What do you think?

Kind regards
Uffe

  reply	other threads:[~2023-06-08  9:37 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 12:46 [PATCH 00/16] arm_scmi/opp/dvfs: Add generic performance scaling support Ulf Hansson
2023-06-07 12:46 ` [PATCH 01/16] firmware: arm_scmi: Extend perf protocol ops to get number of domains Ulf Hansson
2023-06-07 12:46 ` [PATCH 02/16] firmware: arm_scmi: Extend perf protocol ops to get the name of a domain Ulf Hansson
2023-06-07 12:46 ` [PATCH 03/16] firmware: arm_scmi: Extend perf protocol ops to inform of set level support Ulf Hansson
2023-06-07 12:46 ` [PATCH 04/16] cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq Ulf Hansson
2023-06-07 12:46 ` [PATCH 05/16] firmware: arm_scmi: Align perf ops to use domain-id as in-parameter Ulf Hansson
2023-06-07 12:46 ` [PATCH 06/16] firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops Ulf Hansson
2023-06-07 12:46 ` [PATCH 07/16] cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus() Ulf Hansson
2023-06-07 12:46 ` [PATCH 08/16] PM: domains: Allow genpd providers to manage OPP tables directly by its FW Ulf Hansson
2023-06-07 12:46 ` [PATCH 09/16] dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13 Ulf Hansson
2023-06-14 23:00   ` Rob Herring
2023-06-15  9:10     ` Ulf Hansson
2023-07-14 17:14       ` Rob Herring
2023-07-15 12:35         ` Ulf Hansson
2023-06-15  8:44   ` Sudeep Holla
2023-06-15  9:39     ` Ulf Hansson
2023-06-15 13:30       ` Sudeep Holla
2023-06-16 11:48         ` Ulf Hansson
2023-06-07 12:46 ` [PATCH 10/16] firmware: arm_scmi: Add the SCMI performance domain Ulf Hansson
2023-06-07 12:46 ` [PATCH 11/16] OPP: Add dev_pm_opp_add_dynamic() to allow more flexibility Ulf Hansson
2023-06-08  5:29   ` Viresh Kumar
2023-06-08  8:59     ` Ulf Hansson
2023-06-08  9:22       ` Viresh Kumar
2023-06-08  9:40         ` Ulf Hansson
2023-06-07 12:46 ` [PATCH 12/16] OPP: Extend dev_pm_opp_data with performance level Ulf Hansson
2023-06-07 12:46 ` [PATCH 13/16] OPP: Extend dev_pm_opp_data with OPP provider support Ulf Hansson
2023-06-08  5:34   ` Viresh Kumar
2023-06-08  9:37     ` Ulf Hansson [this message]
2023-06-08 10:45       ` Viresh Kumar
2023-06-08 11:45         ` Ulf Hansson
2023-06-09  5:10           ` Viresh Kumar
2023-06-09 10:59             ` Ulf Hansson
2023-06-07 12:46 ` [PATCH 14/16] firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() Ulf Hansson
2023-06-07 12:46 ` [PATCH 15/16] firmware: arm_scmi: Extend perf support with OPP from genpd providers Ulf Hansson
2023-06-07 12:46 ` [PATCH 16/16] firmware: arm_scmi: Add generic OPP support to the SCMI performance domain Ulf Hansson
2023-06-07 14:43 ` [PATCH 00/16] arm_scmi/opp/dvfs: Add generic performance scaling support Cristian Marussi
2023-06-08  9:53   ` 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=CAPDyKFqUWhdmctKRpQoqwZ2nsx_P2FiWvLzfm_d39QdECWoytA@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nkela@quicinc.com \
    --cc=nm@ti.com \
    --cc=psodagud@quicinc.com \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@arm.com \
    --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).