From patchwork Thu May 29 16:32:22 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: 4266331 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 11FCA9F32B for ; Thu, 29 May 2014 16:32:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3738C2035D for ; Thu, 29 May 2014 16:32:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 151DF20377 for ; Thu, 29 May 2014 16:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757494AbaE2Qci (ORCPT ); Thu, 29 May 2014 12:32:38 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:49988 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757052AbaE2Qch (ORCPT ); Thu, 29 May 2014 12:32:37 -0400 Received: by mail-pb0-f48.google.com with SMTP id rr13so642970pbb.7 for ; Thu, 29 May 2014 09:32:36 -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=MCMtDB0maQKadmH3L+x5VtZzaTL7riJCS1TZX1407kM=; b=ylJs0SqYXrlm6sq1Tw3Y5Ib/K7KmbGgtZPsRpop9ig/mMjOtPnklvVTA8tXYgSEr9b 0/EysMI5hDpQQ94kkTububd0nIdjGNViwMVgWfkofUkXa6KaSpOD/byKF8ZwltpJfi3B DXUpVcUrXnWeusxTa9fSAt546E7x4zOL8pMCmY3RL9OfD9EB0IAcDx6eyv+AfINTRJPx 09od/w2SIIhs0Kuv5/FUcnsQULK7Y/egGbarzxgCgHWp6sur5kjk/Raku8favfsU6unK pa9VV7SrN0rDIpOV6K/GrbJO5HXLaE0i8X8xwzId5AwLJDA/lNn0FQP3yJh9C7gvsEXz 8UOQ== X-Received: by 10.66.250.166 with SMTP id zd6mr10280171pac.7.1401381156538; Thu, 29 May 2014 09:32:36 -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 lr3sm5411991pab.4.2014.05.29.09.32.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 May 2014 09:32:35 -0700 (PDT) From: dirk.brandewie@gmail.com X-Google-Original-From: dirk.j.brandewie@intel.com To: linux-pm@vger.kernel.org Cc: dirk.brandewie@gmail.com, rjw@rjwysocki.net, dsmythies@telus.net, Dirk Brandewie , Subject: [PATCH 1/4] intel_pstate: Remove C0 tracking Date: Thu, 29 May 2014 09:32:22 -0700 Message-Id: <1401381145-17745-2-git-send-email-dirk.j.brandewie@intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1401381145-17745-1-git-send-email-dirk.j.brandewie@intel.com> References: <1401381145-17745-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=ham 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 Cc: # 3.14.x 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 a6d5afa..ffef765 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -57,7 +57,6 @@ struct sample { int32_t core_pct_busy; u64 aperf; u64 mperf; - unsigned long long tsc; int freq; }; @@ -96,7 +95,6 @@ struct cpudata { u64 prev_aperf; u64 prev_mperf; - unsigned long long prev_tsc; struct sample sample; }; @@ -555,45 +553,36 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu) { struct sample *sample = &cpu->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->prev_aperf = aperf; cpu->prev_mperf = mperf; - cpu->prev_tsc = tsc; } static inline void intel_pstate_set_sample_time(struct cpudata *cpu)