Changes related to PID controller and some man page updates - #590
Merged
Conversation
Per Intel DPTF ConditionType.h, condition ids in [0x2000, 0x10000) are software-OEM conditions set at runtime by OEM software via DPTF/ESIF; they have no equivalent on Linux. thermald instead lumped the whole [0x1000, 0x10000) range into ODVP and mapped e.g. 0x200D to a non-existent odvp4115, logging "Unable to read odvp4115" every poll. Restrict the ODVP mapping to [0x1000, 0x2000). SwOem conditions are still recognized by verify_condition() so engine startup behavior is unchanged (failing verify_conditions() would enter the unsupported condition fallback and stop evaluating conditions at poll time), but they are no longer evaluated via ODVP: the containing condition set quietly never matches, exactly as before when the odvpN read failed, just without the per-poll error spam. A one-time info message is logged at startup instead. No functional change - such sets were never satisfiable on Linux. Signed-off-by: Han Gao <rabenda.cn@gmail.com>
AMD platforms expose CPU temperature via k10temp/hwmon but lack a thermal_zone in /sys/class/thermal, so thermald cannot auto-discover the sensor. This causes the well-known 'No coretemp sysfs found' and 'No Zones present' messages on AMD systems. Existing examples 1-7 all assume Intel coretemp or pre-existing sysfs sensors. Add Example 8 showing the correct configuration for AMD: - Define a custom sensor under <ThermalSensors><ThermalSensor> with <Type>, <Path>, and <AsyncCapable> tags - Point the path at the k10temp hwmon input (e.g. hwmon2/temp1_input) - Use a unique sensor name (not the hwmon driver name) to avoid conflicts with auto-discovered sensors - Requires --ignore-cpuid-check on the thermald command line Verified on AMD Ryzen 9 5950X (ASUS B550-E) with thermald 2.5.11. Tag names confirmed against source (thd_parse.cpp parse_new_sensor). Signed-off-by: Greg Weyer <gweyer@live.com>
Power-limit devices (RAPL, SPEL) use an inverted state range where min_state is the maximum allowed power and max_state is the minimum. This patch fixes PID control for such devices and adds an incremental PID mode. - Negate PID output for inverted-range devices so a positive error (temp > target) reduces the power limit (thd_cdev.cpp) - Bypass in_max_state() guard for PID on inverted-range devices so the controller keeps running after hitting max restriction (thd_trip_point.cpp) - Fix unsigned subtraction wrap-around in pid_output() (thd_pid.cpp) - Add PID_INCREMENTAL mode: same formula as absolute but applied to curr_state instead of min_state, so the power limit keeps decreasing each poll while temperature stays above the trip threshold - Extend XML PID gain range from [0, 100] to [0, 1000] to support temperature-to-power mappings (thd_parse.cpp) - Add <PidMode>incremental</PidMode> XML element to select the mode Changes in v2: - thd_trip_point.cpp: extend in_max_state() bypass to cover cdev-level PID (is_pid_enabled()) in addition to trip-level PID (pid_param.valid); add is_pid_enabled() accessor to thd_cdev.h - thd_cdev.cpp: use get_curr_state(true) in incremental PID branches to anchor each step to the actual hardware state, not the cached value Signed-off-by: Priyansh Jain <priyansh.jain@oss.qualcomm.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.