• Srinivas Pandruvada's avatar
    thermal: intel: powerclamp: Fix cur_state for multi package system · 8e473635
    Srinivas Pandruvada authored
    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: b721ca0d ("thermal/powerclamp: remove cpu whitelist")
    Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: 4.14+ <stable@vger.kernel.org> # 4.14+
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    8e473635
intel_powerclamp.c 19.3 KB