[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#859978: linux-cpupower: wrong turbo speeds reported on Nehalem



Control: tag -1 upstream patch

On Sun, 2017-04-09 at 22:26 +0200, GSR wrote:
> Package: linux-cpupower
> Version: 4.9.13-1
> Severity: normal
> 
> Dear Maintainer,
> 
> On i7-870 Nehalem, "cpupower frequency-info -n" reports the wrong
> speeds for boost states. It seems to take the right multipliers (24,
> 24, 26 and 27) but the wrong base clock (100 as per newer chips,
> instead of correct 133). Thus the reported speeds (2400-2700 Mhz) are
> even lower than the normal maximum (2934 Mhz). Output should be approx
> 3192-3591.
> 
> i7z tool figures the 100 vs 133 correctly (yet has other bug and says
> the chip to be Nehalem Haswell at the same time, which has been
> reported too). It may serve as reference to figure where to extract
> the proper clock value for the cpupower command.

I didn't believe this at first, but cpupower really does have this
hardware-specific information - and a silly bug which results in using
the wrong base clock, as you say.

I've attached the patch that should fix this.  Please either test this
patch or the modified packages (linux-cpupower & libcpupower1 version
4.9.18-2~a.test) from <https://people.debian.org/~benh/packages/>.

Ben.

-- 
Ben Hutchings
73.46% of all statistics are made up.
From: Ben Hutchings <ben@decadent.org.uk>
Date: Mon, 10 Apr 2017 17:44:13 +0100
Subject: cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores
Origin: https://git.kernel.org/linus/73f1b3551b088660eaa311edce6bd0842cebb38b
Bug-Debian: https://bugs.debian.org/859978

The switch that conditionally sets CPUPOWER_CAP_HAS_TURBO_RATIO and
CPUPOWER_CAP_IS_SNB flags is missing a break, so all cores get both
flags set and an assumed base clock of 100 MHz for turbo values.

Fixes: 8fb2e440b223 ("cpupower: Show Intel turbo ratio support via ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 tools/power/cpupower/utils/helpers/cpuid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/power/cpupower/utils/helpers/cpuid.c b/tools/power/cpupower/utils/helpers/cpuid.c
index 93b0aa74ca03..39c2c7d067bb 100644
--- a/tools/power/cpupower/utils/helpers/cpuid.c
+++ b/tools/power/cpupower/utils/helpers/cpuid.c
@@ -156,6 +156,7 @@ int get_cpu_info(unsigned int cpu, struct cpupower_cpu_info *cpu_info)
 					 */
 			case 0x2C:	/* Westmere EP - Gulftown */
 				cpu_info->caps |= CPUPOWER_CAP_HAS_TURBO_RATIO;
+				break;
 			case 0x2A:	/* SNB */
 			case 0x2D:	/* SNB Xeon */
 			case 0x3A:	/* IVB */

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: