From patchwork Fri Jun 20 14:27:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 4389771 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79DE3BEEAA for ; Fri, 20 Jun 2014 14:28:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48714203C4 for ; Fri, 20 Jun 2014 14:28:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BC3F203E3 for ; Fri, 20 Jun 2014 14:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbaFTO2N (ORCPT ); Fri, 20 Jun 2014 10:28:13 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:38213 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbaFTO2M (ORCPT ); Fri, 20 Jun 2014 10:28:12 -0400 Received: by mail-pb0-f42.google.com with SMTP id ma3so3196581pbc.29 for ; Fri, 20 Jun 2014 07:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9oo+zXKxjbr7v1snerKTk1H7F9TqWZtlTUz/dYa9Mtc=; b=dYHB8IsNt7nWot8Da4/spNLtKjWeMlpQv+LpR+c7Y8DUuJe1lcMqt6NeLHZcOBUv2Y Y6Bw8IIE3DYaVUFzakB2oBRCHaQJwqERAb0+y8zVt4lkxRh6AOjeR6coDk9oE8sDQmkN zZzv3mR6rd2sE6CkRFwkJUJgHRd5DgluDU96k7OKLEzJpuq+6BrvwPto8TU6ZMkmQiqj pRP0ics6FdaE7GtFE6XmEjGYSnsAFzUn8ycgFPjZU39PhkhTDottomejlUEEs8NORxn3 eYxzh48Ae/P9JTgydBpMpUkpsb+86akHDWoTWG3z6D6mwCzFl9dNmUL43j/ONVjf6pPh wopw== X-Received: by 10.66.122.70 with SMTP id lq6mr5211252pab.51.1403274491745; Fri, 20 Jun 2014 07:28:11 -0700 (PDT) Received: from echolake.localdomain (static-50-43-41-81.bvtn.or.frontiernet.net. [50.43.41.81]) by mx.google.com with ESMTPSA id vx10sm44287848pac.17.2014.06.20.07.28.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jun 2014 07:28:10 -0700 (PDT) From: dirk.brandewie@gmail.com X-Google-Original-From: dirk.j.brandewie@intel.com To: linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, dirk.brandewie@gmail.com, stable@vger.kernel.org, Dirk Brandewie Subject: [PATCH 1/3] intel_pstate: Fix setting VID Date: Fri, 20 Jun 2014 07:27:58 -0700 Message-Id: <1403274480-10593-2-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1403274480-10593-1-git-send-email-dirk.j.brandewie@intel.com> References: <1403274480-10593-1-git-send-email-dirk.j.brandewie@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dirk Brandewie Commit 21855ff5 intel_pstate: Set turbo VID for BayTrail introduced setting the turbo VID which is required to prevent a machine check on some Baytrail SKUs under heavy graphics based workloads. The docmumentation update that brought the requirement to light also changed the bit mask used for enumerating P state and VID values from 0x7f to 0x3f. This change returns the mask value to 0x7f. Tested with the Intel NUC DN2820FYK, BIOS version FYBYT10H.86A.0034.2014.0513.1413 with v3.16-rc1 and v3.14.8 kernel versions. Reported-by: Rune Reterson Reported-by: Eric Eickmeyer Tested-by: Rune Reterson Tested-by: Eric Eickmeyer References: https://bugzilla.kernel.org/show_bug.cgi?id=77951 Cc: Cc: Stable [3.13+] Signed-off-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 924bb2d..74376d6 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -357,21 +357,21 @@ static int byt_get_min_pstate(void) { u64 value; rdmsrl(BYT_RATIOS, value); - return (value >> 8) & 0x3F; + return (value >> 8) & 0x7F; } static int byt_get_max_pstate(void) { u64 value; rdmsrl(BYT_RATIOS, value); - return (value >> 16) & 0x3F; + return (value >> 16) & 0x7F; } static int byt_get_turbo_pstate(void) { u64 value; rdmsrl(BYT_TURBO_RATIOS, value); - return value & 0x3F; + return value & 0x7F; } static void byt_set_pstate(struct cpudata *cpudata, int pstate) @@ -405,8 +405,8 @@ static void byt_get_vid(struct cpudata *cpudata) rdmsrl(BYT_VIDS, value); - cpudata->vid.min = int_tofp((value >> 8) & 0x3f); - cpudata->vid.max = int_tofp((value >> 16) & 0x3f); + cpudata->vid.min = int_tofp((value >> 8) & 0x7f); + cpudata->vid.max = int_tofp((value >> 16) & 0x7f); cpudata->vid.ratio = div_fp( cpudata->vid.max - cpudata->vid.min, int_tofp(cpudata->pstate.max_pstate -