<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:10.5pt;">
<div align="left" style="text-align:justify;">The following commit is from 4.3 kernel which fix devide by zero in intel P state driver on KNL.</div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
<div align="left" style="text-align:justify;">commit 8e601a9f97a00bab031980de34f9a81891c1f82f</div>
<div align="left" style="text-align:justify;">Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com></div>
<div align="left" style="text-align:justify;">Date: Thu Oct 15 12:34:21 2015 -0700</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;"> cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL)</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;"> This is a workaround for KNL platform, where in some cases MPERF counter</div>
<div align="left" style="text-align:justify;"> will not have updated value before next read of MSR_IA32_MPERF. In this</div>
<div align="left" style="text-align:justify;"> case divide by zero will occur. This change ignores current sample for</div>
<div align="left" style="text-align:justify;"> busy calculation in this case.</div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;"> Fixes: b34ef932d79a (intel_pstate: Knights Landing support)</div>
<div align="left" style="text-align:justify;"> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com></div>
<div align="left" style="text-align:justify;"> Acked-by: Kristen Carlson Accardi <kristen@linux.intel.com></div>
<div align="left" style="text-align:justify;"> Cc: 4.1+ <stable@vger.kernel.org> # 4.1+</div>
<div align="left" style="text-align:justify;"> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com></div>
<div align="left" style="text-align:justify;"> </div>
<div align="left" style="text-align:justify;">diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c</div>
<div align="left" style="text-align:justify;">index 3af9dd7..aa33b92 100644</div>
<div align="left" style="text-align:justify;">--- a/drivers/cpufreq/intel_pstate.c</div>
<div align="left" style="text-align:justify;">+++ b/drivers/cpufreq/intel_pstate.c</div>
<div align="left" style="text-align:justify;">@@ -776,6 +776,11 @@ static inline void intel_pstate_sample(struct cpudata *cpu)</div>
<div align="left" style="text-align:justify;"> local_irq_save(flags);</div>
<div align="left" style="text-align:justify;"> rdmsrl(MSR_IA32_APERF, aperf);</div>
<div align="left" style="text-align:justify;"> rdmsrl(MSR_IA32_MPERF, mperf);</div>
<div align="left" style="text-align:justify;">+ if (cpu->prev_mperf == mperf) {</div>
<div align="left" style="text-align:justify;">+ local_irq_restore(flags);</div>
<div align="left" style="text-align:justify;">+ return;</div>
<div align="left" style="text-align:justify;">+ }</div>
<div align="left" style="text-align:justify;">+</div>
<div align="left" style="text-align:justify;"> tsc = rdtsc();</div>
<div align="left" style="text-align:justify;"> local_irq_restore(flags);</div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
<div align="left" style="text-align:justify;">thanks</div>
<div align="left" style="text-align:justify;"><font face="Times New Roman"> </font></div>
</span></font>
</body>
</html>