Add Qualcomm SPEL cooling device support - #583
Closed
priyjain1 wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
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_spelsysfs 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.
Contributor
|
There are some comments during copilot review. Please check. |
priyjain1
force-pushed
the
spel-power-limit-support
branch
from
July 10, 2026 04:49
b1d45e5 to
201c1a1
Compare
Contributor
Author
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
force-pushed
the
spel-power-limit-support
branch
from
July 15, 2026 03:51
201c1a1 to
a3fb0d1
Compare
Contributor
|
Applied. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.