Skip to contentSkip to conversation

cpupower: Fix no-rounding MHz frequency output

PATCH In review Prarit Bhargava 5 participants 17 messages Oct 25, 2017 – Nov 2, 2017 CPU power monitoring

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cpupower: Fix no-rounding MHz frequency output

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -2
index 3e701f0e9c14..df43cd45d810 100644
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
 		if (speed > 1000000)
 			printf("%u.%06u GHz", ((unsigned int) speed/1000000),
 				((unsigned int) speed%1000000));
-		else if (speed > 100000)
-			printf("%u MHz", (unsigned int) speed);
 		else if (speed > 1000)
 			printf("%u.%03u MHz", ((unsigned int) speed/1000),
 				(unsigned int) (speed%1000));
Signature · 1 line
2.15.0.rc0.39.g2f0e14e64
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

Quoted 8 lines

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
Quoted 20 lines
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -2
index 3e701f0e9c14..df43cd45d810 100644
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
 		if (speed > 1000000)
 			printf("%u.%06u GHz", ((unsigned int) speed/1000000),
 				((unsigned int) speed%1000000));
-		else if (speed > 100000)
-			printf("%u MHz", (unsigned int) speed);
 		else if (speed > 1000)
 			printf("%u.%03u MHz", ((unsigned int) speed/1000),
 				(unsigned int) (speed%1000));
Signature · 1 line
2.15.0.rc0.39.g2f0e14e64
maintainer
#2 lore raw
Quoted 14 lines · Stafford Horne
Quoted 13 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

Quoted 8 lines
Quoted 6 lines

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>

Thanks for the review.

-- Shuah

Quoted 23 lines
Quoted 21 lines
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -2
index 3e701f0e9c14..df43cd45d810 100644
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
 		if (speed > 1000000)
 			printf("%u.%06u GHz", ((unsigned int) speed/1000000),
 				((unsigned int) speed%1000000));
-		else if (speed > 100000)
-			printf("%u MHz", (unsigned int) speed);
 		else if (speed > 1000)
 			printf("%u.%03u MHz", ((unsigned int) speed/1000),
 				(unsigned int) (speed%1000));
Signature · 1 line
2.15.0.rc0.39.g2f0e14e64
maintainer
#3 lore raw
In reply to Prarit Bhargava
Quoted 29 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
 		if (speed > 1000000)
 			printf("%u.%06u GHz", ((unsigned int) speed/1000000),
 				((unsigned int) speed%1000000));
-		else if (speed > 100000)
-			printf("%u MHz", (unsigned int) speed);
 		else if (speed > 1000)
 			printf("%u.%03u MHz", ((unsigned int) speed/1000),
 				(unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

-- Shuah

#4 lore raw
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

So are you going to maintain this utility going forward?

Thanks,
Rafael

#5 lore raw
Quoted 42 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

Quoted 4 lines

OK

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

thanks,
-- Shuah

#6 lore raw
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Thanks,
Rafael

#7 lore raw
Quoted 58 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Quoted 8 lines

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

thanks,
-- Shuah

#8 lore raw
Quoted 64 lines · Shuah Khan
Quoted 63 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

Quoted 6 lines
Quoted 3 lines

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Thanks,
Rafael

#9 lore raw
Quoted 69 lines · Rafael J. Wysocki
Quoted 68 lines · Shuah Khan
Quoted 66 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Quoted 8 lines
Quoted 2 lines

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Sounds like a plan. I can do that. I will work on getting git setup and send pull requests. We can get that going for 4.15 unless you think it is late for you to get pull requests.

thanks,
-- Shuah

#10 lore raw
Quoted 75 lines · Shuah Khan
Quoted 74 lines · Rafael J. Wysocki
Quoted 64 lines · Shuah Khan
Quoted 63 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

Quoted 6 lines
Quoted 3 lines

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

Quoted 7 lines
Quoted 3 lines

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Sounds like a plan. I can do that. I will work on getting git setup and send pull requests. We can get that going for 4.15 unless you think it is late for you to get pull requests.

That should be fine. There still is a couple of days at least before the merge window. :-)

#11 lore raw
In reply to Shuah Khan
Quoted 75 lines · Shuah Khan
Quoted 74 lines · Rafael J. Wysocki
Quoted 64 lines · Shuah Khan
Quoted 63 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

Quoted 6 lines
Quoted 3 lines

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

Quoted 7 lines
Quoted 3 lines

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Sounds like a plan. I can do that. I will work on getting git setup and send pull requests. We can get that going for 4.15 unless you think it is late for you to get pull requests.

Shuah, I have two other cleanup patches that should be applied to cpupower. I will post them shortly.

P.

Quoted 4 lines

thanks,
-- Shuah

#12 lore raw
Quoted 82 lines · Prarit Bhargava
Quoted 79 lines · Shuah Khan
Quoted 77 lines · Rafael J. Wysocki
Quoted 64 lines · Shuah Khan
Quoted 63 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

Quoted 6 lines
Quoted 3 lines

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Quoted 7 lines
Quoted 3 lines

Sounds like a plan. I can do that. I will work on getting git setup and send pull requests. We can get that going for 4.15 unless you think it is late for you to get pull requests.

Shuah, I have two other cleanup patches that should be applied to cpupower. I will post them shortly.

Hi Prarit,

Does this tool build for you? I am seeing:

utils/helpers/amd.c:7:21: fatal error: pci/pci.h: No such file or directory

 #include <pci/pci.h>
                     ^

compilation terminated.
Makefile:221: recipe for target 'utils/helpers/amd.o' failed
make: *** [utils/helpers/amd.o] Error 1

thanks,
-- Shuah

#13 lore raw
Quoted 93 lines · Shuah Khan
Quoted 82 lines · Prarit Bhargava
Quoted 79 lines · Shuah Khan
Quoted 77 lines · Rafael J. Wysocki
Quoted 64 lines · Shuah Khan
Quoted 63 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

Quoted 6 lines
Quoted 3 lines

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Quoted 7 lines
Quoted 3 lines

Sounds like a plan. I can do that. I will work on getting git setup and send pull requests. We can get that going for 4.15 unless you think it is late for you to get pull requests.

Shuah, I have two other cleanup patches that should be applied to cpupower. I will post them shortly.

Hi Prarit,

Quoted 9 lines

Does this tool build for you? I am seeing:

utils/helpers/amd.c:7:21: fatal error: pci/pci.h: No such file or directory

 #include <pci/pci.h>
                     ^

compilation terminated.
Makefile:221: recipe for target 'utils/helpers/amd.o' failed
make: *** [utils/helpers/amd.o] Error 1

It does not build on latest due to some other unrelated change. I'm looking at it now.

P.

Quoted 3 lines

thanks,
-- Shuah

#14 lore raw
In reply to Shuah Khan
Quoted 93 lines · Shuah Khan
Quoted 82 lines · Prarit Bhargava
Quoted 79 lines · Shuah Khan
Quoted 77 lines · Rafael J. Wysocki
Quoted 64 lines · Shuah Khan
Quoted 63 lines · Rafael J. Wysocki
Quoted 45 lines · Shuah Khan
Quoted 44 lines · Rafael J. Wysocki
Quoted 24 lines · Shuah Khan
Quoted 23 lines · Prarit Bhargava

'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns

hardware limits: 800000 MHz - 4.200000 GHz

The code that causes this error can be removed. The next else if clause will handle the output correctly such that

hardware limits: 800.000 MHz - 4.200000 GHz

is displayed correctly.

[v2]: Remove two lines instead of fixing broken code.

Cc Thomas Renninger <[email protected]>
Cc Stafford Horne <[email protected]>
Cc Shuah Khan <[email protected]>
---
 tools/power/cpupower/utils/cpufreq-info.c | 2 --
 1 file changed, 2 deletions(-)
Quoted 16 lines
Quoted 6 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -0
index 3e701f0e9c14..df43cd45d810 100644

tools/power/cpupower/utils/cpufreq-info.c static void print_speed(unsigned long speed) · line 98

Quoted 8 lines
tools/power/cpupower/utils/cpufreq-info.c +0 -2
@@ -93,8 +93,6 @@ static void print_speed(unsigned long speed)
              if (speed > 1000000)
                      printf("%u.%06u GHz", ((unsigned int) speed/1000000),
                              ((unsigned int) speed%1000000));
-             else if (speed > 100000)
-                     printf("%u MHz", (unsigned int) speed);
              else if (speed > 1000)
                      printf("%u.%03u MHz", ((unsigned int) speed/1000),
                              (unsigned int) (speed%1000));

Thanks. I will queue this up for 4.15-rc1.

OK

Quoted 7 lines
Quoted 2 lines

So are you going to maintain this utility going forward?

oops. I was on auto-pilot responding to patches sitting in my Inbox. Wrong email response. Sorry about that.

Please ignore. Mu bad.

OK :-)

But that said, from my perspective, cpupower is basically not maintained.

Thomas, who sort of maintained it, but then basically became a patch reviewer for it, does not respond to patches any more and I am not sufficiently familiar with the code to be able to effectively review the patches myself, nor I have the time to get more familiar with it.

Quoted 6 lines
Quoted 3 lines

For this reason, I'm inclined to drop this code from the kernel source tree unless somebody steps in to fill the gap.

Please don't drop this from kernel sources.. I think this is useful. If you are looking for a maintainer, I will be happy to step up to maintain it.

Cool, please do that then. :-)

I will be happy to take pull requests with cpupower changes so that they go in along with the other PM material.

Quoted 7 lines
Quoted 3 lines

Sounds like a plan. I can do that. I will work on getting git setup and send pull requests. We can get that going for 4.15 unless you think it is late for you to get pull requests.

Shuah, I have two other cleanup patches that should be applied to cpupower. I will post them shortly.

Hi Prarit,

Quoted 8 lines

Does this tool build for you? I am seeing:

utils/helpers/amd.c:7:21: fatal error: pci/pci.h: No such file or directory

 #include <pci/pci.h>
                     ^

compilation terminated.
Makefile:221: recipe for target 'utils/helpers/amd.o' failed
make: *** [utils/helpers/amd.o] Error 1

This is strange. I saw it, tried a git-bisect and now I can't reproduce it. I'll check out a new tree and see if I can make this reproduce.

P.

Quoted 4 lines

thanks,
-- Shuah

#15 lore raw
In reply to Shuah Khan
Quoted 4 lines · Shuah Khan

On 11/01/2017 06:42 PM, Prarit Bhargava wrote:

Hi Prarit,

Quoted 9 lines

Does this tool build for you? I am seeing:

utils/helpers/amd.c:7:21: fatal error: pci/pci.h: No such file or directory

 #include <pci/pci.h>
                     ^

compilation terminated.
Makefile:221: recipe for target 'utils/helpers/amd.o' failed
make: *** [utils/helpers/amd.o] Error 1

Got it ... you have to have the pciutils-devel package installed which installs /usr/include/pci/pci.h.

That file contains:

struct pci_access {
/* Options you can change: */

  unsigned int method;                  /* Access method */
  int writeable;                        /* Open in read/write mode */
  int buscentric;                       /* Bus-centric view of the world */

<snip>

P.

Quoted 3 lines

thanks,
-- Shuah

#16 lore raw
Quoted 20 lines · Prarit Bhargava
Quoted 4 lines · Shuah Khan

On 11/01/2017 06:42 PM, Prarit Bhargava wrote:

Hi Prarit,

Quoted 9 lines

Does this tool build for you? I am seeing:

utils/helpers/amd.c:7:21: fatal error: pci/pci.h: No such file or directory

 #include <pci/pci.h>
                     ^

compilation terminated.
Makefile:221: recipe for target 'utils/helpers/amd.o' failed
make: *** [utils/helpers/amd.o] Error 1

Got it ... you have to have the pciutils-devel package installed which installs /usr/include/pci/pci.h.

Quoted 9 lines

That file contains:

struct pci_access {
/* Options you can change: */

  unsigned int method;                  /* Access method */
  int writeable;                        /* Open in read/write mode */
  int buscentric;                       /* Bus-centric view of the world */

<snip>

Thanks for looking into this.

-- Shuah