From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srinivas Pandruvada Subject: Re: [PATCH] cpufreq: intel_pstate: Fix processing for turbo activation ratio Date: Mon, 25 Apr 2016 09:28:30 -0700 Message-ID: <1461601710.8946.209.camel@linux.intel.com> References: <1461380039-13804-1-git-send-email-srinivas.pandruvada@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mga09.intel.com ([134.134.136.24]:42035 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933032AbcDYQ2N (ORCPT ); Mon, 25 Apr 2016 12:28:13 -0400 In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , "linux-pm@vger.kernel.org" On Mon, 2016-04-25 at 15:48 +0200, Rafael J. Wysocki wrote: > On Sat, Apr 23, 2016 at 4:53 AM, Srinivas Pandruvada > wrote: > >=20 > > When the config TDP level is not nominal (level =3D 0), the MSR > > values for > > reading level 1 and level 2 ratios contain power in low 14 bits and > > actual > > ratio bits are at bits [23:16]. The current processing for level 1 > > and > > level 2 is wrong as there is no shift done to get actual ratio. > >=20 > > Signed-off-by: Srinivas Pandruvada > .com> > Since this is a fix, do we need it in v4.6? >=20 This impact the display of turbo_pct in Intel P-state sysfs. So if not too late, I prefer for v4.6. =C2=A0 > Do we want it in -stable too and in what -stable if so? 4.4 onward. >=20 Thanks, Srinivas >=20 > >=20 > > --- > > =C2=A0drivers/cpufreq/intel_pstate.c | 4 ++++ > > =C2=A01 file changed, 4 insertions(+) > >=20 > > diff --git a/drivers/cpufreq/intel_pstate.c > > b/drivers/cpufreq/intel_pstate.c > > index 1b2767d..03f94c2 100644 > > --- a/drivers/cpufreq/intel_pstate.c > > +++ b/drivers/cpufreq/intel_pstate.c > > @@ -813,6 +813,10 @@ static int core_get_max_pstate(void) > > =C2=A0=C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