• Rafael J. Wysocki's avatar
    cpufreq: intel_pstate: Read all MSRs on the target CPU · 8dbab94d
    Rafael J. Wysocki authored
    Some of the MSR accesses in intel_pstate are carried out on the CPU
    that is running the code, but the values coming from them are used
    for the performance scaling of the other CPUs.
    
    This is problematic, for example, on hybrid platforms where
    MSR_TURBO_RATIO_LIMIT for P-cores and E-cores is different, so the
    values read from it on a P-core are generally not applicable to E-cores
    and the other way around.
    
    For this reason, make the driver access all MSRs on the target CPU on
    platforms using the "core" pstate_funcs callbacks which is the case for
    all of the hybrid platforms released to date.  For this purpose, pass
    a CPU argument to the ->get_max(), ->get_max_physical(), ->get_min()
    and ->get_turbo() pstate_funcs callbacks and from there pass it to
    rdmsrl_on_cpu() or rdmsrl_safe_on_cpu() to access the MSR on the target
    CPU.
    
    Fixes: 46573fd6 ("cpufreq: intel_pstate: hybrid: Rework HWP calibration")
    Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Tested-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    8dbab94d
intel_pstate.c 90.7 KB