Skip to content

Commit 6210849

Browse files
spandruvadarafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 72ffc28 commit 6210849

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

drivers/thermal/intel/intel_powerclamp.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -541,17 +541,7 @@ static int powerclamp_get_cur_state(struct thermal_cooling_device *cdev,
541541
unsigned long *state)
542542
{
543543
mutex_lock(&powerclamp_lock);
544-
545-
if (powerclamp_data.clamping) {
546-
if (poll_pkg_cstate_enable)
547-
*state = pkg_cstate_ratio_cur;
548-
else
549-
*state = powerclamp_data.target_ratio;
550-
} else {
551-
/* to save power, do not poll idle ratio while not clamping */
552-
*state = -1; /* indicates invalid state */
553-
}
554-
544+
*state = powerclamp_data.target_ratio;
555545
mutex_unlock(&powerclamp_lock);
556546

557547
return 0;

0 commit comments

Comments
 (0)