From patchwork Sat Jun 17 03:03:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 9793903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52BD860325 for ; Sat, 17 Jun 2017 03:04:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4610227F4B for ; Sat, 17 Jun 2017 03:04:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B1EB283CB; Sat, 17 Jun 2017 03:04:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE9D627F4B for ; Sat, 17 Jun 2017 03:04:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbdFQDEH (ORCPT ); Fri, 16 Jun 2017 23:04:07 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34686 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbdFQDD1 (ORCPT ); Fri, 16 Jun 2017 23:03:27 -0400 Received: by mail-qk0-f194.google.com with SMTP id d14so820729qkb.1; Fri, 16 Jun 2017 20:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:reply-to:organization; bh=yKYFzRQElE+6egBGgderyALlxx0/ylv4tGR6YDZMovU=; b=l0wf6ngwAvLtK7ZcLgu+yu7NUDmDlIHqBfRKjlIqoHljIOlBUdL1QVzmblWkbZnT88 xVi/brysc+57kCeFrn43oVJjCghCzzG+/xOpqIWFh4mS52an5CYRE4zc94FnrMBnZYmj BA6133W2huczotNE1LjpsaXUxINnRXb5WdLvJV3wy8UzqSkR668nl7JLYmgA1I42J9bX ajcLzeu7je3i+rmHLCLgr5BHwqYUowYp+W4/P0lY+NNjtBt5B0axeoWbZTIWyhXvRn/d V/DjFxNJYLDQhJaauULeFEF5eDsi4QceQ+EYj4+tVF/JIgW95nDLccIYavU119VHUMMH bBvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:reply-to:organization; bh=yKYFzRQElE+6egBGgderyALlxx0/ylv4tGR6YDZMovU=; b=Gib51wOsur3NfoTrrK1jjmNEra/PpUbr5sEJtQNsPWNaXq/wws6A+sv9NY2U6UoGES ptoBLM8+BrQZ3g+nyPoLhToYfYrLE9wG3wt3qJRO8ydKXvh4V+gXVS3hKPdhxlloR6RM 2hMmXFwdOOOeoa7GgJPTAf8FCOLsudIfYEEEJld+aiyVOZfxnvwYTTSyqhcWL8gP8a9X 8iuvzgdByH55GJMOj+O42JR1EcWUcMKXhbJpvcUc0zI91wv76va/EkEHOy5t8QvCIQZg WMsZWsLPVZ0WUnVv+ByotTZnkRnubmHVnKubZOH7ncbs8vipcBcbZFWegf2qUlQaonwe 6kYA== X-Gm-Message-State: AKS2vOyJmQxBuOU3wtwB89O05NPPhKSHvnJN0nBX6GLAxfI59EAIxu82 BB9pDJPwFM15SA== X-Received: by 10.55.33.80 with SMTP id h77mr6279566qkh.86.1497668606134; Fri, 16 Jun 2017 20:03:26 -0700 (PDT) Received: from localhost.localdomain (pool-173-48-65-169.bstnma.fios.verizon.net. [173.48.65.169]) by smtp.gmail.com with ESMTPSA id g34sm2983335qta.46.2017.06.16.20.03.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jun 2017 20:03:25 -0700 (PDT) From: Len Brown To: rafael@kernel.org Cc: x86@kernel.org, srinivas.pandruvada@linux.intel.com, peterz@infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH 3/4] intel_pstate: delete scheduler hook in HWP mode Date: Fri, 16 Jun 2017 20:03:13 -0700 Message-Id: <7cc506b720aa12801c534d51235eeca45b81ba7f.1497665794.git.len.brown@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497668594-9266-1-git-send-email-lenb@kernel.org> References: <1497668594-9266-1-git-send-email-lenb@kernel.org> In-Reply-To: References: Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Len Brown The cpufreq/scaling_cur_freq sysfs attribute is now provided by shared x86 cpufreq code on modern x86 systems, including all systems supported by the intel_pstate driver. In HWP mode, maintaining that value was the sole purpose of the scheduler hook, intel_pstate_update_util_hwp(), so it can now be removed. Signed-off-by: Len Brown --- drivers/cpufreq/intel_pstate.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index b7de5bd..4ec5668 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1732,16 +1732,6 @@ static void intel_pstate_adjust_pstate(struct cpudata *cpu, int target_pstate) fp_toint(cpu->iowait_boost * 100)); } -static void intel_pstate_update_util_hwp(struct update_util_data *data, - u64 time, unsigned int flags) -{ - struct cpudata *cpu = container_of(data, struct cpudata, update_util); - u64 delta_ns = time - cpu->sample.time; - - if ((s64)delta_ns >= INTEL_PSTATE_HWP_SAMPLING_INTERVAL) - intel_pstate_sample(cpu, time); -} - static void intel_pstate_update_util_pid(struct update_util_data *data, u64 time, unsigned int flags) { @@ -1933,6 +1923,9 @@ static void intel_pstate_set_update_util_hook(unsigned int cpu_num) { struct cpudata *cpu = all_cpu_data[cpu_num]; + if (hwp_active) + return; + if (cpu->update_util_set) return; @@ -2557,7 +2550,6 @@ static int __init intel_pstate_init(void) } else { hwp_active++; intel_pstate.attr = hwp_cpufreq_attrs; - pstate_funcs.update_util = intel_pstate_update_util_hwp; goto hwp_cpu_matched; } } else {