From patchwork Tue Oct 15 18:06:14 2013 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: 3047221 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 22CE9BF924 for ; Tue, 15 Oct 2013 18:06:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86A4620435 for ; Tue, 15 Oct 2013 18:06:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72EA42042A for ; Tue, 15 Oct 2013 18:06:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933145Ab3JOSGY (ORCPT ); Tue, 15 Oct 2013 14:06:24 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:62424 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932760Ab3JOSGY (ORCPT ); Tue, 15 Oct 2013 14:06:24 -0400 Received: by mail-pb0-f47.google.com with SMTP id rr4so9061737pbb.20 for ; Tue, 15 Oct 2013 11:06:23 -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; bh=fI1FybQzxKhRCxQ9n69o0u1F3p6m0nBJzDs43FrmkHI=; b=Sz3ZT39tWosMUeF++S64fBzPZb0lny3H1ThS8/9vc3TIVr8DvQDd1ADvZU8/OMl58X EECF+vqsi9VU2hfOptV65lfpgcvkdNgg+noVzRUUIyCS3pTVLrb4f1//CybS5OZYtTaL l1mPudAqxkwwll3lHGDSwDgLpLc0U3/I1SQlMbKMNzeRpwaJo5qRJMerL948Jd2ZFSDt AO3QnpYEEsG7cy6tX7jNrI1HW9ht80uL+F/65xp+X0PQUhXTQLklP03WfU1DeaFB7LfU QsszXI19YDXMoIy+5+S0A5iNBa8ExJAmHEoBdNWD3PSgnaLGARt4asYJigq7KuFNvMzp sPjQ== X-Received: by 10.68.134.133 with SMTP id pk5mr42936932pbb.89.1381860382337; Tue, 15 Oct 2013 11:06:22 -0700 (PDT) Received: from echolake.localdomain (static-50-43-59-152.bvtn.or.frontiernet.net. [50.43.59.152]) by mx.google.com with ESMTPSA id ry4sm100658517pab.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Oct 2013 11:06:21 -0700 (PDT) From: dirk.brandewie@gmail.com To: linux-pm@vger.kernel.org, rjw@rjwysocki.net Cc: Dirk Brandewie , stable@vger.kernel.org Subject: [PATCH] cpfreq/intel_pstate: Fix max_perf_pct on resume Date: Tue, 15 Oct 2013 11:06:14 -0700 Message-Id: <1381860374-29681-1-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 If the system is suspended while max_perf_pct is less than 100 percent or no_turbo set policy->{min,max} will be set incorrectly with scaled values which turn the scaled values into hard limits. Fixes https://bugzilla.kernel.org/show_bug.cgi?id=61241 Reported-by: Patrick Bartels Signed-off-by: Dirk Brandewie Cc: stable@vger.kernel.org --- drivers/cpufreq/intel_pstate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 32b3479..3335f55 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -652,9 +652,8 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) else policy->policy = CPUFREQ_POLICY_POWERSAVE; - intel_pstate_get_min_max(cpu, &min_pstate, &max_pstate); - policy->min = min_pstate * 100000; - policy->max = max_pstate * 100000; + policy->min = cpu->pstate.min_pstate * 100000; + policy->max = cpu->pstate.turbo_pstate * 100000; /* cpuinfo and default policy values */ policy->cpuinfo.min_freq = cpu->pstate.min_pstate * 100000;