All of lore.kernel.org
 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 13:45:42 +0200	[thread overview]
Message-ID: <CAPDyKFrbpm0W1Hdv+85MqMAC2-UbPOE6qp26L0UvVF0sSL2ayA@mail.gmail.com> (raw)
In-Reply-To: <20230608104540.tykxtvwhoyogthw5@vireshk-i7>

On Thu, 8 Jun 2023 at 12:45, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 08-06-23, 11:37, Ulf Hansson wrote:
> > 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?
>
> What we need here, in you case, is really the required-opp thing, without the
> DT parsing. The genpd will have an OPP table here, and devices (you are adding
> OPP table dynamically for) shall have the genpd's OPPs as their required OPPs,
> since for setting OPPs of the device, it is *required* to have OPP of the genpd
> set too. Just like how it happens with DT. No special handling will be required
> in dev_pm_opp_set_opp() path in this case and existing code will just work. You
> just need to set the required-opp tables properly.

Okay, if I understand your point you want to avoid creating OPPs for
each device, but rather coupling them with the genpd provider's OPP
table. Right?

Note that, there is no such thing as a "required opp" in the SCMI
performance protocol case. A device is compatible to use all of the
OPPs that its corresponding SCMI performance domain provides. Should
we rename the required opp things in the OPP core to better reflect
this too?

That said, we still need to be able to add OPPs dynamically when not
based on DT. The difference would be that we add the OPPs when
initializing the genpd provider instead of when attaching the devices.
In other words, we still need something along the lines of the new
dev_pm_opp_add_dynamic() API that $subject series is introducing, I
think.

Moreover, to tie the consumer device's OPP table to their genpd
provider's OPP table (call it required-opp or whatever), we need
another OPP helper function that we can call from the genpd provider's
->attach_dev() callback. Similarly, we need to be able to remove this
connection when genpd's ->detach_dev() callback is invoked. I will
think of something here.

Finally, I want to point out that there is work going on in parallel
with this, that is adding performance state support for the ACPI PM
domain. The ACPI PM domain, isn't a genpd provider but implements it's
own PM domain. The important point is, that it will have its own
variant of the dev_pm_genpd_set_performance_state() that we may need
to call from the OPP library.

Kind regards
Uffe

WARNING: multiple messages have this Message-ID (diff)
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 13:45:42 +0200	[thread overview]
Message-ID: <CAPDyKFrbpm0W1Hdv+85MqMAC2-UbPOE6qp26L0UvVF0sSL2ayA@mail.gmail.com> (raw)
In-Reply-To: <20230608104540.tykxtvwhoyogthw5@vireshk-i7>

On Thu, 8 Jun 2023 at 12:45, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 08-06-23, 11:37, Ulf Hansson wrote:
> > 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?
>
> What we need here, in you case, is really the required-opp thing, without the
> DT parsing. The genpd will have an OPP table here, and devices (you are adding
> OPP table dynamically for) shall have the genpd's OPPs as their required OPPs,
> since for setting OPPs of the device, it is *required* to have OPP of the genpd
> set too. Just like how it happens with DT. No special handling will be required
> in dev_pm_opp_set_opp() path in this case and existing code will just work. You
> just need to set the required-opp tables properly.

Okay, if I understand your point you want to avoid creating OPPs for
each device, but rather coupling them with the genpd provider's OPP
table. Right?

Note that, there is no such thing as a "required opp" in the SCMI
performance protocol case. A device is compatible to use all of the
OPPs that its corresponding SCMI performance domain provides. Should
we rename the required opp things in the OPP core to better reflect
this too?

That said, we still need to be able to add OPPs dynamically when not
based on DT. The difference would be that we add the OPPs when
initializing the genpd provider instead of when attaching the devices.
In other words, we still need something along the lines of the new
dev_pm_opp_add_dynamic() API that $subject series is introducing, I
think.

Moreover, to tie the consumer device's OPP table to their genpd
provider's OPP table (call it required-opp or whatever), we need
another OPP helper function that we can call from the genpd provider's
->attach_dev() callback. Similarly, we need to be able to remove this
connection when genpd's ->detach_dev() callback is invoked. I will
think of something here.

Finally, I want to point out that there is work going on in parallel
with this, that is adding performance state support for the ACPI PM
domain. The ACPI PM domain, isn't a genpd provider but implements it's
own PM domain. The important point is, that it will have its own
variant of the dev_pm_genpd_set_performance_state() that we may need
to call from the OPP library.

Kind regards
Uffe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-06-08 11:47 UTC|newest]

Thread overview: 74+ 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 ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` 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   ` Ulf Hansson
2023-06-07 12:46 ` [PATCH 09/16] dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13 Ulf Hansson
2023-06-07 12:46   ` Ulf Hansson
2023-06-14 23:00   ` Rob Herring
2023-06-14 23:00     ` Rob Herring
2023-06-15  9:10     ` Ulf Hansson
2023-06-15  9:10       ` Ulf Hansson
2023-07-14 17:14       ` Rob Herring
2023-07-14 17:14         ` Rob Herring
2023-07-15 12:35         ` Ulf Hansson
2023-07-15 12:35           ` Ulf Hansson
2023-06-15  8:44   ` Sudeep Holla
2023-06-15  8:44     ` Sudeep Holla
2023-06-15  9:39     ` Ulf Hansson
2023-06-15  9:39       ` Ulf Hansson
2023-06-15 13:30       ` Sudeep Holla
2023-06-15 13:30         ` Sudeep Holla
2023-06-16 11:48         ` Ulf Hansson
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   ` 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-07 12:46   ` Ulf Hansson
2023-06-08  5:29   ` Viresh Kumar
2023-06-08  5:29     ` Viresh Kumar
2023-06-08  8:59     ` Ulf Hansson
2023-06-08  8:59       ` Ulf Hansson
2023-06-08  9:22       ` Viresh Kumar
2023-06-08  9:22         ` Viresh Kumar
2023-06-08  9:40         ` Ulf Hansson
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   ` Ulf Hansson
2023-06-07 12:46 ` [PATCH 13/16] OPP: Extend dev_pm_opp_data with OPP provider support Ulf Hansson
2023-06-07 12:46   ` Ulf Hansson
2023-06-08  5:34   ` Viresh Kumar
2023-06-08  5:34     ` Viresh Kumar
2023-06-08  9:37     ` Ulf Hansson
2023-06-08  9:37       ` Ulf Hansson
2023-06-08 10:45       ` Viresh Kumar
2023-06-08 10:45         ` Viresh Kumar
2023-06-08 11:45         ` Ulf Hansson [this message]
2023-06-08 11:45           ` Ulf Hansson
2023-06-09  5:10           ` Viresh Kumar
2023-06-09  5:10             ` Viresh Kumar
2023-06-09 10:59             ` Ulf Hansson
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   ` 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   ` 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 12:46   ` Ulf Hansson
2023-06-07 14:43 ` [PATCH 00/16] arm_scmi/opp/dvfs: Add generic performance scaling support Cristian Marussi
2023-06-07 14:43   ` Cristian Marussi
2023-06-08  9:53   ` Ulf Hansson
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=CAPDyKFrbpm0W1Hdv+85MqMAC2-UbPOE6qp26L0UvVF0sSL2ayA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.