FAILED: patch "[PATCH] cpufreq: intel_pstate: Fix divide by zero on Knights Landing" failed to apply to 4.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
8e601a9f97a00bab031980de34f9a81891c1f82fMon Sep 17 00:00:00 2001
From: Srinivas Pandruvada <[email protected]>
Date: Thu, 15 Oct 2015 12:34:21 -0700
Subject: [PATCH] cpufreq: intel_pstate: Fix divide by zero on Knights Landing
(KNL)
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.
drivers/cpufreq/intel_pstate.c +5 -0
@@ -776,6 +776,11 @@ static inline void intel_pstate_sample(struct cpudata *cpu)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 =rdtsc ();local_irq_restore (flags);