]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq
authorPerry Yuan <perry.yuan@amd.com>
Thu, 25 Apr 2024 08:07:53 +0000 (16:07 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Apr 2024 17:35:38 +0000 (19:35 +0200)
commit5547c0ebfc2efdab6ee93a7fd4d9c411ad87013e
tree5b31a602bb587cadadf0b2e80213191b462f655b
parent4fcfd1954ad305e331b6b4b62de2874fbae61394
cpufreq: amd-pstate: Unify computation of {max,min,nominal,lowest_nonlinear}_freq

Currently the amd_get_{min, max, nominal, lowest_nonlinear}_freq()
helpers computes the values of min_freq, max_freq, nominal_freq and
lowest_nominal_freq respectively afresh from
cppc_get_perf_caps(). This is not necessary as there are fields in
cpudata to cache these values.

To simplify this, add a single helper function named
amd_pstate_init_freq() which computes all these frequencies at once, and
caches it in cpudata.

Use the cached values everywhere else in the code.

Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Li Meng <li.meng@amd.com>
Tested-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
Co-developed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/amd-pstate.c