[SRU][wily] Fix KNL Intel P State driver divide by zero
Tim Gardner
tim.gardner at canonical.com
Tue Oct 20 12:40:29 UTC 2015
On 10/20/2015 02:40 AM, Zhang, Xiong Y wrote:
> The following commit is from 4.3 kernel which fix devide by zero in
> intel P state driver on KNL.
>
> commit 8e601a9f97a00bab031980de34f9a81891c1f82f
> Author: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>
> Date: Thu Oct 15 12:34:21 2015 -0700
>
> 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.
>
> Fixes: b34ef932d79a (intel_pstate: Knights Landing support)
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>
> Acked-by: Kristen Carlson Accardi <kristen at linux.intel.com>
> Cc: 4.1+ <stable at vger.kernel.org> # 4.1+
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 3af9dd7..aa33b92 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -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);
>
> thanks
>
>
>
Wily is now subject to SRU policies. Do you have a bug report for this
patch ?
rtg
--
Tim Gardner tim.gardner at canonical.com
More information about the kernel-team
mailing list