Skip to content

Commit 4ebde55

Browse files
committed
tools/power/x86/intel-speed-select: Adjust scope of core-power config
When core-power configuration or enabled is modified, this is only done for compute dies. But the config must also be set to cores with no CPUs. Without this the configuration is not affective. On displaying config information, allow display for non compute dies also. Signed-off-by: Srinivas Pandruvada <[email protected]>
1 parent 2515e54 commit 4ebde55

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

tools/power/x86/intel-speed-select/isst-config.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,9 +2261,6 @@ static void dump_clos_config_for_cpu(struct isst_id *id, void *arg1, void *arg2,
22612261
struct isst_clos_config clos_config;
22622262
int ret;
22632263

2264-
if (id->cpu < 0)
2265-
return;
2266-
22672264
ret = isst_pm_get_clos(id, current_clos, &clos_config);
22682265
if (ret)
22692266
isst_display_error_info_message(1, "isst_pm_get_clos failed", 0, 0);

tools/power/x86/intel-speed-select/isst-core-tpmi.c

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -641,16 +641,30 @@ static int tpmi_pm_qos_config(struct isst_id *id, int enable_clos,
641641
int priority_type)
642642
{
643643
struct isst_core_power info;
644-
int ret;
644+
int i, ret, saved_punit;
645645

646646
info.get_set = 1;
647647
info.socket_id = id->pkg;
648648
info.power_domain_id = id->punit;
649649
info.enable = enable_clos;
650650
info.priority_type = priority_type;
651-
ret = tpmi_process_ioctl(ISST_IF_CORE_POWER_STATE, &info);
652-
if (ret == -1)
653-
return ret;
651+
652+
saved_punit = id->punit;
653+
654+
/* Set for all other dies also. This is per package setting */
655+
for (i = 0; i < MAX_PUNIT_PER_DIE; i++) {
656+
id->punit = i;
657+
if (isst_is_punit_valid(id)) {
658+
info.power_domain_id = i;
659+
ret = tpmi_process_ioctl(ISST_IF_CORE_POWER_STATE, &info);
660+
if (ret == -1) {
661+
id->punit = saved_punit;
662+
return ret;
663+
}
664+
}
665+
}
666+
667+
id->punit = saved_punit;
654668

655669
return 0;
656670
}
@@ -686,7 +700,7 @@ int tpmi_set_clos(struct isst_id *id, int clos,
686700
struct isst_clos_config *clos_config)
687701
{
688702
struct isst_clos_param info;
689-
int ret;
703+
int i, ret, saved_punit;
690704

691705
info.get_set = 1;
692706
info.socket_id = id->pkg;
@@ -702,9 +716,22 @@ int tpmi_set_clos(struct isst_id *id, int clos,
702716
if (info.max_freq_mhz <= 0xff)
703717
info.max_freq_mhz *= 100;
704718

705-
ret = tpmi_process_ioctl(ISST_IF_CLOS_PARAM, &info);
706-
if (ret == -1)
707-
return ret;
719+
saved_punit = id->punit;
720+
721+
/* Set for all other dies also. This is per package setting */
722+
for (i = 0; i < MAX_PUNIT_PER_DIE; i++) {
723+
id->punit = i;
724+
if (isst_is_punit_valid(id)) {
725+
info.power_domain_id = i;
726+
ret = tpmi_process_ioctl(ISST_IF_CLOS_PARAM, &info);
727+
if (ret == -1) {
728+
id->punit = saved_punit;
729+
return ret;
730+
}
731+
}
732+
}
733+
734+
id->punit = saved_punit;
708735

709736
debug_printf("set cpu:%d clos:%d min:%d max:%d\n", id->cpu, clos,
710737
clos_config->clos_min, clos_config->clos_max);

0 commit comments

Comments
 (0)