linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] cpupower update for Linux 5.1-rc1
@ 2019-03-01 16:47 shuah
  2019-03-06  9:44 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: shuah @ 2019-03-01 16:47 UTC (permalink / raw)
  To: rafael; +Cc: Thomas Renninger, Linux Kernel Mailing List, linux-pm, shuah

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

Hi Rafael,

Please pull the following cpupower update for Linux 5.1-rc1.

This cpupower update for Linux 5.1-rc1 consists of a patch to add
support to display boost frequency separately from Abhishek Goel.

diff is attached.

thanks,
-- Shuah


----------------------------------------------------------------
The following changes since commit d13937116f1e82bf508a6325111b322c30c85eb9:

   Linux 5.0-rc6 (2019-02-10 14:42:20 -0800)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux 
tags/linux-cpupower-5.1-rc1

for you to fetch changes up to ae2917093fb60bdc1ed3e5757b74801420569a9a:

   tools/power/cpupower: Display boost frequency separately (2019-02-13 
09:26:17 -0700)

----------------------------------------------------------------
linux-cpupower-5.1-rc1

This cpupower update for Linux 5.1-rc1 consists of a patch to add
support to display boost frequency separately from Abhishek Goel.

----------------------------------------------------------------
Abhishek Goel (1):
       tools/power/cpupower: Display boost frequency separately

  tools/power/cpupower/lib/cpufreq.c        | 19 ++++++++------
  tools/power/cpupower/lib/cpufreq.h        | 16 ++++++------
  tools/power/cpupower/utils/cpufreq-info.c | 42 
+++++++++++++++++++++++--------
  3 files changed, 50 insertions(+), 27 deletions(-)
----------------------------------------------------------------

[-- Attachment #2: linux-cpupower-5.1-rc1.diff --]
[-- Type: text/x-patch, Size: 5198 bytes --]

diff --git a/tools/power/cpupower/lib/cpufreq.c b/tools/power/cpupower/lib/cpufreq.c
index 0c0f3e3f0d80..80650497fb80 100644
--- a/tools/power/cpupower/lib/cpufreq.c
+++ b/tools/power/cpupower/lib/cpufreq.c
@@ -333,17 +333,20 @@ void cpufreq_put_available_governors(struct cpufreq_available_governors *any)
 }
 
 
-struct cpufreq_available_frequencies
-*cpufreq_get_available_frequencies(unsigned int cpu)
+struct cpufreq_frequencies
+*cpufreq_get_frequencies(const char *type, unsigned int cpu)
 {
-	struct cpufreq_available_frequencies *first = NULL;
-	struct cpufreq_available_frequencies *current = NULL;
+	struct cpufreq_frequencies *first = NULL;
+	struct cpufreq_frequencies *current = NULL;
 	char one_value[SYSFS_PATH_MAX];
 	char linebuf[MAX_LINE_LEN];
+	char fname[MAX_LINE_LEN];
 	unsigned int pos, i;
 	unsigned int len;
 
-	len = sysfs_cpufreq_read_file(cpu, "scaling_available_frequencies",
+	snprintf(fname, MAX_LINE_LEN, "scaling_%s_frequencies", type);
+
+	len = sysfs_cpufreq_read_file(cpu, fname,
 				linebuf, sizeof(linebuf));
 	if (len == 0)
 		return NULL;
@@ -389,9 +392,9 @@ struct cpufreq_available_frequencies
 	return NULL;
 }
 
-void cpufreq_put_available_frequencies(struct cpufreq_available_frequencies
-				*any) {
-	struct cpufreq_available_frequencies *tmp, *next;
+void cpufreq_put_frequencies(struct cpufreq_frequencies *any)
+{
+	struct cpufreq_frequencies *tmp, *next;
 
 	if (!any)
 		return;
diff --git a/tools/power/cpupower/lib/cpufreq.h b/tools/power/cpupower/lib/cpufreq.h
index 60beaf5ed2ea..775738269cbf 100644
--- a/tools/power/cpupower/lib/cpufreq.h
+++ b/tools/power/cpupower/lib/cpufreq.h
@@ -28,10 +28,10 @@ struct cpufreq_available_governors {
 	struct cpufreq_available_governors *first;
 };
 
-struct cpufreq_available_frequencies {
+struct cpufreq_frequencies {
 	unsigned long frequency;
-	struct cpufreq_available_frequencies *next;
-	struct cpufreq_available_frequencies *first;
+	struct cpufreq_frequencies *next;
+	struct cpufreq_frequencies *first;
 };
 
 
@@ -129,14 +129,14 @@ void cpufreq_put_available_governors(
  *
  * Only present on _some_ ->target() cpufreq drivers. For information purposes
  * only. Please free allocated memory by calling
- * cpufreq_put_available_frequencies after use.
+ * cpufreq_put_frequencies after use.
  */
 
-struct cpufreq_available_frequencies
-*cpufreq_get_available_frequencies(unsigned int cpu);
+struct cpufreq_frequencies
+*cpufreq_get_frequencies(const char *type, unsigned int cpu);
 
-void cpufreq_put_available_frequencies(
-		struct cpufreq_available_frequencies *first);
+void cpufreq_put_frequencies(
+		struct cpufreq_frequencies *first);
 
 
 /* determine affected CPUs
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c
index c3f39d5128ee..10290b308797 100644
--- a/tools/power/cpupower/utils/cpufreq-info.c
+++ b/tools/power/cpupower/utils/cpufreq-info.c
@@ -161,19 +161,12 @@ static void print_duration(unsigned long duration)
 	return;
 }
 
-/* --boost / -b */
-
-static int get_boost_mode(unsigned int cpu)
+static int get_boost_mode_x86(unsigned int cpu)
 {
 	int support, active, b_states = 0, ret, pstate_no, i;
 	/* ToDo: Make this more global */
 	unsigned long pstates[MAX_HW_PSTATES] = {0,};
 
-	if (cpupower_cpu_info.vendor != X86_VENDOR_AMD &&
-	    cpupower_cpu_info.vendor != X86_VENDOR_HYGON &&
-	    cpupower_cpu_info.vendor != X86_VENDOR_INTEL)
-		return 0;
-
 	ret = cpufreq_has_boost_support(cpu, &support, &active, &b_states);
 	if (ret) {
 		printf(_("Error while evaluating Boost Capabilities"
@@ -248,6 +241,33 @@ static int get_boost_mode(unsigned int cpu)
 	return 0;
 }
 
+/* --boost / -b */
+
+static int get_boost_mode(unsigned int cpu)
+{
+	struct cpufreq_frequencies *freqs;
+
+	if (cpupower_cpu_info.vendor == X86_VENDOR_AMD ||
+	    cpupower_cpu_info.vendor == X86_VENDOR_HYGON ||
+	    cpupower_cpu_info.vendor == X86_VENDOR_INTEL)
+		return get_boost_mode_x86(cpu);
+
+	freqs = cpufreq_get_frequencies("boost", cpu);
+	if (freqs) {
+		printf(_("  boost frequency steps: "));
+		while (freqs->next) {
+			print_speed(freqs->frequency);
+			printf(", ");
+			freqs = freqs->next;
+		}
+		print_speed(freqs->frequency);
+		printf("\n");
+		cpufreq_put_frequencies(freqs);
+	}
+
+	return 0;
+}
+
 /* --freq / -f */
 
 static int get_freq_kernel(unsigned int cpu, unsigned int human)
@@ -456,7 +476,7 @@ static int get_latency(unsigned int cpu, unsigned int human)
 
 static void debug_output_one(unsigned int cpu)
 {
-	struct cpufreq_available_frequencies *freqs;
+	struct cpufreq_frequencies *freqs;
 
 	get_driver(cpu);
 	get_related_cpus(cpu);
@@ -464,7 +484,7 @@ static void debug_output_one(unsigned int cpu)
 	get_latency(cpu, 1);
 	get_hardware_limits(cpu, 1);
 
-	freqs = cpufreq_get_available_frequencies(cpu);
+	freqs = cpufreq_get_frequencies("available", cpu);
 	if (freqs) {
 		printf(_("  available frequency steps:  "));
 		while (freqs->next) {
@@ -474,7 +494,7 @@ static void debug_output_one(unsigned int cpu)
 		}
 		print_speed(freqs->frequency);
 		printf("\n");
-		cpufreq_put_available_frequencies(freqs);
+		cpufreq_put_frequencies(freqs);
 	}
 
 	get_available_governors(cpu);

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

* Re: [GIT PULL] cpupower update for Linux 5.1-rc1
  2019-03-01 16:47 [GIT PULL] cpupower update for Linux 5.1-rc1 shuah
@ 2019-03-06  9:44 ` Rafael J. Wysocki
  2019-03-06 14:28   ` shuah
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2019-03-06  9:44 UTC (permalink / raw)
  To: shuah
  Cc: Rafael J. Wysocki, Thomas Renninger, Linux Kernel Mailing List, Linux PM

Hi Shuah,

On Fri, Mar 1, 2019 at 5:47 PM shuah <shuah@kernel.org> wrote:
>
> Hi Rafael,
>
> Please pull the following cpupower update for Linux 5.1-rc1.
>
> This cpupower update for Linux 5.1-rc1 consists of a patch to add
> support to display boost frequency separately from Abhishek Goel.
>
> diff is attached.

Pulled, but since my own pull requests have been sent already, this
will have to wait for the second half of the merge window.

Thanks!

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

* Re: [GIT PULL] cpupower update for Linux 5.1-rc1
  2019-03-06  9:44 ` Rafael J. Wysocki
@ 2019-03-06 14:28   ` shuah
  0 siblings, 0 replies; 3+ messages in thread
From: shuah @ 2019-03-06 14:28 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Thomas Renninger, Linux Kernel Mailing List, Linux PM, shuah

Hi Rafael,

On 3/6/19 2:44 AM, Rafael J. Wysocki wrote:
> Hi Shuah,
> 
> On Fri, Mar 1, 2019 at 5:47 PM shuah <shuah@kernel.org> wrote:
>>
>> Hi Rafael,
>>
>> Please pull the following cpupower update for Linux 5.1-rc1.
>>
>> This cpupower update for Linux 5.1-rc1 consists of a patch to add
>> support to display boost frequency separately from Abhishek Goel.
>>
>> diff is attached.
> 
> Pulled, but since my own pull requests have been sent already, this
> will have to wait for the second half of the merge window.
> 
> Thanks!
>

Second half of the merge window works just fine.

thanks,
-- Shuah



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

end of thread, other threads:[~2019-03-06 14:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 16:47 [GIT PULL] cpupower update for Linux 5.1-rc1 shuah
2019-03-06  9:44 ` Rafael J. Wysocki
2019-03-06 14:28   ` shuah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).