Skip to content

Add SoC model matching via device tree for ARM/Qualcomm platforms - #584

Closed
priyjain1 wants to merge 1 commit into
intel:masterfrom
priyjain1:soc_model_matching
Closed

Add SoC model matching via device tree for ARM/Qualcomm platforms#584
priyjain1 wants to merge 1 commit into
intel:masterfrom
priyjain1:soc_model_matching

Conversation

@priyjain1

Copy link
Copy Markdown
Contributor

Add support for platform-specific thermal configuration matching using the device tree model string, enabling thermald to apply the correct thermal rules on ARM/Qualcomm SoCs.

A new XML element is introduced in thermal-conf.xml Platform entries. During platform matching, thermald reads the board model string from /sys/firmware/devicetree/base/model and performs a prefix match against the configured SoCModel value.

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 ARM/Qualcomm-oriented platform selection by matching a platform entry against the device tree board model string, allowing thermald to choose an appropriate thermal configuration when DMI identifiers aren’t available.

Changes:

  • Extend parsed platform metadata with a new soc_model field.
  • Parse a new <SoCModel> XML element and match it (prefix match) against /sys/firmware/devicetree/base/model during platform detection.
  • Add a sample Qualcomm platform entry using <SoCModel> in thermal-conf.xml.

Reviewed changes

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

File Description
src/thd_parse.h Adds soc_model field to thermal_info_t to store <SoCModel> from XML.
src/thd_parse.cpp Parses <SoCModel>, logs it in dumps, and adds device-tree model prefix matching in platform_matched().
data/thermal-conf.xml Introduces an example <Platform> using <SoCModel> for Qualcomm device-tree-based matching.

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

Comment thread src/thd_parse.cpp
Comment thread data/thermal-conf.xml Outdated
Comment thread data/thermal-conf.xml
@spandruvada

Copy link
Copy Markdown
Contributor

Some comments by copilot review

Add support for platform-specific thermal configuration matching using
the device tree model string, enabling thermald to apply the correct
thermal rules on ARM/Qualcomm SoCs.

A new <SoCModel> XML element is introduced in thermal-conf.xml Platform
entries. During platform matching, thermald reads the board model string
from /sys/firmware/devicetree/base/model and performs a prefix match
against the configured SoCModel value.

Changes in v2:
 - Add XML documentation for SocModel.
 - Address review comments on logging and code style.

Signed-off-by: Priyansh Jain <priyansh.jain@oss.qualcomm.com>
@priyjain1
priyjain1 force-pushed the soc_model_matching branch from 2c3972f to 0c7f0fb Compare July 9, 2026 09:39
@priyjain1

Copy link
Copy Markdown
Contributor Author

Some comments by copilot review

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

@spandruvada

Copy link
Copy Markdown
Contributor

Please fix these errors. You can do "make clang-tidy" to reproduce:

5256 warnings generated.
/home/spandruv/development/tools/thermal_daemon/src/thd_cdev_spel.h:60:50: warning: parameter '_domain_type' of type 'std::string' (aka 'basic_string') is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
28 | cthd_sysfs_cdev_spel(_index, domain, _domain_type, 0, "")
| ^
| std::move( )
/home/spandruv/development/tools/thermal_daemon/src/thd_engine_default.cpp:791:54: warning: use nullptr [modernize-use-nullptr]
791 | if ((spel_dir = opendir(spel_base_path.c_str())) != NULL) {
| ^~~~
| nullptr
/home/spandruv/development/tools/thermal_daemon/src/thd_engine_default.cpp:792:46: warning: use nullptr [modernize-use-nullptr]
792 | while ((spel_entry = readdir(spel_dir)) != NULL) {
| ^~~~
| nullptr
Suppressed 5263 warnings (5253 in non-user code, 10 NOLINT).

@spandruvada

Copy link
Copy Markdown
Contributor

These are after applying commits from both PULL requests

@priyjain1

Copy link
Copy Markdown
Contributor Author

You can do "make clang-tidy" to reproduce:

Thank you for the feedback! I have addressed all three clang-tidy warnings and uploaded v3:

  • Used std::move() for the _domain_type string parameter in the delegating constructor (performance-unnecessary-value-param)
  • Replaced NULL with nullptr in the opendir() and readdir() comparisons in thd_engine_default.cpp (modernize-use-nullptr)

The updated patch is available at: a3fb0d1

I have verified with make clang-tidy and no more warnings are reported on either patch.

Please let me know if there is anything else to address.

@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