From patchwork Thu May 8 19:57:26 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: 4138491 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 D0367BFF02 for ; Thu, 8 May 2014 19:58:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05D2A202D1 for ; Thu, 8 May 2014 19:58:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A269201F9 for ; Thu, 8 May 2014 19:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932134AbaEHT6Q (ORCPT ); Thu, 8 May 2014 15:58:16 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:62541 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932136AbaEHT5q (ORCPT ); Thu, 8 May 2014 15:57:46 -0400 Received: by mail-pa0-f44.google.com with SMTP id ld10so3266433pab.17 for ; Thu, 08 May 2014 12:57:46 -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=I2aXFHutLy+2uLpKZxHQJhBYA6m07XogEOJnaSeWRqA=; b=DqlWND8Aq0RA7ZwheiYyUIZYSGaYj3wTEECJmuc9OPz4/WXB4OtfasOn7ZIBaNVXLS Zwskgc2aypjJ2+Z32rUQDMBVfp3ZA66omsxm8bx10GVl82n8pS7AOY3OuaGn2K4R42B8 dVKe/XGT59+y0RtZYA/jUIw+DbT1cooGkSRfYJB7HLHkCV/fUdztug1pPd3Xsn/RZ9Iy F7prJAcowzmBzgNAEATtdvjBo7VyCUIqmQtteUxGqDlydJ8ZnCDuwDqMaQF5j1aqMTYX z+CqGeHg+QKIMLoKeQ+FQ/jtxWxa2bGUQDDL3O8/2DJ+UoLX7IHcz8j9o8VFfHhaYmCj ZFzA== X-Received: by 10.66.102.4 with SMTP id fk4mr11277169pab.59.1399579065976; Thu, 08 May 2014 12:57:45 -0700 (PDT) Received: from echolake.localdomain (static-50-43-42-35.bvtn.or.frontiernet.net. [50.43.42.35]) by mx.google.com with ESMTPSA id yo9sm8436026pab.16.2014.05.08.12.57.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 May 2014 12:57:45 -0700 (PDT) X-Google-Original-From: dirk.j.brandewie@intel.com From: dirk.brandewie@gmail.com To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, dirk.brandewie@gmail.com, Dirk Brandewie Subject: [PATCH 4/5] intel_pstate: Remove C0 tracking Date: Thu, 8 May 2014 12:57:26 -0700 Message-Id: <1399579047-5792-5-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1399579047-5792-1-git-send-email-dirk.j.brandewie@intel.com> References: <1399579047-5792-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=-7.4 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 Commit fcb6a15c intel_pstate: Take core C0 time into account for core busy introduced a regression referenced below. The issue with "lockup" after suspend that this commit was addressing is now dealt with in the suspend path. References: https://bugzilla.kernel.org/show_bug.cgi?id=66581 https://bugzilla.kernel.org/show_bug.cgi?id=75121 Reported-by: Doug Smythies Signed-off-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index bb20881..4c26faf 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -59,7 +59,6 @@ struct sample { int32_t core_pct_busy; u64 aperf; u64 mperf; - unsigned long long tsc; int freq; }; @@ -100,7 +99,6 @@ struct cpudata { u64 prev_aperf; u64 prev_mperf; - unsigned long long prev_tsc; struct sample sample; }; @@ -561,46 +559,37 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu, struct sample *sample) { int32_t core_pct; - int32_t c0_pct; core_pct = div_fp(int_tofp((sample->aperf)), int_tofp((sample->mperf))); core_pct = mul_fp(core_pct, int_tofp(100)); FP_ROUNDUP(core_pct); - c0_pct = div_fp(int_tofp(sample->mperf), int_tofp(sample->tsc)); - sample->freq = fp_toint( mul_fp(int_tofp(cpu->pstate.max_pstate * 1000), core_pct)); - sample->core_pct_busy = mul_fp(core_pct, c0_pct); + sample->core_pct_busy = core_pct; } static inline void intel_pstate_sample(struct cpudata *cpu) { u64 aperf, mperf; - unsigned long long tsc; rdmsrl(MSR_IA32_APERF, aperf); rdmsrl(MSR_IA32_MPERF, mperf); - tsc = native_read_tsc(); aperf = aperf >> FRAC_BITS; mperf = mperf >> FRAC_BITS; - tsc = tsc >> FRAC_BITS; cpu->sample.aperf = aperf; cpu->sample.mperf = mperf; - cpu->sample.tsc = tsc; cpu->sample.aperf -= cpu->prev_aperf; cpu->sample.mperf -= cpu->prev_mperf; - cpu->sample.tsc -= cpu->prev_tsc; intel_pstate_calc_busy(cpu, &cpu->sample); cpu->prev_aperf = aperf; cpu->prev_mperf = mperf; - cpu->prev_tsc = tsc; } static inline void intel_pstate_set_sample_time(struct cpudata *cpu)