Skip to content

Commit 1fcf670

Browse files
spandruvadajwrdegoede
authored andcommitted
tools/power/x86/intel-speed-select: SST BF/TF support per level
SST BF and TF can be enabled/disabled per level. So check the current level support from the mask of supported levels. This change from a single level to mask for info.sst_tf_support and info.sst_tf_support is indicated by API version change. Use as mask for API version above 2. In this way there is no change in behavior when running on older kernel with API version 2. Since the tool can support now API version 3, update the supported API version. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 80a513e commit 1fcf670

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct process_cmd_struct {
1818

1919
static const char *version_str = "v1.18";
2020

21-
static const int supported_api_ver = 2;
21+
static const int supported_api_ver = 3;
2222
static struct isst_if_platform_info isst_platform_info;
2323
static char *progname;
2424
static int debug_flag;

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,14 @@ static int tpmi_get_ctdp_control(struct isst_id *id, int config_index,
194194
if (!(info.level_mask & level_mask))
195195
return -1;
196196

197-
ctdp_level->fact_support = info.sst_tf_support;
198-
ctdp_level->pbf_support = info.sst_bf_support;
197+
if (api_version() > 2) {
198+
ctdp_level->fact_support = info.sst_tf_support & BIT(config_index);
199+
ctdp_level->pbf_support = info.sst_bf_support & BIT(config_index);
200+
} else {
201+
ctdp_level->fact_support = info.sst_tf_support;
202+
ctdp_level->pbf_support = info.sst_bf_support;
203+
}
204+
199205
ctdp_level->fact_enabled = !!(info.feature_state & BIT(1));
200206
ctdp_level->pbf_enabled = !!(info.feature_state & BIT(0));
201207

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ int isst_set_platform_ops(int api_version)
2323
isst_ops = mbox_get_platform_ops();
2424
break;
2525
case 2:
26+
case 3:
2627
isst_ops = tpmi_get_platform_ops();
2728
break;
2829
default:

0 commit comments

Comments
 (0)