From 2752befb4f4498fe23acb150df3aaa763b952622 Mon Sep 17 00:00:00 2001 From: Pu Wen Date: Mon, 17 Aug 2020 10:06:13 +0000 Subject: [PATCH] tools/power turbostat: Fix caller parameter of get_tdp_amd() mainline inclusion from mainline-v5.3-rc7 commit 9cfa8e0 category: feature bugzilla: NA CVE: NA --------------------------- Commit 9392bd98bba760be96ee ("tools/power turbostat: Add support for AMD Fam 17h (Zen) RAPL") add a function get_tdp_amd(), the parameter is CPU family. But the rapl_probe_amd() function use wrong model parameter. Fix the wrong caller parameter of get_tdp_amd() to use family. Cc: # v5.1+ Signed-off-by: Pu Wen Reviewed-by: Calvin Walton Signed-off-by: Len Brown Signed-off-by: Hanjun Guo Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 9cec06a367cd..9a89b71e3a34 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4011,7 +4011,7 @@ void rapl_probe_amd(unsigned int family, unsigned int model) rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f)); rapl_power_units = ldexp(1.0, -(msr & 0xf)); - tdp = get_tdp_amd(model); + tdp = get_tdp_amd(family); rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp; if (!quiet) -- GitLab