From patchwork Wed Mar 13 10:04:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780250 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2062.outbound.protection.outlook.com [40.107.223.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03E4739AF0; Wed, 13 Mar 2024 10:05:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324313; cv=fail; b=VuatG46PJ7ngdn9yqfCfk3Bfmu9x/iwKKfi2HDhNMSz4u5dWmxlawNHoPjdhZQn8ZT5BdI4M64ZMPiYiONQh3Sl6CSU9rjrBpmb3XMqKRC5vhEOB/tiW5rVlGBoR7pkKqJe1fKvjXPm8PFgdKKySnJwETGcc6ze1U7kY2O1ozxc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324313; c=relaxed/simple; bh=/CTM8Xm0prsANYr1wqSFW23UKyplFam+FaUCoB4o7Y8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J6AG+0JAdMKyObHQbWSO9uhOE4ITJWk5ruxoHWLaHaNdPBABKiCO5QHAPoORZmloAyZW6PGMtSf8YWvc2PMX93yf59AiCze2jb1vzy+k5Q1hjukCaDhDKz4xdicnrO8L6LjEQsMcWw625CRc4dJtiWq8nIr1gn7QivbXxHc3UU4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=cUT19cf6; arc=fail smtp.client-ip=40.107.223.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="cUT19cf6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vx0rXbyJhQs5SDbSIJUNXP1OCkYcctcph6EkaIcBPq3VGm5ZEbPS/WqrqIARLUmbv4VIbGNsJJA1J9N54C4Eau/8e8s4NH/1jh0iLWuANdV97+go/UEVv2C9SlR+iGe3ZHz1dzSq+PBoDFgmBOJwLrw0cxRP+fAWaxU0box5ugq5NiF0QjXibiYG7rAmH4h556e+m70ZHa5TsAoBJ2H3GiVrqvmHr2gpJ3A0YSsUeBTWBTozW4PsuIzRsRq5Jcsvro9ocsN5CUyNevEjHM+WPu0SASLehnu481AGTaHuvFvPo5gz78QBYwVdrNwqoaEYRiwQyCGm6B2Hk+LWY8rPhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gieT9WDW1c2VLj27RibDNaHMMryrA8YB/Onu4d42jPg=; b=mW4UA9jrNxdOadkKkXK6K8X/DiyZzOTj2JskkZI1W95TGITxtZNsASi8irjCVaR7+num7ZNYrvvJuZDTRrh6PKOL+gt9ru0HwlwJImivdgwHK9liXxzfiZ8nBRBpoJIXqgFz2/mMX8k7fsbKWnlpudezfApKeW9kU3YPNg86rwRGgZlkcv1DAhfC09v+Y9jI4qhaZKUoxmHOwiVUJChvMEeRQfOxPO8AOI6mDfsdbpEwe/jT7gKOQ9Lm69rvZg3GThTAPusGA1Xh13G61VHTw8qczidDaqiKWZsBou/zUvNcKGtIB+1krKVuTur8lxDMgeEx5fgvTVrCcnGW98ldkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gieT9WDW1c2VLj27RibDNaHMMryrA8YB/Onu4d42jPg=; b=cUT19cf66pSI/iqx+dcgSBPcREtXWFhThnznn2iAR1cHF2rOmtSuH77xJMNnfRw1+5QD4FaRoVwKqjEuXycEce5znbejhDzDIBs/Ekg86THlv5exP5h+YOZZBxVCzzmcdQhDeTs0tVhofc1gdznhyYzRAjfdmFmALqLFvRIx4PI= Received: from MW4PR03CA0212.namprd03.prod.outlook.com (2603:10b6:303:b9::7) by SA1PR12MB6773.namprd12.prod.outlook.com (2603:10b6:806:258::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Wed, 13 Mar 2024 10:05:05 +0000 Received: from CO1PEPF000066EA.namprd05.prod.outlook.com (2603:10b6:303:b9:cafe::fc) by MW4PR03CA0212.outlook.office365.com (2603:10b6:303:b9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19 via Frontend Transport; Wed, 13 Mar 2024 10:05:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000066EA.mail.protection.outlook.com (10.167.249.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 10:05:04 +0000 Received: from pyuan-Chachani-VN.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Mar 2024 05:04:58 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 1/7] cpufreq: amd-pstate: initialize new core precision boost state Date: Wed, 13 Mar 2024 18:04:38 +0800 Message-ID: <1bd9da56478c07fc2117b7c11f88eb517bd60f0f.1710322310.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EA:EE_|SA1PR12MB6773:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c3cc435-2ea3-448d-7a25-08dc43450dff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vOMNB0F3g/dOW6bMNPkhLW+r4vuQj33zqCYQqAo+2Y9f8JiRhCP8GiJn7U7Z27QHuFnSclFyZN4hHPLMh/TeEtndfVX1+8/yVPm1MLEXUUjprx37jLujF0SA5RGjYhOUE+u+MA+8GsCeE+qXoPW1kGeZr51ugaTuGjDzD7cTGFcy2RbVC1XfPr0YdiEMPSiaCkyJ84mxa+1zAFk9zEV+AhNH52Isfd5AHrsr9CGCXSQuBJR/4+vDzo5YKcmiF8j7KM1Ya0IT/P4zwxGeimttO8GUAcfIA4c319LshXgQqsx9uzUDpkc2IuV3zRhafm7h1Elc5oCCDKtfihGERdbUYYFmMefgOY8yo5eVFZFmbMXilL3HxjcSJwIzz06Kci207ZJUAFml97G1rt6d7BmBfD93qaGzszcjaDKJ5RieDJZcUXMbRZKrptRRY2tu6k8J8xyrb1BnqGiDV/DCayh/zCiG7mLYcpMzjU4efUKinTKvWSSqlELOF1H4jPfWpZwLYLP+HstYv5qeRsKnNdBDpKLUmoIXl/TLhcMQfDIUNlVrSx7dtFd2wbxc841p353s6yfrraEyieoIvVcu7RG8SBvYO9ZzY+94umlWhY3SM++5jQrX8owzWJ4xULA+evwvEIgXity6Kz5dLrQRAr8fIwFROevYEHhPAvXVYNA0EAlwP/h2ep9mgEeGeBo3I6ykNvu1mUfWpky1wwuTkWBiCQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(82310400014)(36860700004)(376005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 10:05:04.3919 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c3cc435-2ea3-448d-7a25-08dc43450dff X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6773 From: Perry Yuan Add gloal global_params to represent current CPU Performance Boost(cpb) state for cpu frequency scaling, both active and passive modes all can support CPU cores frequency boosting control which is based on the BIOS setting, while BIOS turn on the "Core Performance Boost", it will allow OS control each core highest perf limitation from OS side. If core performance boost is disabled while a core is in a boosted P-state, the core transitions to the highest performance non-boosted P-state, that is the same as the nominal frequency limit. Reported-by: Artem S. Tashkinov" Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217931 Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 50 ++++++++++++------------------------ include/linux/amd-pstate.h | 14 ++++++++++ 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 2015c9fcc3c9..ef6381b48e76 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -67,6 +67,8 @@ static struct cpufreq_driver amd_pstate_epp_driver; static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; static bool amd_pstate_prefcore = true; +struct amd_pstate_global_params amd_pstate_global_params; +EXPORT_SYMBOL_GPL(amd_pstate_global_params); /* * AMD Energy Preference Performance (EPP) @@ -676,43 +678,21 @@ static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata) return lowest_nonlinear_freq * 1000; } -static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) +static int amd_pstate_boost_init(struct amd_cpudata *cpudata) { - struct amd_cpudata *cpudata = policy->driver_data; + u64 boost_val; int ret; - if (!cpudata->boost_supported) { - pr_err("Boost mode is not supported by this processor or SBIOS\n"); - return -EINVAL; - } - - if (state) - policy->cpuinfo.max_freq = cpudata->max_freq; - else - policy->cpuinfo.max_freq = cpudata->nominal_freq; - - policy->max = policy->cpuinfo.max_freq; - - ret = freq_qos_update_request(&cpudata->req[1], - policy->cpuinfo.max_freq); - if (ret < 0) + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_K7_HWCR, &boost_val); + if (ret) { + pr_err_once("failed to read initial CPU boost state!\n"); return ret; + } - return 0; -} - -static void amd_pstate_boost_init(struct amd_cpudata *cpudata) -{ - u32 highest_perf, nominal_perf; - - highest_perf = READ_ONCE(cpudata->highest_perf); - nominal_perf = READ_ONCE(cpudata->nominal_perf); - - if (highest_perf <= nominal_perf) - return; + amd_pstate_global_params.cpb_supported = !((boost_val >> 25) & 0x1); + amd_pstate_global_params.cpb_boost = amd_pstate_global_params.cpb_supported; - cpudata->boost_supported = true; - current_pstate_driver->boost_enabled = true; + return ret; } static void amd_perf_ctl_reset(unsigned int cpu) @@ -855,6 +835,9 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) if (ret) goto free_cpudata1; + /* initialize cpu cores boot state */ + amd_pstate_boost_init(cpudata); + min_freq = amd_get_min_freq(cpudata); max_freq = amd_get_max_freq(cpudata); nominal_freq = amd_get_nominal_freq(cpudata); @@ -906,7 +889,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) policy->driver_data = cpudata; - amd_pstate_boost_init(cpudata); if (!current_pstate_driver->adjust_perf) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; @@ -1317,6 +1299,9 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) if (ret) goto free_cpudata1; + /* initialize cpu cores boot state */ + amd_pstate_boost_init(cpudata); + min_freq = amd_get_min_freq(cpudata); max_freq = amd_get_max_freq(cpudata); nominal_freq = amd_get_nominal_freq(cpudata); @@ -1367,7 +1352,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) return ret; WRITE_ONCE(cpudata->cppc_cap1_cached, value); } - amd_pstate_boost_init(cpudata); return 0; diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index d21838835abd..c6e2a97913de 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -124,4 +124,18 @@ static const char * const amd_pstate_mode_string[] = { [AMD_PSTATE_GUIDED] = "guided", NULL, }; + +/** + * struct amd_pstate_global_params - Global parameters, mostly tunable via sysfs. + * @cpb_boost: Whether or not to use boost CPU P-states. + * @cpb_supported: Whether or not CPU boost P-states are available + * based on the MSR_K7_HWCR bit[25] state + */ +struct amd_pstate_global_params { + bool cpb_boost; + bool cpb_supported; +}; + +extern struct amd_pstate_global_params amd_pstate_global_params; + #endif /* _LINUX_AMD_PSTATE_H */ From patchwork Wed Mar 13 10:04:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780249 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E80093A1A3; Wed, 13 Mar 2024 10:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324316; cv=fail; b=Yl1xnks0NXTkc8glyrIQ4CbOn8ruSzhvwfJ9ZDwDlKXb6IAt8cBvXNGA6B2dJyBokxrQArmeTNM+lElL3xXOle69U6c/vqflqv3aNNq4RXjbJEOKOtDSPONOcax+Mh7egWAkpZFk1y+8BDXj3KSEjqejoyxOTs7A2HgtdwlTgLo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324316; c=relaxed/simple; bh=+4hq6036+U12DPPrN+8dk7oAZKPI0vaZqI+kdD6avVc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ooPoLGMOxz8ZMAIg8aialBN8Fd6KFSsXuurxWVJv9GhG1f0pm5K0XlfpmpbX4LL6q4/8mxtVVfNkoeCqXVX0jxtg6VCoPDIWYJY2f6BD96T2Bao2sa61ggqJmfQdmgz5Xv/RH4IxvKLBSisWP1Nx7M7LJYSN5Mg/oJbO6NuUtlI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=LIYRZa1u; arc=fail smtp.client-ip=40.107.92.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="LIYRZa1u" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=irghyeaJARKqZ4SexYg/+doJfM+vuT/+OySwKLhp/G9kqj0y7rSg5eQgcnDAHBq41TzaiCZJOuzdi0dNjwMfc9eL0qnsFRLpIb1zJt1tTeszUny/JLx30YjoBMdbOBjrqRRChrb0Qh7ZqgIIGjX5J+n+dZWeeR4MkaO/LT02b3FuMvYy7UBDOMl4wskPZoLgRfeZD2/wjI1RLmbsK++l3Af5/EhPnMorTJATZwxpC33C8RhR1frKuTJcb1RlupGsJBK6/DrRPNNQ/kW6RqhbcoT3HJS9hA59GDSSZx6bmt3FQKZ097CUGQEhCNl8bdQDuJyYt9zItH9Pm6T22EdGbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WHzJ9CW/0SYYQRZ8aS+yEcch1FpZ8blP/2nXMKvyn38=; b=eBF+yAOiHnzdTrOZX0d+91ZyrNSkhQybP+BctXh2s2ihKCg16yxFMcyJ8gW9TagfXrW6pGTJ93ccqZr8ecBMNfcXS2+lhDDdp5RMqOd9pvbvmdpu7Ivc79twyPjpzehvQAzaMU+ryAM9CQiTU3xnM8ISCavdOpvhwyLDIU06H0CbW0yN55D4FSRnCdkE+OXljOZrBfRuVNRLU/GpQ2yMsMPcwRBD1vlhwPj8eiCzVPnwlODz1549/d1nOseMdltZwum/WqIhPFhUdLzgvOazS1cedC3JBl9Cv7D+HeSf23jkW2uqrBKtCHcpe8uwjOmNnBJSV9UHfwBt8CYmDqkbyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WHzJ9CW/0SYYQRZ8aS+yEcch1FpZ8blP/2nXMKvyn38=; b=LIYRZa1ur7WTfXB6qyeTB/baX5ClcseE/ITLPRA6+K+Xn9Vf4gvZxNsxj7QAElWG4bO8EyTcj9jCfVZawsV2gwmGkbR2hjx6bOs5cmRLEbQBqGKF2UAGD7SdcHrj4I0A2HjZeOgSaVxPTouTXlDqQAfvpFXffPWfGkUr/+SXd1E= Received: from MW4PR03CA0214.namprd03.prod.outlook.com (2603:10b6:303:b9::9) by IA0PR12MB8279.namprd12.prod.outlook.com (2603:10b6:208:40c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Wed, 13 Mar 2024 10:05:11 +0000 Received: from CO1PEPF000066EA.namprd05.prod.outlook.com (2603:10b6:303:b9:cafe::19) by MW4PR03CA0214.outlook.office365.com (2603:10b6:303:b9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19 via Frontend Transport; Wed, 13 Mar 2024 10:05:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000066EA.mail.protection.outlook.com (10.167.249.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 10:05:09 +0000 Received: from pyuan-Chachani-VN.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Mar 2024 05:05:05 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 3/7] cpufreq: amd-pstate: fix max_perf calculation for amd_get_max_freq() Date: Wed, 13 Mar 2024 18:04:40 +0800 Message-ID: <1da9848e022c49fef0a8cc390feba95c74be531d.1710322310.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EA:EE_|IA0PR12MB8279:EE_ X-MS-Office365-Filtering-Correlation-Id: fad30bcc-2ef5-4277-cd9a-08dc4345111b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3egCThHhwi0wnPLRxFI3QhtMpmlqqx8bO/foHqe/pWp6+T4MzvT87b+lP1qsXCYPcfPgwNn9uEC/cLwpzkD7zB8EDA6CJjpD3ueLnpA2cxzcYpNLxql62+y/RPja3wSF66Z3gWwIOTfu4keEQJf0yAuZ20JteEqNg4iGCh3B75HphbI39qMNEh3pLCe3gremx/FuAOzCD+6vPBb46AHUXxcLUz8e06Ve63SllRHzr8xvL8uicNJNWxpzC98M/qaLXy2ACcKiHt7ZpudFCy9ShaDXdXaTXqH0EEf+r4OdswNqjsfZwPL83TzXlGuSJzbVc8Fdlvuz0+Ybz+fbZpvMWLnn8qXw/Lbo5P8noUUWI3YR3hq1Taz5w8Rvg0j/S0gJv31h9U5zDb7t8wYmYf3ArloIOOZWTVHD782t42QUxQk/yAJxuAq92T9jryLdXuehugWeVO/AGT7q/cG3Fa24Psw4lCxL7GysqKbMuMh4IwbKJE8v5YzfNUqUKNxjtYaLS43FBVtSmj2WtrcUSvw1HzbKxNY+yvFXM+Bg4vvy4lECH/wUkz4e//qZfXXNUsKCB+O/fiKsUQO7LPSt+yiiRTJlJZv5ITxr+wfDf5PsJ6L3Nd3wQRCttebateLmLiRvlNxEi6pDzSRlbXsBg1XawvKcWstdSNXy9gXui54VTJVqsHUV439sYEyu7AzqYhBdLkv0gI7vynhBwO9nYfAU2cD7ICIccwL+cCQUm+fJRiXZvbs0DKlScdH03ZdyDuUL X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(376005)(36860700004)(82310400014)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 10:05:09.7044 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fad30bcc-2ef5-4277-cd9a-08dc4345111b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8279 From: Perry Yuan When CPU core Precision Boost state changed, the max frequency will also need to be updated according to the current boost state, if boost is disabled now, the max perf will be limited to nominal perf values. otherwise the max frequency will be showed wrongly. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d54399ebb758..0965fbf660dd 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -632,6 +632,10 @@ static int amd_get_max_freq(struct amd_cpudata *cpudata) nominal_perf = READ_ONCE(cpudata->nominal_perf); max_perf = READ_ONCE(cpudata->highest_perf); + /* when boost is off, the highest perf will be limited to nominal_perf */ + if (!amd_pstate_global_params.cpb_boost) + max_perf = nominal_perf; + boost_ratio = div_u64(max_perf << SCHED_CAPACITY_SHIFT, nominal_perf); From patchwork Wed Mar 13 10:04:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780248 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2054.outbound.protection.outlook.com [40.107.223.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CE093CF68; Wed, 13 Mar 2024 10:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324321; cv=fail; b=m4tJVm3nxBThsQf/4qkvKee6v1BMomXqxRyfnHg30GbxN/eHzr0yzWTxTiyh2cRDSoaDSlIjzNZubZB3dmqkIg0TIY1r2lJB4tU0XQvHuqdQtEKxuX+WzfuMZA3PcpUoR+vQMEcE/fRBTGKxpIyxca9KlLSIDQgW64E1JB641ts= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324321; c=relaxed/simple; bh=xEj6liAj6IMhbWAhkHuDsMO4hCwxjqNXMN9NlrsX8rk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fv+P+HcB5PwAcPcPdbP6fO1t/PcXYzP3wUyg+hJRAeDfoTfpmrrNm0pH0bBYwB3IB3gw5VVp48KRy5dgrQiF2FnOIL8xrwkDvhbYNuHepCNBMq1VMBRFMfzLrvDh+t0mPXX5PU4wqj7xflzg4vuQ2GLkBGU1vm1pRoAst5RjuQU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=KITMVJU9; arc=fail smtp.client-ip=40.107.223.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="KITMVJU9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WkbfM/mk8tLNq7j6KIbClCP8yY0GTM4W4nuigkxmoXqj/FV84VpJ9neuRmazuLuwYTkfNx9y3tEhlF4/AHXo/O2vlIZUpcXBGZUyPfrwH1f64OWxomgoYCfpXkkWIpAgth7q8qHZ1S/OImX3JFJFWHFhyos0ZfwtwecpVj8z2K3c2bJUhL9AUmuviVd32gLvq20fXRY0kl5njxpGMatv/YWkJ55V8kacXG72tGCFQDZA2XKBly2RRqvkuU/5YbhqMC50JtzhoNTVkxCffCew4lQYtHEJEMGGexXx2qtVUbvEDsgC+4Ed6nRQ2Iv11wED1MFRmx5SL0aqeOI22KX5vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=27ao4J8fzUAMRbFzpm1S5an7Hi17ByoMGWcavVPwhww=; b=hOKhensbje0FKw8I9S3RE+8rcmPq5NRm+cVRCXMCtSFac1+xAHUBdTKtACc58cGUBGkMrho94nIpalY0bvKW6AcOspZUH4muRFgGv8j8YdGAIacEHIck0QlQ3lAdGz2A6kwGahbSAI+yWwynDH4lqy/Te29b1nEpQCF0dHMKmoE95u8ZKSIxT7UOWTmoQUNbxcgF22XR5x/xjWdutFrDh1dh6keTJGGBPlk/uw+VdHtovaJCIlZ7iMnFYvv2SPjpkfOuZMue4B6JwGFNnk4iOsHpVgUSsSb2a+YdV6Wu8LsLGmyYxxhY4h6Op8OwdWB8rBGOyQf6epM1ncrCflBd3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=27ao4J8fzUAMRbFzpm1S5an7Hi17ByoMGWcavVPwhww=; b=KITMVJU9OHhmI0166b4vluh40K1yyCFzpRQvxM88GCrEdj7aQPfMZmS0x9n9ue2l7Efb18lml3W4jhGYZOVHf20N8c2E0KO1ZAzXwt9Ft2FfhNnSWQqDnv9r5a1XLVrI446P3ro1kmUwTCWPze/IpDrOJghgsZZctM9G/zbzJgc= Received: from BYAPR08CA0062.namprd08.prod.outlook.com (2603:10b6:a03:117::39) by DS7PR12MB6119.namprd12.prod.outlook.com (2603:10b6:8:99::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Wed, 13 Mar 2024 10:05:16 +0000 Received: from CO1PEPF000066EC.namprd05.prod.outlook.com (2603:10b6:a03:117:cafe::e7) by BYAPR08CA0062.outlook.office365.com (2603:10b6:a03:117::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.20 via Frontend Transport; Wed, 13 Mar 2024 10:05:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000066EC.mail.protection.outlook.com (10.167.249.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 10:05:16 +0000 Received: from pyuan-Chachani-VN.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Mar 2024 05:05:11 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 5/7] Documentation: cpufreq: amd-pstate: introduce the new cpu boost control method Date: Wed, 13 Mar 2024 18:04:42 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EC:EE_|DS7PR12MB6119:EE_ X-MS-Office365-Filtering-Correlation-Id: efefb17c-8f2e-4ad7-83c5-08dc434514fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fd/AAiYFbAC0bazfRsO+xXbbwf6RiSZSxLy6VNyS/RpWbDQSxY89WBwMWG4DZ5OmFVgn6rAeNiByNouU4g6ARBsmC1vatPDClYRLISXEwO1HyBsBWzuAQf9WQHmR2GG+sES9mRDztYqP/fepjFmc1SatHBP2xpxSEhzKOp7SUxXTtjYQgfLNF76d60O/eYqkPwR8Vo7yDq54Z/Qvi8bnIZr+X2bDeky3hTtgUhugsmwsxevWqe+wGerJdmIAFXaU9jRvAR4my2e7WWsdm54dAfAo8FLfnxb8r+2AbA5ALHs4bz66RlMye/XNQQqBZUKiInZRJqG34L1kxtOxWSNR8qMJl72zoRTbBwodzbTSblrOMFyPSCHVy3uvaNGFJxcmrZxf0ypODDCN6UeourTXc88eEIenNLEjNpLH461BIeVutiF/ep1/S74eLdfQ6bbGV6vSu+liMaakDdxnGu39SMMor6jHI50EkH1nkjIg6iFcqF5STZtYVGh2mHfsOQuElOXVEXpN0+ac0/EbQ/5hPLaUuivNxDxIeidNvl1MTtseYYUP+MZM9T0b/p5lk4hRx1IOeGtLV+rz5Z6yTB3SX0T3WKWX4zrS9KV9O3WzXuhp51IRYV8WVtvSj5HMlElw1Q7kpGAKi9qZhY5UzQR/oHAe24CkRnaHxG3nviLPnYU+fHwTNsNC5AXIaGR8tQWNrIIWMD+2XD0YzVKkDxneehxSxru3CvjzalS/Rp3aXh/rwQyxS2n5rJ/cz/D58XU5 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(82310400014)(36860700004)(376005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 10:05:16.2102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: efefb17c-8f2e-4ad7-83c5-08dc434514fc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6119 From: Perry Yuan Introduce AMD CPU frequency boosting control sysfs entry which used for switching boost on and boost off. If core performance boost is disabled while a core is in a boosted P-state, the core automatically transitions to the highest performance non-boosted P-state The highest perf and frequency will be limited by the setting value. Signed-off-by: Perry Yuan --- Documentation/admin-guide/pm/amd-pstate.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1e0d101b020a..82fbd01da658 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -440,6 +440,17 @@ control its functionality at the system level. They are located in the This attribute is read-only to check the state of preferred core set by the kernel parameter. +``cpb_boost`` + Specifies whether core performance boost is requested to be enabled or disabled + If core performance boost is disabled while a core is in a boosted P-state, the + core automatically transitions to the highest performance non-boosted P-state. + AMD Core Performance Boost(CPB) is controlled by this new attribute file which + allow user to change all cores frequency boosting state. It supports both + ``active``, ``passive`` and ``guided`` mode control with below value write to it. + + "0" Disable Core Performance Boosting + "1" Enable Core Performance Boosting + ``cpupower`` tool support for ``amd-pstate`` =============================================== From patchwork Wed Mar 13 10:04:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780247 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94E3F3DBB2; Wed, 13 Mar 2024 10:05:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324327; cv=fail; b=dmuiwcSxSHpl+WSRWwD9NLtyzcjSQDprgehcm16UnpeDse8UY+u6/Iq+F3jBdDOQfqIxZ6lZRQoLG5ceMLEmj4+xCgjlsjgPdySu3CdieeMsPCkNthVHxT3AdE9OnrIT0i1Iu4EUZdXil4zGMUToXs2M4kFJd2ZZCR+U9W40fCw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324327; c=relaxed/simple; bh=G02pH48d8Db06kvsEBrKMIuPJnL8wLDz6Y2MuwmFRDA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q2gviyhDs/emSx5cBR2lZ8XTV/oNMgCV8yyhsPR7DyFVvq3F8kHwq9dAn46v3T6fYQTTyEvpR3ocFjl/pdleEacx2ha49QEt4tmVHJLzAb/ixWaHG+r/VAfzdqkD4PqoyCC3sp1wFawVaK0rqwpoX1UMhgrWr8iYP7dIzZOpVls= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=QEGyuIAy; arc=fail smtp.client-ip=40.107.236.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="QEGyuIAy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f3Qg1CUCGH1d8xnXjTXgHOEo0yOfBQjmxO6km2fYvrsVtZyU3KhpZDybLkldNqNF+20NPXwT8KSxUacAjc8ocReN4I6Q2ThE9293ItXBq0ksyhvVh0tDNaFIHg+V1QHiD5HvOiw3OdGXXFFdFwYU0w5vi6AIjAsH54ntXbq0BCtNS42TbiN+miKQyE0g38XJQQUryS6YJjKVlPxuZzRz1VUgG8KWKdTRgmA/tEirb0Zj36bBezI/eTl1D7FHTI28EB8Eh5SCGg8Zbew4gAIXclRsS5eL8wMhdNrgACe/hHlYSZkVlE1rlaahLXZS8dwmgAnAUo9kWFlFnT7OkUBSfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y1sLe1zptm6M7KMO+14mkYFferByd7hCOhOYHL7G7mY=; b=hXu2VXh5FkugJBiOSU/MI4Kohmx4FSMdvyLgL0ztlv+QEhx5F0KHYd2vLeOOfYPfPWQj+hLdAnvvpXkCtgU64DYcYlrFr9+wenR66an9VwLuYpNVbW4VVydfC0VYKD3uBfR+7gVTmB9V0tfMvCOa9X4fkJd88NqxIyUyo70L9WIZd+V34ZKiXCKGUNF5lGD1k1cGRQhuMxEkJedpSnKaYBDJTi34t5DyWI4erK+C2YkCkM19sC+tFEAX+Lza33ipqYgOCGEP/One28R4fhvE4Lj9g+gPM5JVaLI7Tc5Sd2hJ1XS/OOygo2rD3HUZ53nlT3Nao8GrAYjLCScGLat3ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y1sLe1zptm6M7KMO+14mkYFferByd7hCOhOYHL7G7mY=; b=QEGyuIAy9isScqbr1W2ns40qYHDj1BP1emxo+twvMIj57os4QwjDrqEMslHUp84nbR4XUcgDmaQ2UWLol1lBIgeWn1d7eNcTWJMLBqs+4gVsPnM2MizF+zzlc5W4YUP4GXbDuvKBNDUNYCRRbJq4Fpz1Y7AEWa2JC0K/IyyyPvI= Received: from MW3PR06CA0008.namprd06.prod.outlook.com (2603:10b6:303:2a::13) by DS0PR12MB9348.namprd12.prod.outlook.com (2603:10b6:8:1a0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Wed, 13 Mar 2024 10:05:21 +0000 Received: from CO1PEPF000066E8.namprd05.prod.outlook.com (2603:10b6:303:2a:cafe::8b) by MW3PR06CA0008.outlook.office365.com (2603:10b6:303:2a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19 via Frontend Transport; Wed, 13 Mar 2024 10:05:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000066E8.mail.protection.outlook.com (10.167.249.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 10:05:21 +0000 Received: from pyuan-Chachani-VN.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Mar 2024 05:05:17 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 7/7] cpufreq: amd-pstate-ut: support new cpb boost control interface Date: Wed, 13 Mar 2024 18:04:44 +0800 Message-ID: <1932134a71717f9c4156d7755d40af6f63dc98b1.1710322310.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066E8:EE_|DS0PR12MB9348:EE_ X-MS-Office365-Filtering-Correlation-Id: b18f8761-2501-4bcd-36ca-08dc434517e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zoUjMm1ppxIoNvhM7DjqKICK3lSoKQOEmct0/W+k+25oOaPY4Ez4YZpf8zNt2qpn1HmeakL+E2EGvsKW9DVXevwmW77eUFG97MXWTVLql93pag5sz6D5j8Vru5L2qSlbEPbFZAanmggbimtCeoXQvL7O65QCesfsab3uJW80MUV+7m9nHOQTlTFKnW3LA6rbKMGrOCf3qb0zQMHwS5WBVBxl3sNnSTuiV1qJRkeGOQEwzO+28SHq+RB9dsSTrYPwZnJ3j91wQoSU0zuJ7jWoYCrQmQThm+CkUFbWgKfZ5k6ElYBbNhHOKYikckSw4GNVqhLaVJ8gdJiZfyUnotWaIYjR4LaKLwQpwgw3gNDmZqjIOWV7QZSWIvpOw42q6VWQvcjtYvgDB2jcuNQPkc+j5d1xcSSUag0Q6rs1KONqkT0TP3aFl9c6f5l/pFpu4TzzH3CnCS+zOFWaP0jXNaC07fy+7Y/OlxmeJIivBOMR/OTzT/F6Gfyjd0Ci8DWyk0RuP45RTNfR1iGhO15w91PdzjiWwG8FFmj5Ynm0jQSAeGEreoClBunHZH+ikD51/BhHKsKjSTEstLxa4bIk8Bu5r/Ezg9a5ip9RCpGUwNAQYWHFx7SpNMcR/Kj2h90k9aiz7OMumSHGzTLZPc6z1FCUawok4y5J00Bc9m2zHt62ezNAw5xAiUZW73PzEXbfjXMVVAJhZVZT0/kLwon9mFw2fYM9wZLIFth/5uOHHEj4eot4wsVc5b3XE6rFioJDtACQ X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(376005)(36860700004)(1800799015)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 10:05:21.0776 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b18f8761-2501-4bcd-36ca-08dc434517e3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9348 As the new CPB boost control is enabled, pstate unit test needs to remove legacy `boost_supported` check and start to use new CPB boost control interface `global.cpb_boost`. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate-ut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index f04ae67dda37..b3601b0e6dd3 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -226,7 +226,7 @@ static void amd_pstate_ut_check_freq(u32 index) goto skip_test; } - if (cpudata->boost_supported) { + if (amd_pstate_global_params.cpb_boost) { if ((policy->max == cpudata->max_freq) || (policy->max == cpudata->nominal_freq)) amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS;