Skip to contentSkip to conversation

Patch "cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL)" has been added to the 4.2-stable tree

PATCH [email protected] 1 participant 1 message Nov 6, 2015

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL)

to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
cpufreq-intel_pstate-fix-divide-by-zero-on-knights-landing-knl.patch
and it can be found in the queue-4.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 8e601a9f97a00bab031980de34f9a81891c1f82f Mon Sep 17 00:00:00 2001

From: Srinivas Pandruvada <[email protected]>
Date: Thu, 15 Oct 2015 12:34:21 -0700
Subject: cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL)

From: Srinivas Pandruvada <[email protected]>

commit 8e601a9f97a00bab031980de34f9a81891c1f82f upstream.

This is a workaround for KNL platform, where in some cases MPERF counter will not have updated value before next read of MSR_IA32_MPERF. In this case divide by zero will occur. This change ignores current sample for busy calculation in this case.

Fixes b34ef932d79a (intel_pstate: Knights Landing support)
---
 drivers/cpufreq/intel_pstate.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/cpufreq/intel_pstate.c +5 -0
@@ -766,6 +766,11 @@ static inline void intel_pstate_sample(s
 	local_irq_save(flags);
 	rdmsrl(MSR_IA32_APERF, aperf);
 	rdmsrl(MSR_IA32_MPERF, mperf);
+	if (cpu->prev_mperf == mperf) {
+		local_irq_restore(flags);
+		return;
+	}
+
 	tsc = native_read_tsc();
 	local_irq_restore(flags);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.2/cpufreq-intel_pstate-fix-divide-by-zero-on-knights-landing-knl.patch