From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0BD9CA0096 for ; Fri, 12 Apr 2019 17:57:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 918161B227; Fri, 12 Apr 2019 17:57:34 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 24B401B21A; Fri, 12 Apr 2019 17:57:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 08:57:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="161225937" Received: from silpixa00399501.ir.intel.com ([10.237.223.69]) by fmsmga004.fm.intel.com with ESMTP; 12 Apr 2019 08:57:29 -0700 From: Lee Daly To: david.hunt@intel.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Lee Daly , stable@dpdk.org Date: Fri, 12 Apr 2019 16:57:27 +0100 Message-Id: <1555084647-75896-1-git-send-email-lee.daly@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] lib/librte_power: set new frequecy on turbo_disable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190412155727.rt2qEKWSKlgSfnBdzG-OjFWrFzJoU5QtSfWJs-2kYC0@z> This patch will ensure the correct max frequency of a core is set in the lcore_power_info struct when disabling turbo, while using the intel pstate driver. Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility") Cc: liang.j.ma@intel.com Cc: stable@dpdk.org Signed-off-by: Lee Daly --- lib/librte_power/power_pstate_cpufreq.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c index 336c13869..d2ac75123 100644 --- a/lib/librte_power/power_pstate_cpufreq.c +++ b/lib/librte_power/power_pstate_cpufreq.c @@ -810,7 +810,15 @@ power_pstate_disable_turbo(unsigned int lcore_id) pi->turbo_enable = 0; - + if ((pi->turbo_available) && (pi->curr_idx <= 1)) { + /* Try to set freq to max by default coming out of turbo */ + if (power_pstate_cpufreq_freq_max(lcore_id) < 0) { + RTE_LOG(ERR, POWER, + "Failed to set frequency of lcore %u to max\n", + lcore_id); + return -1; + } + } return 0; } -- 2.17.1