[PATCH 5.2 087/143] tools/power turbostat: Fix caller parameter of get_tdp_amd()

From: Greg Kroah-Hartman
Date: Wed Sep 04 2019 - 14:12:55 EST


From: Pu Wen <puwen@xxxxxxxx>

commit 9cfa8e042f7cbb1994cc5923e46c78b36f6054f4 upstream.

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: <stable@xxxxxxxxxxxxxxx> # v5.1+
Signed-off-by: Pu Wen <puwen@xxxxxxxx>
Reviewed-by: Calvin Walton <calvin.walton@xxxxxxxxxx>
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
tools/power/x86/turbostat/turbostat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -4002,7 +4002,7 @@ void rapl_probe_amd(unsigned int family,
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)