Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Add Qualcomm SPEL powercap driver
@ 2026-12-06 11:56 Manaf Meethalavalappu Pallikunhi
  2026-12-06 11:56 ` [PATCH v4 1/3] dt-bindings: soc: qcom: Describe Qualcomm SPEL hardware Manaf Meethalavalappu Pallikunhi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Manaf Meethalavalappu Pallikunhi @ 2026-12-06 11:56 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Rafael J. Wysocki,
	Daniel Lezcano
  Cc: linux-arm-msm, devicetree, linux-kernel, linux-pm,
	Manaf Meethalavalappu Pallikunhi

This patch series introduces support for Qualcomm's SPEL (SoC Power
and Electrical Limits) hardware, which provides power monitoring and
limiting capabilities for various power domains in Qualcomm SoCs.

The SPEL hardware enables:
- Real-time energy consumption monitoring across multiple power domains
- Hardware-enforced power limits with configurable time windows
- Support for up to 4 power limits (PL1-PL4) per domain
- Hierarchical power domain organization (SYS -> SOC -> subsystems)

The driver integrates with the Linux powercap framework, exposing SPEL
capabilities through standard sysfs interfaces. This allows userspace
applications and thermal management daemons to monitor energy consumption
and configure power limits for optimal power/performance balance.

This series is based on top of the powercap hierarchy patchset [1], which
is already part of linux-next.

[1] https://lore.kernel.org/all/cover.1793666444.git.daniel.lezcano@oss.qualcomm.com

Signed-off-by: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>
---
Changes in v4:
- Reworked the driver onto that generic powercap hierarchy API.(Daniel)
- Single self-contained qcom,glymur-spel.yaml moved to Documentation/devicetree/bindings/soc/qcom/
  and dropped the separate power-limit-controller.yaml and the power/limits/ path.
- Moved the driver file under powercap/qcom path and added MAINTAINERS update.(Daniel)
- Added hibernation support: spel_domain_pm_freeze()/spel_domain_pm_restore() snapshot and
  replay per-domain power limits, time windows, and cumulative energy across a hibernation cycle.
- Fixed two use-after-free bugs: dangling released pointer in spel_create_zone()/spel_probe()
  after successful registration, plus a u64 overflow in spel_unit_xlate()'s unit conversion (Sashiko).
- Addressed v3 other review feedback from Daniel/Krzysztof/Konrad/Sashiko/Uwe.
- Preserved fractional unit precision.(Daniel)
- Updated glymur powercap hierarchy nodes and removed usb* nodes.
- Link to v3: https://lore.kernel.org/r/20260702-qcom_spel_driver_upstream-v3-0-434d50f0c5b0@oss.qualcomm.com

Changes in v3:
- Created common power-limit-controller schema under power/limits and described
  power-limit-controller device common capabilities.(Krzysztof)
- Created SoC-specific qcom,glymur-spel.yaml file instead of generic one and updated
  description and commit.(Krzysztof)
- Used FIELD_MODIFY() macro at different places.(Konrad)
- Updated glymur specific domain info table.(Konrad)
- Updated all for-loops iterator declaration to C99 style.(Konrad)
- Fixed use-after-free bugs.(Sashiko)
- Corrected time_unit documention to reflect the logic.(Sashiko)
- Link to v2: https://lore.kernel.org/r/20260620-qcom_spel_driver_upstream-v2-0-a3ee6837c18f@oss.qualcomm.com

Changes in v2:
- Fixed DT issues: corrected unit-address mismatch and made compatible
  platform-specific.(Konrad/Krzysztof)
- Cleaned up bitfield handling: switched to GENMASK, FIELD_* macros.(Konrad)
- Converted hex values to lowercase and simplified array definitions.(Konrad)
- used devm_platform_ioremap_resource_byname().(Konrad)
- Refactored data structures: merged domain data into spel_domain_info
  and removed hardcoded limits using ARRAY_SIZE().(Daniel)
- Added bounds checks (TIME_WINDOW_MAX) and fixed time window RMW
  handling (preserving reserved bits + firmware notify).(Sashiko)
- Resolved use-after-free, replaced allocation strategy, and
  added proper cleanup in .release().(Sashiko)
- Updated time window calculation logic.
- Removed cyclic dependency, improved validation logic, and aligned
  naming consistency.(Daniel)
- Link to v1: https://lore.kernel.org/r/20260519-qcom_spel_driver_upstream-v1-0-75356d1b7f94@oss.qualcomm.com

---
Manaf Meethalavalappu Pallikunhi (3):
      dt-bindings: soc: qcom: Describe Qualcomm SPEL hardware
      powercap: qcom: Add SPEL powercap driver
      arm64: dts: qcom: glymur: Enable SPEL powercap driver

 .../bindings/soc/qcom/qcom,glymur-spel.yaml        |  63 ++
 MAINTAINERS                                        |  13 +
 arch/arm64/boot/dts/qcom/glymur.dtsi               |  10 +
 drivers/powercap/Kconfig                           |   3 +
 drivers/powercap/Makefile                          |   1 +
 drivers/powercap/qcom/Kconfig                      |  13 +
 drivers/powercap/qcom/Makefile                     |   2 +
 drivers/powercap/qcom/spel.c                       | 949 +++++++++++++++++++++
 8 files changed, 1054 insertions(+)
---
base-commit: 29beb21c21ada7207692b2d69fc58dcd15dab6e9
change-id: 20261206-qcom_spel_driver_upstream-a5741cbe43ac

Best regards,
-- 
Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-06 12:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06 11:56 [PATCH v4 0/3] Add Qualcomm SPEL powercap driver Manaf Meethalavalappu Pallikunhi
2026-12-06 11:56 ` [PATCH v4 1/3] dt-bindings: soc: qcom: Describe Qualcomm SPEL hardware Manaf Meethalavalappu Pallikunhi
2026-12-06 11:56 ` [PATCH v4 2/3] powercap: qcom: Add SPEL powercap driver Manaf Meethalavalappu Pallikunhi
2026-12-06 12:13   ` sashiko-bot
2026-12-06 11:56 ` [PATCH v4 3/3] arm64: dts: qcom: glymur: Enable " Manaf Meethalavalappu Pallikunhi
2026-12-06 12:04   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox