KNL divide by zero
Subsystems (2)
Srinivas Pandruvada
maintainerPATCH 1/1 KNL divide by zero
v1:
Fix bug for not reenabling interrupts
v0:
base version
Srinivas Pandruvada (1):
cpufreq: intel_pstate: divide by zero on Knights Landing (KNL)
drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)
Signature · 1 line
1.9.3
Srinivas Pandruvada
maintainerPATCH 1/1 cpufreq: intel_pstate: 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 +++++ 1 file changed, 5 insertions(+)
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);
Signature · 1 line
1.9.3
Rafael J. Wysocki
AppliedRe: [PATCH v1] cpufreq: intel_pstate: divide by zero on Knights Landing (KNL)
Quoted 6 lines · Srinivas Pandruvada
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.Signed-off-by Srinivas Pandruvada <[email protected]>
Applied.
I've also marked it for 4.1.y-stable (and later).
Kristen, please let me know if there are any concerns regarding this one.
Thanks,
Rafael
Re: [PATCH v1] cpufreq: intel_pstate: divide by zero on Knights Landing (KNL)
In reply to Srinivas PandruvadaQuoted 16 lines · On Thu, 15 Oct 2015 12:34:21 -0700 Srinivas Pandruvada…
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.Signed-off-by Srinivas Pandruvada <[email protected]>--- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/cpufreq/intel_pstate.c +0
-0@@ -776,6 +776,11 @@ static inline void intel_pstate_sample(struct cpudata *cpu)local_irq_save (flags);
drivers/cpufreq/intel_pstate.c static inline void intel_pstate_sample(struct cpudata *cpu) · line 786
Quoted 10 lines
drivers/cpufreq/intel_pstate.c +5
-0rdmsrl (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);