From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57284 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032145AbbKFG6q (ORCPT ); Fri, 6 Nov 2015 01:58:46 -0500 Subject: Patch "cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL)" has been added to the 4.2-stable tree To: srinivas.pandruvada@linux.intel.com, gregkh@linuxfoundation.org, kristen@linux.intel.com, rafael.j.wysocki@intel.com Cc: , From: Date: Thu, 05 Nov 2015 22:58:44 -0800 Message-ID: <1446793124233170@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 8e601a9f97a00bab031980de34f9a81891c1f82f Mon Sep 17 00:00:00 2001 From: Srinivas Pandruvada Date: Thu, 15 Oct 2015 12:34:21 -0700 Subject: cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL) From: Srinivas Pandruvada 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) Signed-off-by: Srinivas Pandruvada Acked-by: Kristen Carlson Accardi Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -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 srinivas.pandruvada@linux.intel.com are queue-4.2/cpufreq-intel_pstate-fix-divide-by-zero-on-knights-landing-knl.patch