summaryrefslogtreecommitdiff
path: root/tools/power/x86/intel-speed-select/isst-config.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2023-02-02 10:52:42 +0300
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2023-03-22 23:36:52 +0300
commit73452ccc190a416929ccf7da4061365a5eaff627 (patch)
tree64f7db7b84eacea3e9c4d3619e3a9718d2225a61 /tools/power/x86/intel-speed-select/isst-config.c
parent8f54104f7a9548466027e1ee8482b18c2a72656a (diff)
downloadlinux-73452ccc190a416929ccf7da4061365a5eaff627.tar.xz
tools/power/x86/intel-speed-select: Abstract adjust_uncore_freq
Allow platform specific implementation to adjust the uncore frequency. No functional changes are expected. Signed-off-by: Zhang Rui <rui.zhang@intel.com> [srinivas.pandruvada@linux.intel.com: changelog edits] Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'tools/power/x86/intel-speed-select/isst-config.c')
-rw-r--r--tools/power/x86/intel-speed-select/isst-config.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 71e00d03062f..346f8271b00f 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -1187,34 +1187,6 @@ static void dump_isst_config(int arg)
isst_ctdp_display_information_end(outf);
}
-static int set_uncore_min_max(struct isst_id *id, int max, int freq)
-{
- char buffer[128], freq_str[16];
- int fd, ret, len;
-
- if (max)
- snprintf(buffer, sizeof(buffer),
- "/sys/devices/system/cpu/intel_uncore_frequency/package_%02d_die_%02d/max_freq_khz", id->pkg, id->die);
- else
- snprintf(buffer, sizeof(buffer),
- "/sys/devices/system/cpu/intel_uncore_frequency/package_%02d_die_%02d/min_freq_khz", id->pkg, id->die);
-
- fd = open(buffer, O_WRONLY);
- if (fd < 0)
- return fd;
-
- snprintf(freq_str, sizeof(freq_str), "%d", freq);
- len = strlen(freq_str);
- ret = write(fd, freq_str, len);
- if (ret == -1) {
- close(fd);
- return ret;
- }
- close(fd);
-
- return 0;
-}
-
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,
@@ -1237,12 +1209,7 @@ static void set_tdp_level_for_cpu(struct isst_id *id, void *arg1, void *arg2, vo
usleep(2000);
/* Adjusting uncore freq */
- isst_get_uncore_p0_p1_info(id, tdp_level, &ctdp_level);
- if (ctdp_level.uncore_pm)
- set_uncore_min_max(id, 0, ctdp_level.uncore_pm * 100000);
-
- if (ctdp_level.uncore_p0)
- set_uncore_min_max(id, 1, ctdp_level.uncore_p0 * 100000);
+ isst_adjust_uncore_freq(id, tdp_level, &ctdp_level);
fprintf(stderr, "Option is set to online/offline\n");
ctdp_level.core_cpumask_size =