]> git.baikalelectronics.ru Git - kernel.git/commit
thermal: intel: powerclamp: Fix cur_state for multi package system
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 1 Feb 2023 20:39:41 +0000 (12:39 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:04 +0000 (16:44 +0100)
commite13d28763aae356b7cd9c2800c70b21fe50c8fa3
tree418dd050bf36e51ce982a1eae1e0af0a3436e7a9
parentacae1945cc63458f2c71556fb9bb10050836e522
thermal: intel: powerclamp: Fix cur_state for multi package system

commit 8e47363588377e1bdb65e2b020b409cfb44dd260 upstream.

The powerclamp cooling device cur_state shows actual idle observed by
package C-state idle counters. But the implementation is not sufficient
for multi package or multi die system. The cur_state value is incorrect.
On these systems, these counters must be read from each package/die and
somehow aggregate them. But there is no good method for aggregation.

It was not a problem when explicit CPU model addition was required to
enable intel powerclamp. In this way certain CPU models could have
been avoided. But with the removal of CPU model check with the
availability of Package C-state counters, the driver is loaded on most
of the recent systems.

For multi package/die systems, just show the actual target idle state,
the system is trying to achieve. In powerclamp this is the user set
state minus one.

Also there is no use of starting a worker thread for polling package
C-state counters and applying any compensation for multiple package
or multiple die systems.

Fixes: 01a89397f43a ("thermal/powerclamp: remove cpu whitelist")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: 4.14+ <stable@vger.kernel.org> # 4.14+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/intel/intel_powerclamp.c