Skip to content

Commit

Permalink
tools/power turbostat: Fix caller parameter of get_tdp_amd()
Browse files Browse the repository at this point in the history
Commit 9392bd9 ("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@vger.kernel.org> # v5.1+
Signed-off-by: Pu Wen <puwen@hygon.cn>
Reviewed-by: Calvin Walton <calvin.walton@kepstin.ca>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Pu Wen authored and Len Brown committed Aug 31, 2019
1 parent 1e9042b commit 9cfa8e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -4031,7 +4031,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)
Expand Down

0 comments on commit 9cfa8e0

Please sign in to comment.