Commit 14f0cf6c authored by Zhang Rui's avatar Zhang Rui Committed by Srinivas Pandruvada

tools/power/x86/intel-speed-select: Avoid setting duplicate tdp level

If the new TDP level requetsted is same as the current TDP level, don't
call into driver to change level.
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
[srinivas.pandruvada@linux.intel.com: changelog edits]
Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
parent c7ff8ff3
......@@ -1229,16 +1229,30 @@ static void adjust_scaling_max_from_base_freq(int cpu);
static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, void *arg3,
void *arg4)
{
struct isst_pkg_ctdp pkg_dev;
int ret;
ret = isst_get_ctdp_levels(id, &pkg_dev);
if (ret) {
isst_display_error_info_message(1, "Get TDP level failed", 0, 0);
isst_ctdp_display_information_end(outf);
exit(1);
}
if (pkg_dev.current_level == tdp_level) {
debug_printf("TDP level already set. Skipped\n");
goto display_result;
}
ret = isst_set_tdp_level(id, tdp_level);
if (ret) {
isst_display_error_info_message(1, "Set TDP level failed", 0, 0);
isst_ctdp_display_information_end(outf);
exit(1);
} else {
isst_display_result(id, outf, "perf-profile", "set_tdp_level",
ret);
}
display_result:
isst_display_result(id, outf, "perf-profile", "set_tdp_level", ret);
if (force_online_offline) {
struct isst_pkg_ctdp_level_info ctdp_level;
......@@ -1272,7 +1286,6 @@ static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, vo
}
}
}
}
}
static void set_tdp_level(int arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment