mbox series

[v3,00/13] arm_scmi/cpufreq: Add generic performance scaling support

Message ID 20230825112633.236607-1-ulf.hansson@linaro.org (mailing list archive)
Headers show
Series arm_scmi/cpufreq: Add generic performance scaling support | expand

Message

Ulf Hansson Aug. 25, 2023, 11:26 a.m. UTC
Changes in v3:
	- Re-based upon the for-next/scmi/updates branch.
	- Re-ordered some of the patches in the series, to eas review.
	- Added some new DT doc patches in the series, according to comments.
	- Fixed other comments, see version history for each patch.

Changes in v2:
	- Split up the series, to get the basic support in place as the first
	step. The part that remains is the integration with the OPP library, to
	allow consumer drivers to change performance level using the OPP lib.
	- Re-based on top v6.5-rc1.
	- Other changes will be described for each patch.

The current SCMI performance scaling support is limited to cpufreq. This series
extends the support, so it can be used for all kind of devices and not only for
CPUs.

The changes are spread over a couple of different subsystems, although the
changes that affects the other subsystems than the arm_scmi directory are
mostly smaller, except for last patch which is in the new genpd directory.

The series is based upon the for-next/scmi/updates branch, but to enable the
genpd provider in patch 13 (the actual scmi performance domain driver) to be
placed in the new genpd directory, I have also merged an immutable branch [1],
which is queued for v6.6.

Note that, I am runing this on the Qemu virt platform with Optee running an SCMI
server. If you want some more details about my test setup, I can share this with
you, just let me know.

Looking forward to your feedback!

Kind regards
Ulf Hansson

[1]
git.kernel.org/pub/scm/linux/kernel/git/people/ulf.hansson/linux-pm.git genpd_create_dir


Ulf Hansson (13):
  firmware: arm_scmi: Extend perf protocol ops to get number of domains
  firmware: arm_scmi: Extend perf protocol ops to get information of a
    domain
  cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq
  firmware: arm_scmi: Align perf ops to use domain-id as in-parameter
  firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops
  cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus()
  cpufreq: scmi: Drop redundant ifdef in scmi_cpufreq_probe()
  dt-bindings: arm: cpus: Add a power-domain-name for a
    performance-domain
  dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13
  dt-bindings: power: Clarify performance capabilities of power-domains
  cpufreq: scmi: Add support to parse domain-id using
    #power-domain-cells
  PM: domains: Allow genpd providers to manage OPP tables directly by
    its FW
  genpd: arm: Add the SCMI performance domain

 .../devicetree/bindings/arm/cpus.yaml         |   4 +-
 .../bindings/firmware/arm,scmi.yaml           |  11 +-
 .../bindings/power/power-domain.yaml          |  17 +-
 MAINTAINERS                                   |   1 +
 drivers/base/power/domain.c                   |  11 +-
 drivers/cpufreq/scmi-cpufreq.c                |  55 +++++--
 drivers/firmware/arm_scmi/Kconfig             |  12 ++
 drivers/firmware/arm_scmi/perf.c              |  90 +++++------
 drivers/genpd/Makefile                        |   1 +
 drivers/genpd/arm/Makefile                    |   3 +
 drivers/genpd/arm/scmi_perf_domain.c          | 150 ++++++++++++++++++
 include/linux/pm_domain.h                     |   5 +
 include/linux/scmi_protocol.h                 |  18 ++-
 13 files changed, 293 insertions(+), 85 deletions(-)
 create mode 100644 drivers/genpd/arm/Makefile
 create mode 100644 drivers/genpd/arm/scmi_perf_domain.c

Comments

Ulf Hansson Sept. 14, 2023, 10:45 p.m. UTC | #1
Sudeep, Christian,

On Fri, 25 Aug 2023 at 13:26, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> Changes in v3:
>         - Re-based upon the for-next/scmi/updates branch.
>         - Re-ordered some of the patches in the series, to eas review.
>         - Added some new DT doc patches in the series, according to comments.
>         - Fixed other comments, see version history for each patch.
>
> Changes in v2:
>         - Split up the series, to get the basic support in place as the first
>         step. The part that remains is the integration with the OPP library, to
>         allow consumer drivers to change performance level using the OPP lib.
>         - Re-based on top v6.5-rc1.
>         - Other changes will be described for each patch.
>
> The current SCMI performance scaling support is limited to cpufreq. This series
> extends the support, so it can be used for all kind of devices and not only for
> CPUs.
>
> The changes are spread over a couple of different subsystems, although the
> changes that affects the other subsystems than the arm_scmi directory are
> mostly smaller, except for last patch which is in the new genpd directory.
>
> The series is based upon the for-next/scmi/updates branch, but to enable the
> genpd provider in patch 13 (the actual scmi performance domain driver) to be
> placed in the new genpd directory, I have also merged an immutable branch [1],
> which is queued for v6.6.
>
> Note that, I am runing this on the Qemu virt platform with Optee running an SCMI
> server. If you want some more details about my test setup, I can share this with
> you, just let me know.
>
> Looking forward to your feedback!
>
> Kind regards
> Ulf Hansson
>
> [1]
> git.kernel.org/pub/scm/linux/kernel/git/people/ulf.hansson/linux-pm.git genpd_create_dir
>
>
> Ulf Hansson (13):
>   firmware: arm_scmi: Extend perf protocol ops to get number of domains
>   firmware: arm_scmi: Extend perf protocol ops to get information of a
>     domain
>   cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq
>   firmware: arm_scmi: Align perf ops to use domain-id as in-parameter
>   firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops
>   cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus()
>   cpufreq: scmi: Drop redundant ifdef in scmi_cpufreq_probe()
>   dt-bindings: arm: cpus: Add a power-domain-name for a
>     performance-domain
>   dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13
>   dt-bindings: power: Clarify performance capabilities of power-domains
>   cpufreq: scmi: Add support to parse domain-id using
>     #power-domain-cells
>   PM: domains: Allow genpd providers to manage OPP tables directly by
>     its FW
>   genpd: arm: Add the SCMI performance domain
>
>  .../devicetree/bindings/arm/cpus.yaml         |   4 +-
>  .../bindings/firmware/arm,scmi.yaml           |  11 +-
>  .../bindings/power/power-domain.yaml          |  17 +-
>  MAINTAINERS                                   |   1 +
>  drivers/base/power/domain.c                   |  11 +-
>  drivers/cpufreq/scmi-cpufreq.c                |  55 +++++--
>  drivers/firmware/arm_scmi/Kconfig             |  12 ++
>  drivers/firmware/arm_scmi/perf.c              |  90 +++++------
>  drivers/genpd/Makefile                        |   1 +
>  drivers/genpd/arm/Makefile                    |   3 +
>  drivers/genpd/arm/scmi_perf_domain.c          | 150 ++++++++++++++++++
>  include/linux/pm_domain.h                     |   5 +
>  include/linux/scmi_protocol.h                 |  18 ++-
>  13 files changed, 293 insertions(+), 85 deletions(-)
>  create mode 100644 drivers/genpd/arm/Makefile
>  create mode 100644 drivers/genpd/arm/scmi_perf_domain.c
>

Unless you have some additional comments, I think patch 1 -> 12 should
be ready to be applied to your scmi tree, as is. I tried to apply it
today and did not encounter any problem.

Patch 13 needs a rebase so I will submit a new version of it. For you
to apply it to your tree, you need to move your scmi branch to
v6.6-rc2 (on Monday), would that be okay for you to manage?

Kind regards
Uffe
Sudeep Holla Sept. 18, 2023, 10:26 a.m. UTC | #2
On Fri, Sep 15, 2023 at 12:45:02AM +0200, Ulf Hansson wrote:
> Sudeep, Christian,
> 
> On Fri, 25 Aug 2023 at 13:26, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >
> > Changes in v3:
> >         - Re-based upon the for-next/scmi/updates branch.
> >         - Re-ordered some of the patches in the series, to eas review.
> >         - Added some new DT doc patches in the series, according to comments.
> >         - Fixed other comments, see version history for each patch.
> >
> > Changes in v2:
> >         - Split up the series, to get the basic support in place as the first
> >         step. The part that remains is the integration with the OPP library, to
> >         allow consumer drivers to change performance level using the OPP lib.
> >         - Re-based on top v6.5-rc1.
> >         - Other changes will be described for each patch.
> >
> > The current SCMI performance scaling support is limited to cpufreq. This series
> > extends the support, so it can be used for all kind of devices and not only for
> > CPUs.
> >
> > The changes are spread over a couple of different subsystems, although the
> > changes that affects the other subsystems than the arm_scmi directory are
> > mostly smaller, except for last patch which is in the new genpd directory.
> >
> > The series is based upon the for-next/scmi/updates branch, but to enable the
> > genpd provider in patch 13 (the actual scmi performance domain driver) to be
> > placed in the new genpd directory, I have also merged an immutable branch [1],
> > which is queued for v6.6.
> >
> > Note that, I am runing this on the Qemu virt platform with Optee running an SCMI
> > server. If you want some more details about my test setup, I can share this with
> > you, just let me know.
> >
> > Looking forward to your feedback!
> >
> > Kind regards
> > Ulf Hansson
> >
> > [1]
> > git.kernel.org/pub/scm/linux/kernel/git/people/ulf.hansson/linux-pm.git genpd_create_dir
> >
> >
> > Ulf Hansson (13):
> >   firmware: arm_scmi: Extend perf protocol ops to get number of domains
> >   firmware: arm_scmi: Extend perf protocol ops to get information of a
> >     domain
> >   cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq
> >   firmware: arm_scmi: Align perf ops to use domain-id as in-parameter
> >   firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops
> >   cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus()
> >   cpufreq: scmi: Drop redundant ifdef in scmi_cpufreq_probe()
> >   dt-bindings: arm: cpus: Add a power-domain-name for a
> >     performance-domain
> >   dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13
> >   dt-bindings: power: Clarify performance capabilities of power-domains
> >   cpufreq: scmi: Add support to parse domain-id using
> >     #power-domain-cells
> >   PM: domains: Allow genpd providers to manage OPP tables directly by
> >     its FW
> >   genpd: arm: Add the SCMI performance domain
> >
> >  .../devicetree/bindings/arm/cpus.yaml         |   4 +-
> >  .../bindings/firmware/arm,scmi.yaml           |  11 +-
> >  .../bindings/power/power-domain.yaml          |  17 +-
> >  MAINTAINERS                                   |   1 +
> >  drivers/base/power/domain.c                   |  11 +-
> >  drivers/cpufreq/scmi-cpufreq.c                |  55 +++++--
> >  drivers/firmware/arm_scmi/Kconfig             |  12 ++
> >  drivers/firmware/arm_scmi/perf.c              |  90 +++++------
> >  drivers/genpd/Makefile                        |   1 +
> >  drivers/genpd/arm/Makefile                    |   3 +
> >  drivers/genpd/arm/scmi_perf_domain.c          | 150 ++++++++++++++++++
> >  include/linux/pm_domain.h                     |   5 +
> >  include/linux/scmi_protocol.h                 |  18 ++-
> >  13 files changed, 293 insertions(+), 85 deletions(-)
> >  create mode 100644 drivers/genpd/arm/Makefile
> >  create mode 100644 drivers/genpd/arm/scmi_perf_domain.c
> >
> 
> Unless you have some additional comments, I think patch 1 -> 12 should
> be ready to be applied to your scmi tree, as is. I tried to apply it
> today and did not encounter any problem.
>

Sorry for the delay, was off few days last week. I will take a look at
the series later this week

> Patch 13 needs a rebase so I will submit a new version of it. For you
> to apply it to your tree, you need to move your scmi branch to
> v6.6-rc2 (on Monday), would that be okay for you to manage?
>

Sure I can rebase on -rc2. I assume Arnd is aware of the dependency and
must be OK with that. The general preference/expectation is -rc1 but I
understand the exception this time.
Ulf Hansson Sept. 19, 2023, 10:24 a.m. UTC | #3
On Mon, 18 Sept 2023 at 12:26, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Fri, Sep 15, 2023 at 12:45:02AM +0200, Ulf Hansson wrote:
> > Sudeep, Christian,
> >
> > On Fri, 25 Aug 2023 at 13:26, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > >
> > > Changes in v3:
> > >         - Re-based upon the for-next/scmi/updates branch.
> > >         - Re-ordered some of the patches in the series, to eas review.
> > >         - Added some new DT doc patches in the series, according to comments.
> > >         - Fixed other comments, see version history for each patch.
> > >
> > > Changes in v2:
> > >         - Split up the series, to get the basic support in place as the first
> > >         step. The part that remains is the integration with the OPP library, to
> > >         allow consumer drivers to change performance level using the OPP lib.
> > >         - Re-based on top v6.5-rc1.
> > >         - Other changes will be described for each patch.
> > >
> > > The current SCMI performance scaling support is limited to cpufreq. This series
> > > extends the support, so it can be used for all kind of devices and not only for
> > > CPUs.
> > >
> > > The changes are spread over a couple of different subsystems, although the
> > > changes that affects the other subsystems than the arm_scmi directory are
> > > mostly smaller, except for last patch which is in the new genpd directory.
> > >
> > > The series is based upon the for-next/scmi/updates branch, but to enable the
> > > genpd provider in patch 13 (the actual scmi performance domain driver) to be
> > > placed in the new genpd directory, I have also merged an immutable branch [1],
> > > which is queued for v6.6.
> > >
> > > Note that, I am runing this on the Qemu virt platform with Optee running an SCMI
> > > server. If you want some more details about my test setup, I can share this with
> > > you, just let me know.
> > >
> > > Looking forward to your feedback!
> > >
> > > Kind regards
> > > Ulf Hansson
> > >
> > > [1]
> > > git.kernel.org/pub/scm/linux/kernel/git/people/ulf.hansson/linux-pm.git genpd_create_dir
> > >
> > >
> > > Ulf Hansson (13):
> > >   firmware: arm_scmi: Extend perf protocol ops to get number of domains
> > >   firmware: arm_scmi: Extend perf protocol ops to get information of a
> > >     domain
> > >   cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq
> > >   firmware: arm_scmi: Align perf ops to use domain-id as in-parameter
> > >   firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops
> > >   cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus()
> > >   cpufreq: scmi: Drop redundant ifdef in scmi_cpufreq_probe()
> > >   dt-bindings: arm: cpus: Add a power-domain-name for a
> > >     performance-domain
> > >   dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13
> > >   dt-bindings: power: Clarify performance capabilities of power-domains
> > >   cpufreq: scmi: Add support to parse domain-id using
> > >     #power-domain-cells
> > >   PM: domains: Allow genpd providers to manage OPP tables directly by
> > >     its FW
> > >   genpd: arm: Add the SCMI performance domain
> > >
> > >  .../devicetree/bindings/arm/cpus.yaml         |   4 +-
> > >  .../bindings/firmware/arm,scmi.yaml           |  11 +-
> > >  .../bindings/power/power-domain.yaml          |  17 +-
> > >  MAINTAINERS                                   |   1 +
> > >  drivers/base/power/domain.c                   |  11 +-
> > >  drivers/cpufreq/scmi-cpufreq.c                |  55 +++++--
> > >  drivers/firmware/arm_scmi/Kconfig             |  12 ++
> > >  drivers/firmware/arm_scmi/perf.c              |  90 +++++------
> > >  drivers/genpd/Makefile                        |   1 +
> > >  drivers/genpd/arm/Makefile                    |   3 +
> > >  drivers/genpd/arm/scmi_perf_domain.c          | 150 ++++++++++++++++++
> > >  include/linux/pm_domain.h                     |   5 +
> > >  include/linux/scmi_protocol.h                 |  18 ++-
> > >  13 files changed, 293 insertions(+), 85 deletions(-)
> > >  create mode 100644 drivers/genpd/arm/Makefile
> > >  create mode 100644 drivers/genpd/arm/scmi_perf_domain.c
> > >
> >
> > Unless you have some additional comments, I think patch 1 -> 12 should
> > be ready to be applied to your scmi tree, as is. I tried to apply it
> > today and did not encounter any problem.
> >
>
> Sorry for the delay, was off few days last week. I will take a look at
> the series later this week
>
> > Patch 13 needs a rebase so I will submit a new version of it. For you
> > to apply it to your tree, you need to move your scmi branch to
> > v6.6-rc2 (on Monday), would that be okay for you to manage?
> >
>
> Sure I can rebase on -rc2. I assume Arnd is aware of the dependency and
> must be OK with that. The general preference/expectation is -rc1 but I
> understand the exception this time.

Thanks! And yes, I can confirm that Arnd is aware too.

Kind regards
Uffe
Sudeep Holla Sept. 25, 2023, 9:39 a.m. UTC | #4
On Fri, 25 Aug 2023 13:26:20 +0200, Ulf Hansson wrote:
> Changes in v3:
> 	- Re-based upon the for-next/scmi/updates branch.
> 	- Re-ordered some of the patches in the series, to eas review.
> 	- Added some new DT doc patches in the series, according to comments.
> 	- Fixed other comments, see version history for each patch.
> 
> Changes in v2:
> 	- Split up the series, to get the basic support in place as the first
> 	step. The part that remains is the integration with the OPP library, to
> 	allow consumer drivers to change performance level using the OPP lib.
> 	- Re-based on top v6.5-rc1.
> 	- Other changes will be described for each patch.
> 
> [...]

Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!

[01/13] firmware: arm_scmi: Extend perf protocol ops to get number of domains
        https://git.kernel.org/sudeep.holla/c/e9090e70e618
[02/13] firmware: arm_scmi: Extend perf protocol ops to get information of a domain
        https://git.kernel.org/sudeep.holla/c/3d99ed60721b
[03/13] cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq
        https://git.kernel.org/sudeep.holla/c/e336baa4193e
[04/13] firmware: arm_scmi: Align perf ops to use domain-id as in-parameter
        https://git.kernel.org/sudeep.holla/c/39dfa5b9e1f0
[05/13] firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops
        https://git.kernel.org/sudeep.holla/c/9b578d83629e
[06/13] cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus()
        https://git.kernel.org/sudeep.holla/c/4f1f0bc8ed16
[08/13] dt-bindings: arm: cpus: Add a power-domain-name for a performance-domain
        https://git.kernel.org/sudeep.holla/c/6e429adc60b1
[09/13] dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13
        https://git.kernel.org/sudeep.holla/c/e11c480b6df1
[10/13] dt-bindings: power: Clarify performance capabilities of power-domains
        https://git.kernel.org/sudeep.holla/c/0ead1f3e158c
[11/13] cpufreq: scmi: Add support to parse domain-id using #power-domain-cells
        https://git.kernel.org/sudeep.holla/c/92b2028b00ff
[12/13] PM: domains: Allow genpd providers to manage OPP tables directly by its FW
        https://git.kernel.org/sudeep.holla/c/3dd91515ef43

--
Regards,
Sudeep