diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2023-02-03 20:29:02 -0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-02-07 20:51:15 +0100 |
commit | 621084965459d2b9e2713844aac4d803d5bb6d67 (patch) | |
tree | 63dbf65ad9779033fa441359168e4019d153ea0a /drivers/thermal/intel | |
parent | 72ffc28f2fe8bce4e5b682caedf7a26c4998c756 (diff) | |
download | linux-stable-621084965459d2b9e2713844aac4d803d5bb6d67.tar.gz linux-stable-621084965459d2b9e2713844aac4d803d5bb6d67.tar.bz2 linux-stable-621084965459d2b9e2713844aac4d803d5bb6d67.zip |
thermal: intel: powerclamp: Return last requested state as cur_state
When the user is reading cur_state from the thermal cooling device for
Intel powerclamp device:
- It returns the idle ratio from Package C-state counters when
there is active idle injection session.
- -1, when there is no active idle injection session.
This information is not very useful as the package C-state counters vary
a lot from read to read. Instead just return the last requested cur_state.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/intel')
-rw-r--r-- | drivers/thermal/intel/intel_powerclamp.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index 209bb5f5ae17..1390748706a6 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -541,17 +541,7 @@ static int powerclamp_get_cur_state(struct thermal_cooling_device *cdev, unsigned long *state) { mutex_lock(&powerclamp_lock); - - if (powerclamp_data.clamping) { - if (poll_pkg_cstate_enable) - *state = pkg_cstate_ratio_cur; - else - *state = powerclamp_data.target_ratio; - } else { - /* to save power, do not poll idle ratio while not clamping */ - *state = -1; /* indicates invalid state */ - } - + *state = powerclamp_data.target_ratio; mutex_unlock(&powerclamp_lock); return 0; |