Skip to content

thermal, OPP: move the CPU power estimation to the OPP library

Quentin Perret linux-pm 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 12 repliesIn review
  2. v22 patches 6 repliesSuperseded
  3. v12 patches 15 repliesSuperseded

Changes in v3 from the cover letter

- Removed the has_power logic to simplify the thermal code (V. Kumar)
- Moved _opp_estimate_power() call to _opp_add() to avoid duplication (V. Kumar)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2PM / OPP: introduce an OPP power estimation helperdrivers/opp/core.c drivers/opp/of.c drivers/opp/opp.h +1 more+53 -46 replies
2/2thermal: cpu_cooling: use power models from the OPP librarydrivers/thermal/cpu_cooling.c+21 -355 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJoel Fernandes
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] thermal, OPP: move the CPU power estimation to the OPP library

Hi,

Currently, IPA estimates the power dissipated by a CPU at each available OPP using its capacitance (the dynamic-power-coefficient DT binding). This series relocates this per-OPP power model in the OPP core as a preparation for future changes. More specifically:

1. The current DT-based approach for power estimation will need deep changes to support SCMI-provided power values. While the thermal subsystem is not necessarily the best place to hide multiple power estimation methods, the OPP library appears to be a good candidate to implement the required platform abstraction and respect the existing design (the thermal subsystem already relies on the OPP library to provide voltages no matter where they come from -- DT or SCPI).

2. The energy models of CPUs will be needed by other clients in the future (such as the task scheduler or CPUFreq governors for example) in order to make energy-aware decisions. The relocation to the OPP library will enable code re-use and all clients will benefit form the platform abstraction mentioned previously.

As mentionned during the review of V1, this series will have a chance to get merged only when the clients (the scheduler, or the SCMI driver) depending on it are ready to be merged as well. This V3 is here for reference and addresses the main changes requested on the previous versions.

Changes in v2:
- Changed the OPP power estimation to be done upon OPP creation (V. Kumar)
- Updated the cover letter to motivate the choice of PM OPP (E. Valentin)

Changes in v3
- Removed the has_power logic to simplify the thermal code (V. Kumar)
- Moved _opp_estimate_power() call to _opp_add() to avoid duplication (V. Kumar)

Quentin Perret (2):
PM / OPP: introduce an OPP power estimation helper
thermal: cpu_cooling: use power models from the OPP library

 drivers/opp/core.c            | 32 +++++++++++++++++++++++++
 drivers/opp/of.c              | 11 +++++----
 drivers/opp/opp.h             |  7 ++++++
 drivers/thermal/cpu_cooling.c | 56 ++++++++++++++++---------------------------
 include/linux/pm_opp.h        |  7 ++++++
 5 files changed, 74 insertions(+), 39 deletions(-)
Signature · 1 line
2.15.1