LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/5] tools/power/x86/intel-speed-select: New command and
@ 2019-09-14  7:05 Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 1/5] tools/power/x86/intel-speed-select: Fix high priority core mask over count Srinivas Pandruvada
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14  7:05 UTC (permalink / raw)
  To: andy.shevchenko, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, prarit, darcari, Srinivas Pandruvada

This series contains some minor fixes, when firmware mask is including
invalid CPU in the perf-profile mask. Also add some commands to
better manage core-power feature.

Srinivas Pandruvada (4):
  tools/power/x86/intel-speed-select: Allow online/offline based on tdp
  tools/power/x86/intel-speed-select: Format get-assoc information
  tools/power/x86/intel-speed-select: Fix some debug prints
  tools/power/x86/intel-speed-select: Extend core-power command set

Youquan Song (1):
  tools/power/x86/intel-speed-select: Fix high priority core mask over
    count

 .../x86/intel-speed-select/isst-config.c      | 108 ++++++++++++++++--
 .../power/x86/intel-speed-select/isst-core.c  |  25 ++++
 .../x86/intel-speed-select/isst-display.c     |  51 +++++++++
 tools/power/x86/intel-speed-select/isst.h     |   9 +-
 4 files changed, 182 insertions(+), 11 deletions(-)

-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] tools/power/x86/intel-speed-select: Fix high priority core mask over count
  2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
@ 2019-09-14  7:05 ` Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 2/5] tools/power/x86/intel-speed-select: Allow online/offline based on tdp Srinivas Pandruvada
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14  7:05 UTC (permalink / raw)
  To: andy.shevchenko, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, prarit, darcari, Youquan Song,
	Srinivas Pandruvada

From: Youquan Song <youquan.song@intel.com>

If the CPU package has the less logical CPU than topo_max_cpus, but un-present
CPU's punit_cpu_core will be initiated to 0 and they will be count to core 0

Like below, there are only 10 high priority cores (20 logical CPUs) in the CPU
package, but it count to 27 logic CPUs.

./intel-speed-select base-freq info -l 0 | grep mask
        high-priority-cpu-mask:7f000179,f000179f

With the fix patch:
./intel-speed-select base-freq info -l 0
        high-priority-cpu-mask:00000179,f000179f

Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 tools/power/x86/intel-speed-select/isst-config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 59753b3917bb..83ac72902b36 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -402,6 +402,9 @@ void set_cpu_mask_from_punit_coremask(int cpu, unsigned long long core_mask,
 			int j;
 
 			for (j = 0; j < topo_max_cpus; ++j) {
+				if (!CPU_ISSET_S(j, present_cpumask_size, present_cpumask))
+					continue;
+
 				if (cpu_map[j].pkg_id == pkg_id &&
 				    cpu_map[j].die_id == die_id &&
 				    cpu_map[j].punit_cpu_core == i) {
-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/5] tools/power/x86/intel-speed-select: Allow online/offline based on tdp
  2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 1/5] tools/power/x86/intel-speed-select: Fix high priority core mask over count Srinivas Pandruvada
@ 2019-09-14  7:05 ` Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 3/5] tools/power/x86/intel-speed-select: Format get-assoc information Srinivas Pandruvada
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14  7:05 UTC (permalink / raw)
  To: andy.shevchenko, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, prarit, darcari, Srinivas Pandruvada

Using enable core mask, do online offline CPUs. There is a new option
--online|-o for set-config-level.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 .../x86/intel-speed-select/isst-config.c      | 52 ++++++++++++++++++-
 tools/power/x86/intel-speed-select/isst.h     |  2 +
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 83ac72902b36..b44f5b822348 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -38,6 +38,7 @@ static int fact_avx = 0xFF;
 static unsigned long long fact_trl;
 static int out_format_json;
 static int cmd_help;
+static int force_online_offline;
 
 /* clos related */
 static int current_clos = -1;
@@ -165,6 +166,26 @@ int get_topo_max_cpus(void)
 	return topo_max_cpus;
 }
 
+static void set_cpu_online_offline(int cpu, int state)
+{
+	char buffer[128];
+	int fd;
+
+	snprintf(buffer, sizeof(buffer),
+		 "/sys/devices/system/cpu/cpu%d/online", cpu);
+
+	fd = open(buffer, O_WRONLY);
+	if (fd < 0)
+		err(-1, "%s open failed", buffer);
+
+	if (state)
+		write(fd, "1\n", 2);
+	else
+		write(fd, "0\n", 2);
+
+	close(fd);
+}
+
 #define MAX_PACKAGE_COUNT 8
 #define MAX_DIE_PER_PACKAGE 2
 static void for_each_online_package_in_set(void (*callback)(int, void *, void *,
@@ -736,9 +757,30 @@ static void set_tdp_level_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
 	ret = isst_set_tdp_level(cpu, tdp_level);
 	if (ret)
 		perror("set_tdp_level_for_cpu");
-	else
+	else {
 		isst_display_result(cpu, outf, "perf-profile", "set_tdp_level",
 				    ret);
+		if (force_online_offline) {
+			struct isst_pkg_ctdp_level_info ctdp_level;
+
+			fprintf(stderr, "Option is set to online/offline\n");
+			ctdp_level.core_cpumask_size =
+				alloc_cpu_set(&ctdp_level.core_cpumask);
+			isst_get_coremask_info(cpu, tdp_level, &ctdp_level);
+			if (ctdp_level.cpu_count) {
+				int i, max_cpus = get_topo_max_cpus();
+				for (i = 0; i < max_cpus; ++i) {
+					if (CPU_ISSET_S(i, ctdp_level.core_cpumask_size, ctdp_level.core_cpumask)) {
+						fprintf(stderr, "online cpu %d\n", i);
+						set_cpu_online_offline(i, 1);
+					} else {
+						fprintf(stderr, "offline cpu %d\n", i);
+						set_cpu_online_offline(i, 0);
+					}
+				}
+			}
+		}
+	}
 }
 
 static void set_tdp_level(void)
@@ -747,6 +789,8 @@ static void set_tdp_level(void)
 		fprintf(stderr, "Set Config TDP level\n");
 		fprintf(stderr,
 			"\t Arguments: -l|--level : Specify tdp level\n");
+		fprintf(stderr,
+			"\t Optional Arguments: -o | online : online/offline for the tdp level\n");
 		exit(0);
 	}
 
@@ -1319,6 +1363,7 @@ static void parse_cmd_args(int argc, int start, char **argv)
 	static struct option long_options[] = {
 		{ "bucket", required_argument, 0, 'b' },
 		{ "level", required_argument, 0, 'l' },
+		{ "online", required_argument, 0, 'o' },
 		{ "trl-type", required_argument, 0, 'r' },
 		{ "trl", required_argument, 0, 't' },
 		{ "help", no_argument, 0, 'h' },
@@ -1335,7 +1380,7 @@ static void parse_cmd_args(int argc, int start, char **argv)
 	option_index = start;
 
 	optind = start + 1;
-	while ((opt = getopt_long(argc, argv, "b:l:t:c:d:e:n:m:p:w:h",
+	while ((opt = getopt_long(argc, argv, "b:l:t:c:d:e:n:m:p:w:ho",
 				  long_options, &option_index)) != -1) {
 		switch (opt) {
 		case 'b':
@@ -1347,6 +1392,9 @@ static void parse_cmd_args(int argc, int start, char **argv)
 		case 'l':
 			tdp_level = atoi(optarg);
 			break;
+		case 'o':
+			force_online_offline = 1;
+			break;
 		case 't':
 			sscanf(optarg, "0x%llx", &fact_trl);
 			break;
diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h
index 2f7f62765eb6..668f914d077f 100644
--- a/tools/power/x86/intel-speed-select/isst.h
+++ b/tools/power/x86/intel-speed-select/isst.h
@@ -187,6 +187,8 @@ extern int isst_send_msr_command(unsigned int cpu, unsigned int command,
 				 int write, unsigned long long *req_resp);
 
 extern int isst_get_ctdp_levels(int cpu, struct isst_pkg_ctdp *pkg_dev);
+extern int isst_get_coremask_info(int cpu, int config_index,
+			   struct isst_pkg_ctdp_level_info *ctdp_level);
 extern int isst_get_process_ctdp(int cpu, int tdp_level,
 				 struct isst_pkg_ctdp *pkg_dev);
 extern void isst_get_process_ctdp_complete(int cpu,
-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/5] tools/power/x86/intel-speed-select: Format get-assoc information
  2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 1/5] tools/power/x86/intel-speed-select: Fix high priority core mask over count Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 2/5] tools/power/x86/intel-speed-select: Allow online/offline based on tdp Srinivas Pandruvada
@ 2019-09-14  7:05 ` Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 4/5] tools/power/x86/intel-speed-select: Fix some debug prints Srinivas Pandruvada
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14  7:05 UTC (permalink / raw)
  To: andy.shevchenko, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, prarit, darcari, Srinivas Pandruvada

Format the get-assoc command output consistant with other commands.
For example:

Intel(R) Speed Select Technology
Executing on CPU model:142[0x8e]
 package-0
  die-0
    cpu-0
      get-assoc
        clos:0

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 .../x86/intel-speed-select/isst-config.c      | 14 +++++++----
 .../x86/intel-speed-select/isst-display.c     | 23 +++++++++++++++++++
 tools/power/x86/intel-speed-select/isst.h     |  2 +-
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index b44f5b822348..4da7ffca2484 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -1245,7 +1245,7 @@ static void get_clos_assoc_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
 	if (ret)
 		perror("isst_clos_get_assoc_status");
 	else
-		isst_display_result(cpu, outf, "core-power", "get-assoc", clos);
+		isst_clos_display_assoc_information(cpu, outf, clos);
 }
 
 static void get_clos_assoc(void)
@@ -1255,13 +1255,17 @@ static void get_clos_assoc(void)
 		fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n");
 		exit(0);
 	}
-	if (max_target_cpus)
-		for_each_online_target_cpu_in_set(get_clos_assoc_for_cpu, NULL,
-						  NULL, NULL, NULL);
-	else {
+
+	if (!max_target_cpus) {
 		fprintf(stderr,
 			"Invalid target cpu. Specify with [-c|--cpu]\n");
+		exit(0);
 	}
+
+	isst_ctdp_display_information_start(outf);
+	for_each_online_target_cpu_in_set(get_clos_assoc_for_cpu, NULL,
+					  NULL, NULL, NULL);
+	isst_ctdp_display_information_end(outf);
 }
 
 static struct process_cmd_struct isst_cmds[] = {
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index df4aa99c4e92..bd7aaf27e4de 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -503,6 +503,29 @@ void isst_clos_display_information(int cpu, FILE *outf, int clos,
 	format_and_print(outf, 1, NULL, NULL);
 }
 
+void isst_clos_display_assoc_information(int cpu, FILE *outf, int clos)
+{
+	char header[256];
+	char value[256];
+
+	snprintf(header, sizeof(header), "package-%d",
+		 get_physical_package_id(cpu));
+	format_and_print(outf, 1, header, NULL);
+	snprintf(header, sizeof(header), "die-%d", get_physical_die_id(cpu));
+	format_and_print(outf, 2, header, NULL);
+	snprintf(header, sizeof(header), "cpu-%d", cpu);
+	format_and_print(outf, 3, header, NULL);
+
+	snprintf(header, sizeof(header), "get-assoc");
+	format_and_print(outf, 4, header, NULL);
+
+	snprintf(header, sizeof(header), "clos");
+	snprintf(value, sizeof(value), "%d", clos);
+	format_and_print(outf, 5, header, value);
+
+	format_and_print(outf, 1, NULL, NULL);
+}
+
 void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd,
 			 int result)
 {
diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h
index 668f914d077f..48655d0dee2d 100644
--- a/tools/power/x86/intel-speed-select/isst.h
+++ b/tools/power/x86/intel-speed-select/isst.h
@@ -225,7 +225,7 @@ extern int isst_clos_associate(int cpu, int clos);
 extern int isst_clos_get_assoc_status(int cpu, int *clos_id);
 extern void isst_clos_display_information(int cpu, FILE *outf, int clos,
 					  struct isst_clos_config *clos_config);
-
+extern void isst_clos_display_assoc_information(int cpu, FILE *outf, int clos);
 extern int isst_read_reg(unsigned short reg, unsigned int *val);
 extern int isst_write_reg(int reg, unsigned int val);
 
-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/5] tools/power/x86/intel-speed-select: Fix some debug prints
  2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
                   ` (2 preceding siblings ...)
  2019-09-14  7:05 ` [PATCH 3/5] tools/power/x86/intel-speed-select: Format get-assoc information Srinivas Pandruvada
@ 2019-09-14  7:05 ` Srinivas Pandruvada
  2019-09-14  7:05 ` [PATCH 5/5] tools/power/x86/intel-speed-select: Extend core-power command set Srinivas Pandruvada
  2019-09-14 17:19 ` [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Andy Shevchenko
  5 siblings, 0 replies; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14  7:05 UTC (permalink / raw)
  To: andy.shevchenko, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, prarit, darcari, Srinivas Pandruvada

Fix wrong debug print for cpu, which is displayed as CLOS. Also
avoid printing clos id, when user is specify clos as parameter.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 tools/power/x86/intel-speed-select/isst-config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 4da7ffca2484..15c098e3a512 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -508,7 +508,7 @@ int isst_send_mbox_command(unsigned int cpu, unsigned char command,
 		int write = 0;
 		int clos_id, core_id, ret = 0;
 
-		debug_printf("CLOS %d\n", cpu);
+		debug_printf("CPU %d\n", cpu);
 
 		if (parameter & BIT(MBOX_CMD_WRITE_BIT)) {
 			value = req_data;
@@ -1417,7 +1417,6 @@ static void parse_cmd_args(int argc, int start, char **argv)
 		/* CLOS related */
 		case 'c':
 			current_clos = atoi(optarg);
-			printf("clos %d\n", current_clos);
 			break;
 		case 'd':
 			clos_desired = atoi(optarg);
-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 5/5] tools/power/x86/intel-speed-select: Extend core-power command set
  2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
                   ` (3 preceding siblings ...)
  2019-09-14  7:05 ` [PATCH 4/5] tools/power/x86/intel-speed-select: Fix some debug prints Srinivas Pandruvada
@ 2019-09-14  7:05 ` Srinivas Pandruvada
  2019-09-14 17:19 ` [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Andy Shevchenko
  5 siblings, 0 replies; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14  7:05 UTC (permalink / raw)
  To: andy.shevchenko, andriy.shevchenko
  Cc: platform-driver-x86, linux-kernel, prarit, darcari, Srinivas Pandruvada

Add additional command to get the clos enable and priority type. The
current info option is actually dumping per clos QOS config, so name
the command appropriately to get-config.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 .../x86/intel-speed-select/isst-config.c      | 36 ++++++++++++++++++-
 .../power/x86/intel-speed-select/isst-core.c  | 25 +++++++++++++
 .../x86/intel-speed-select/isst-display.c     | 28 +++++++++++++++
 tools/power/x86/intel-speed-select/isst.h     |  5 +++
 4 files changed, 93 insertions(+), 1 deletion(-)

diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 15c098e3a512..671239333f98 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -1129,6 +1129,38 @@ static void dump_clos_config(void)
 	isst_ctdp_display_information_end(outf);
 }
 
+static void get_clos_info_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
+				  void *arg4)
+{
+	int enable, ret, prio_type;
+
+	ret = isst_clos_get_clos_information(cpu, &enable, &prio_type);
+	if (ret)
+		perror("isst_clos_get_info");
+	else
+		isst_clos_display_clos_information(cpu, outf, enable, prio_type);
+}
+
+static void dump_clos_info(void)
+{
+	if (cmd_help) {
+		fprintf(stderr,
+			"Print Intel Speed Select Technology core power information\n");
+		fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n");
+		exit(0);
+	}
+
+	if (!max_target_cpus)
+		fprintf(stderr,
+			"Invalid target cpu. Specify with [-c|--cpu]\n");
+
+	isst_ctdp_display_information_start(outf);
+	for_each_online_target_cpu_in_set(get_clos_info_for_cpu, NULL,
+					  NULL, NULL, NULL);
+	isst_ctdp_display_information_end(outf);
+
+}
+
 static void set_clos_config_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
 				    void *arg4)
 {
@@ -1282,10 +1314,11 @@ static struct process_cmd_struct isst_cmds[] = {
 	{ "turbo-freq", "info", dump_fact_config },
 	{ "turbo-freq", "enable", set_fact_enable },
 	{ "turbo-freq", "disable", set_fact_disable },
-	{ "core-power", "info", dump_clos_config },
+	{ "core-power", "info", dump_clos_info },
 	{ "core-power", "enable", set_clos_enable },
 	{ "core-power", "disable", set_clos_disable },
 	{ "core-power", "config", set_clos_config },
+	{ "core-power", "get-config", dump_clos_config },
 	{ "core-power", "assoc", set_clos_assoc },
 	{ "core-power", "get-assoc", get_clos_assoc },
 	{ NULL, NULL, NULL }
@@ -1487,6 +1520,7 @@ static void core_power_help(void)
 	printf("\tenable\n");
 	printf("\tdisable\n");
 	printf("\tconfig\n");
+	printf("\tget-config\n");
 	printf("\tassoc\n");
 	printf("\tget-assoc\n");
 }
diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c
index 0bf341ad9697..6dee5332c9d3 100644
--- a/tools/power/x86/intel-speed-select/isst-core.c
+++ b/tools/power/x86/intel-speed-select/isst-core.c
@@ -619,6 +619,31 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
 	return 0;
 }
 
+int isst_clos_get_clos_information(int cpu, int *enable, int *type)
+{
+	unsigned int resp;
+	int ret;
+
+	ret = isst_send_mbox_command(cpu, CONFIG_CLOS, CLOS_PM_QOS_CONFIG, 0, 0,
+				     &resp);
+	if (ret)
+		return ret;
+
+	debug_printf("cpu:%d CLOS_PM_QOS_CONFIG resp:%x\n", cpu, resp);
+
+	if (resp & BIT(1))
+		*enable = 1;
+	else
+		*enable = 0;
+
+	if (resp & BIT(2))
+		*type = 1;
+	else
+		*type = 0;
+
+	return 0;
+}
+
 int isst_pm_qos_config(int cpu, int enable_clos, int priority_type)
 {
 	unsigned int req, resp;
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index bd7aaf27e4de..2e6e5fcdbd7c 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -503,6 +503,34 @@ void isst_clos_display_information(int cpu, FILE *outf, int clos,
 	format_and_print(outf, 1, NULL, NULL);
 }
 
+void isst_clos_display_clos_information(int cpu, FILE *outf,
+					int clos_enable, int type)
+{
+	char header[256];
+	char value[256];
+
+	snprintf(header, sizeof(header), "package-%d",
+		 get_physical_package_id(cpu));
+	format_and_print(outf, 1, header, NULL);
+	snprintf(header, sizeof(header), "die-%d", get_physical_die_id(cpu));
+	format_and_print(outf, 2, header, NULL);
+	snprintf(header, sizeof(header), "cpu-%d", cpu);
+	format_and_print(outf, 3, header, NULL);
+
+	snprintf(header, sizeof(header), "core-power");
+	format_and_print(outf, 4, header, NULL);
+
+	snprintf(header, sizeof(header), "enable-status");
+	snprintf(value, sizeof(value), "%d", clos_enable);
+	format_and_print(outf, 5, header, value);
+
+	snprintf(header, sizeof(header), "priority-type");
+	snprintf(value, sizeof(value), "%d", type);
+	format_and_print(outf, 5, header, value);
+
+	format_and_print(outf, 1, NULL, NULL);
+}
+
 void isst_clos_display_assoc_information(int cpu, FILE *outf, int clos)
 {
 	char header[256];
diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h
index 48655d0dee2d..09e16a41b57c 100644
--- a/tools/power/x86/intel-speed-select/isst.h
+++ b/tools/power/x86/intel-speed-select/isst.h
@@ -231,4 +231,9 @@ extern int isst_write_reg(int reg, unsigned int val);
 
 extern void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd,
 				int result);
+
+extern int isst_clos_get_clos_information(int cpu, int *enable, int *type);
+extern void isst_clos_display_clos_information(int cpu, FILE *outf,
+					       int clos_enable, int type);
+
 #endif
-- 
2.17.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] tools/power/x86/intel-speed-select: New command and
  2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
                   ` (4 preceding siblings ...)
  2019-09-14  7:05 ` [PATCH 5/5] tools/power/x86/intel-speed-select: Extend core-power command set Srinivas Pandruvada
@ 2019-09-14 17:19 ` Andy Shevchenko
  2019-09-14 19:22   ` Srinivas Pandruvada
  5 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2019-09-14 17:19 UTC (permalink / raw)
  To: Srinivas Pandruvada; +Cc: platform-driver-x86, linux-kernel, prarit, darcari

On Sat, Sep 14, 2019 at 12:05:08AM -0700, Srinivas Pandruvada wrote:
> This series contains some minor fixes, when firmware mask is including
> invalid CPU in the perf-profile mask. Also add some commands to
> better manage core-power feature.

Hmm... 150+ LOCs doesn't count to me as minor fixes.
So, are you considering this a material for v5.4?


> Srinivas Pandruvada (4):
>   tools/power/x86/intel-speed-select: Allow online/offline based on tdp
>   tools/power/x86/intel-speed-select: Format get-assoc information
>   tools/power/x86/intel-speed-select: Fix some debug prints
>   tools/power/x86/intel-speed-select: Extend core-power command set
> 
> Youquan Song (1):
>   tools/power/x86/intel-speed-select: Fix high priority core mask over
>     count
> 
>  .../x86/intel-speed-select/isst-config.c      | 108 ++++++++++++++++--
>  .../power/x86/intel-speed-select/isst-core.c  |  25 ++++
>  .../x86/intel-speed-select/isst-display.c     |  51 +++++++++
>  tools/power/x86/intel-speed-select/isst.h     |   9 +-
>  4 files changed, 182 insertions(+), 11 deletions(-)
> 
> -- 
> 2.17.2
> 

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] tools/power/x86/intel-speed-select: New command and
  2019-09-14 17:19 ` [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Andy Shevchenko
@ 2019-09-14 19:22   ` Srinivas Pandruvada
  2019-09-14 19:48     ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Srinivas Pandruvada @ 2019-09-14 19:22 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: platform-driver-x86, linux-kernel, prarit, darcari

On Sat, 2019-09-14 at 20:19 +0300, Andy Shevchenko wrote:
> On Sat, Sep 14, 2019 at 12:05:08AM -0700, Srinivas Pandruvada wrote:
> > This series contains some minor fixes, when firmware mask is
> > including
> > invalid CPU in the perf-profile mask. Also add some commands to
> > better manage core-power feature.
> 
> Hmm... 150+ LOCs doesn't count to me as minor fixes.
> So, are you considering this a material for v5.4?
Sorry, I should be clear. It is for 5.4. I am trying to catch merge
window. None of the fixes are critical. The majority of the code is
added for new command features.

What is your cut off for 5.4? I want to send some more features if
possible for 5.4.

Thanks,
Srinivas

> 
> 
> > Srinivas Pandruvada (4):
> >   tools/power/x86/intel-speed-select: Allow online/offline based on
> > tdp
> >   tools/power/x86/intel-speed-select: Format get-assoc information
> >   tools/power/x86/intel-speed-select: Fix some debug prints
> >   tools/power/x86/intel-speed-select: Extend core-power command set
> > 
> > Youquan Song (1):
> >   tools/power/x86/intel-speed-select: Fix high priority core mask
> > over
> >     count
> > 
> >  .../x86/intel-speed-select/isst-config.c      | 108
> > ++++++++++++++++--
> >  .../power/x86/intel-speed-select/isst-core.c  |  25 ++++
> >  .../x86/intel-speed-select/isst-display.c     |  51 +++++++++
> >  tools/power/x86/intel-speed-select/isst.h     |   9 +-
> >  4 files changed, 182 insertions(+), 11 deletions(-)
> > 
> > -- 
> > 2.17.2
> > 
> 
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] tools/power/x86/intel-speed-select: New command and
  2019-09-14 19:22   ` Srinivas Pandruvada
@ 2019-09-14 19:48     ` Andy Shevchenko
  0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2019-09-14 19:48 UTC (permalink / raw)
  To: Srinivas Pandruvada
  Cc: Platform Driver, Linux Kernel Mailing List, Prarit Bhargava,
	David Arcari

On Sat, Sep 14, 2019 at 10:22 PM Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
>
> On Sat, 2019-09-14 at 20:19 +0300, Andy Shevchenko wrote:
> > On Sat, Sep 14, 2019 at 12:05:08AM -0700, Srinivas Pandruvada wrote:
> > > This series contains some minor fixes, when firmware mask is
> > > including
> > > invalid CPU in the perf-profile mask. Also add some commands to
> > > better manage core-power feature.
> >
> > Hmm... 150+ LOCs doesn't count to me as minor fixes.
> > So, are you considering this a material for v5.4?
> Sorry, I should be clear. It is for 5.4. I am trying to catch merge
> window. None of the fixes are critical. The majority of the code is
> added for new command features.
>
> What is your cut off for 5.4? I want to send some more features if
> possible for 5.4.

First PR already had been sent to Linus.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-14  7:05 [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Srinivas Pandruvada
2019-09-14  7:05 ` [PATCH 1/5] tools/power/x86/intel-speed-select: Fix high priority core mask over count Srinivas Pandruvada
2019-09-14  7:05 ` [PATCH 2/5] tools/power/x86/intel-speed-select: Allow online/offline based on tdp Srinivas Pandruvada
2019-09-14  7:05 ` [PATCH 3/5] tools/power/x86/intel-speed-select: Format get-assoc information Srinivas Pandruvada
2019-09-14  7:05 ` [PATCH 4/5] tools/power/x86/intel-speed-select: Fix some debug prints Srinivas Pandruvada
2019-09-14  7:05 ` [PATCH 5/5] tools/power/x86/intel-speed-select: Extend core-power command set Srinivas Pandruvada
2019-09-14 17:19 ` [PATCH 0/5] tools/power/x86/intel-speed-select: New command and Andy Shevchenko
2019-09-14 19:22   ` Srinivas Pandruvada
2019-09-14 19:48     ` Andy Shevchenko

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox