Skip to content

Add Qualcomm SPEL cooling device support - #583

Closed
priyjain1 wants to merge 1 commit into
intel:masterfrom
priyjain1:spel-power-limit-support
Closed

Add Qualcomm SPEL cooling device support#583
priyjain1 wants to merge 1 commit into
intel:masterfrom
priyjain1:spel-power-limit-support

Conversation

@priyjain1

Copy link
Copy Markdown
Contributor

This commit adds complete support for Qualcomm SPEL-based thermal cooling on Qualcomm SOCs. SPEL stands for SoC Power Estimation and Limiting and is a power capping mechanism that allows limiting power consumption at the SOC and SYS domain levels.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Qualcomm SPEL (SoC Power Estimation and Limiting) cooling-device implementation and wires it into the default thermald engine so Qualcomm SoCs can be power-capped via the Linux powercap framework.

Changes:

  • Extend PPCC lookup to recognize the SPEL device name alongside the existing RAPL name.
  • Discover Qualcomm SPEL powercap domains/constraints under /sys/class/powercap/ and create cooling devices per constraint.
  • Add new cthd_sysfs_cdev_spel sysfs cooling device implementation and include it in both autotools and Android builds.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/thd_parse.cpp Allows PPCC params to be retrieved for SPEL in addition to RAPL.
src/thd_engine_default.cpp Scans powercap sysfs for qcom-spel: entries and instantiates SPEL cooling devices.
src/thd_cdev_spel.h Declares the new SPEL sysfs cooling device class.
src/thd_cdev_spel.cpp Implements SPEL sysfs interactions (power limit, time window, enable) and PPCC-based initialization.
Makefile.am Adds SPEL implementation source to the autotools build.
Android.mk Adds SPEL implementation source to the Android build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/thd_cdev_spel.h
Comment thread src/thd_cdev_spel.cpp Outdated
Comment thread src/thd_cdev_spel.cpp
Comment thread src/thd_cdev_spel.cpp
@spandruvada

Copy link
Copy Markdown
Contributor

There are some comments during copilot review. Please check.

@priyjain1
priyjain1 force-pushed the spel-power-limit-support branch from b1d45e5 to 201c1a1 Compare July 10, 2026 04:49
@priyjain1

Copy link
Copy Markdown
Contributor Author

There are some comments during copilot review. Please check.

Thanks, Addressed all review comments and force-pushed the updated commit.

This commit adds complete support for Qualcomm SPEL-based
thermal cooling on Qualcomm SOCs. SPEL stands for
SoC Power Estimation and Limiting and is a power capping
mechanism that allows limiting power consumption at the
SOC and SYS domain levels.

Changes since v1:
- Remove unused dynamic_phy_max_enable member variable
- Fix domain-wide "enabled" sysfs being toggled per-constraint in
  set_curr_state(); power limit writes alone are sufficient for
  thermal control.
- Add thd_cdev_spel_restore.cpp: register an atexit() handler to
  restore SPEL power limits and time windows on daemon exit, keyed
  per domain/constraint path (similar to thd_cdev_rapl_restore.cpp)
- Wire thd_cdev_spel_restore.cpp into Makefile.am and Android.mk

Changes since v2:
- Use std::move() when forwarding _domain_type string parameter in
  the delegating constructor to avoid an unnecessary copy
  (performance-unnecessary-value-param)
- Replace NULL with nullptr in opendir() and readdir() comparisons
  in thd_engine_default.cpp (modernize-use-nullptr)

Signed-off-by: Priyansh Jain <priyansh.jain@oss.qualcomm.com>
@priyjain1
priyjain1 force-pushed the spel-power-limit-support branch from 201c1a1 to a3fb0d1 Compare July 15, 2026 03:51
@spandruvada

Copy link
Copy Markdown
Contributor

Applied. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants