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: 13591198 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:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13591199 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2066.outbound.protection.outlook.com [40.107.243.66]) (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 39E113839A; Wed, 13 Mar 2024 10:05:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324313; cv=fail; b=Lg7Q77dqsn0uypJa12JkVfjm28Bun4K0iABZMPAyItKW3yUMOkOsSsRsqNMmP/obX5fTDbZJyxqtIVqJ9OAmN6UjzTwwAOCFMSuFJjwXDokNTq67yU7El4GAr8sc8iz9jtX1Go8fZIfBKKARgVEYuNwTN9oyZQNkO5iLGpIQZwk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324313; c=relaxed/simple; bh=TM8pMocKSd7oBtGmwsR1Ysr3PPb+DbjlfvkqkQpwt/c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sPjAhsmpt0kfz/3mDLNaIUdl4s7+Fa5SuVPR0TaN/feuRgTAo/lXGquPt8iAUxRIJLCaQKle8txjLDSpKZb7AwTuk38DQy4kzZQejkUoIj4a3jjvh77H2kAIIx5+3o9kHM2F0iQEPc3M/QrGTKfI4eMGMhQ1/N4WbCN75qIbDnw= 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=dYQ5bE4a; arc=fail smtp.client-ip=40.107.243.66 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="dYQ5bE4a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fIwirB4LyHNMshntWXs0iZbkUNaSpsmLB2Mcy4shv4RZnDUHMRD8n8weZLOZ9oIMP/qsMOm9iU7mGtDeyvUmV96DdB37POC4900iXQHrfTgPqhh+qyoDoxZhgQ1/Iw+ugqBNUIGyaMCMNlfxD4wVCmwhi8jARP92YoS+vZUhupFMe1v3z47qulEymIyP+W4RntDX9zx0l2oIUTrHMJHsrkofBLHmupEh0hlHBe3JL7qPh7UcEmlAsv/Oh7SEmX8FAPd+FCFI0wHlN7RSkKffhF4HCTfojJPUF4maSpwZc5V4N55VUu95Vn8BGVanrdIUbAqpcnJoD0h7G7mdewVaTA== 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=K9IbG4In8tSgG/DAcZxwx9Y05nkzeyUUEb/tvcDRp6M=; b=DZemsCA4vjU2+I4+6g1VC+cyFNpUfKbBLSsgQp+ylszyQdyi/e+LffIo7i9vPfLj+uIyOVhdnPih1hYqd/E6Bs7BKvJk3agFRVDNcrKeYIzBNCX8UzdfQ2e0lqg8WV0FYq9T7gJHEecSytFGrh+wFI29opRTIscs6955tSXj1pbmBMDCWYh9PUePIiXJQDxOmfxGPjODpCfzm57c5YS59QzrRCQUAjzjKNpidUneCPvtYPrcyRdZK96BjiMk2fymIEM1E4WM9s4YLxK96iw23eJgbCGU82rcmzNJRfsReDpY+pL5MPJ9Psjt7RBEPRgp0U+8ZGL04zAs3uHGDyl+DA== 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=K9IbG4In8tSgG/DAcZxwx9Y05nkzeyUUEb/tvcDRp6M=; b=dYQ5bE4auLJisBafP6oSBWxKCbt43dfCNvyMlqXAIAyPuOEIPqZEhNsnuWldIuE6pSucwAUQpgVsxgy6E52creuWRhxA4wynJP4KJVatCBP73IOmuH0LUbI/1C5WykdlDii6A8btDGG2bqCINhb2Q/861R8PjD9bxCBOUsVzLno= Received: from MW4PR03CA0224.namprd03.prod.outlook.com (2603:10b6:303:b9::19) by SA0PR12MB4431.namprd12.prod.outlook.com (2603:10b6:806:95::11) 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:09 +0000 Received: from CO1PEPF000066EA.namprd05.prod.outlook.com (2603:10b6:303:b9:cafe::5a) by MW4PR03CA0224.outlook.office365.com (2603:10b6:303:b9::19) 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: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:01 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 2/7] cpufreq: amd-pstate: implement cpb_boost sysfs entry for boost control Date: Wed, 13 Mar 2024 18:04:39 +0800 Message-ID: <42a36c7f788e0fb77d4be7575aab9c937e1773de.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_|SA0PR12MB4431:EE_ X-MS-Office365-Filtering-Correlation-Id: 63901cb6-0d75-45ed-314c-08dc434510ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JbywOTAvW8I5tJaPLEf0xf2bZLt456+2l2WjmX5wqmOEt0ZO4cACSsnAvf7KKcFMH5xyyK+jeTgYA76ifmbl9SxojUmX0a1YuZGbIgPgeGnr+tFhXMS7ZSIm8MzVSboHDq7AUD0hBF4Ey2Dz5ZG4UBcUSUOzsh9GwNkaID8owbKn14zZgdlaWEZkUE+HyD0NLPGf5T68zCm7D5W4gJKhQ5mxpbSXijQMqmot9sATlmz6ZeTit0+snnA4L+5cgLbB8qjynA2mcMxVzmXj2bCgPoFTO2I6jpmOa+Jtt+U7Cw5/9BdGx1WeXYxC0n5l8O7ZH/HZAAibgLwcqcT+iSr78g9pa0V5vXBITMkOTCc14BnQ+44yxN60mJMd7DKinpR99QZHYkdtrtmVF9hQOmcUDikjMpSiP1iNg9lIoQmOpuOnly207CIVE4U/KfP4kHRTZO1jupj/CDncBtqSxZBdWe17D4OuZrsi0t1iPlUFtRqYbkdLGxaPGbpRVY6rN3f2wE+N3klHkl3utZbwJiunP+JAOV7vFGqEfqVY5IlgNhA5wwjku7HMMyjR1OpqU6b6y24kP80cV0Glwa1+hm1wFUBujuhuxMxTwIJ0fETZ+AcDB0diUDDuUIdqv9in+BmvtxOz8c4YqGPcyY46m1Si/6TixaXOmST57Zgy+A2xE/TGNa3UiY/LSfuxnsD9ZwndjxmTPHCUcn8dvDiPK1GVIQ== 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)(82310400014)(1800799015)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 10:05:09.5169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63901cb6-0d75-45ed-314c-08dc434510ff 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: SA0PR12MB4431 From: Perry Yuan With this new sysfs entry `cpb_boost`created, user can change CPU boost state dynamically under `active`, `guided` and `passive` modes. And the highest perf and frequency will also be updated as the boost state changing. 0): check current boost state cat /sys/devices/system/cpu/amd_pstate/cpb_boost 1): disable CPU boost sudo bash -c "echo 0 > /sys/devices/system/cpu/amd_pstate/cpb_boost" 2): enable CPU boost sudo bash -c "echo 1 > /sys/devices/system/cpu/amd_pstate/cpb_boost" Link: https://bugzilla.kernel.org/show_bug.cgi?id=217931 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217618 Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 97 ++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index ef6381b48e76..d54399ebb758 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1208,6 +1208,101 @@ static ssize_t prefcore_show(struct device *dev, return sysfs_emit(buf, "%s\n", str_enabled_disabled(amd_pstate_prefcore)); } +static int amd_cpu_boost_update(struct amd_cpudata *cpudata, u32 on) +{ + struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpudata->cpu); + struct cppc_perf_ctrls perf_ctrls; + u32 highest_perf, nominal_perf; + int ret; + + if (!policy) + return -ENODATA; + + highest_perf = READ_ONCE(cpudata->highest_perf); + nominal_perf = READ_ONCE(cpudata->nominal_perf); + + if (boot_cpu_has(X86_FEATURE_CPPC)) { + u64 value = READ_ONCE(cpudata->cppc_req_cached); + + value &= ~GENMASK_ULL(7, 0); + value |= on ? highest_perf : nominal_perf; + WRITE_ONCE(cpudata->cppc_req_cached, value); + + wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); + + } else { + perf_ctrls.max_perf = on ? highest_perf : nominal_perf; + ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); + if (ret) { + pr_debug("failed to set energy perf value (%d)\n", ret); + return ret; + } + } + + if (on) + policy->cpuinfo.max_freq = cpudata->max_freq; + else + policy->cpuinfo.max_freq = cpudata->nominal_freq * 1000; + + policy->max = policy->cpuinfo.max_freq; + + if (cppc_state == AMD_PSTATE_PASSIVE) { + ret = freq_qos_update_request(&cpudata->req[1], + policy->cpuinfo.max_freq); + } + + cpufreq_cpu_release(policy); + + return ret; +} + +static ssize_t cpb_boost_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sysfs_emit(buf, "%u\n", amd_pstate_global_params.cpb_boost); +} + +static ssize_t cpb_boost_store(struct device *dev, struct device_attribute *b, + const char *buf, size_t count) +{ + bool new_state; + ssize_t ret; + int cpu; + + mutex_lock(&amd_pstate_driver_lock); + if (!amd_pstate_global_params.cpb_supported) { + pr_err("Boost mode is not supported by this processor or SBIOS\n"); + return -EINVAL; + } + + ret = kstrtobool(buf, &new_state); + if (ret) + return -EINVAL; + + amd_pstate_global_params.cpb_boost = !!new_state; + + for_each_online_cpu(cpu) { + + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + struct amd_cpudata *cpudata = policy->driver_data; + + if (!cpudata) { + pr_err("cpudata is NULL\n"); + ret = -ENODATA; + cpufreq_cpu_put(policy); + goto err_exit; + } + + amd_cpu_boost_update(cpudata, amd_pstate_global_params.cpb_boost); + refresh_frequency_limits(policy); + cpufreq_cpu_put(policy); + } + +err_exit: + mutex_unlock(&amd_pstate_driver_lock); + return ret < 0 ? ret : count; +} + cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); @@ -1218,6 +1313,7 @@ cpufreq_freq_attr_rw(energy_performance_preference); cpufreq_freq_attr_ro(energy_performance_available_preferences); static DEVICE_ATTR_RW(status); static DEVICE_ATTR_RO(prefcore); +static DEVICE_ATTR_RW(cpb_boost); static struct freq_attr *amd_pstate_attr[] = { &amd_pstate_max_freq, @@ -1242,6 +1338,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = { static struct attribute *pstate_global_attributes[] = { &dev_attr_status.attr, &dev_attr_prefcore.attr, + &dev_attr_cpb_boost.attr, NULL }; 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: 13591200 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 Reviewed-by: Gautham R. Shenoy --- 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:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13591201 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 EEB503BBCD; Wed, 13 Mar 2024 10:05:17 +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=1710324319; cv=fail; b=GfBNxvrSViFaLxiluhhvlfmO+tJaapial3a0fO/CMVZW+IX/wQry0ESf7I8sbCNxBz+NSrjc4qS1bGmC9KDRjvoByiyV7lKNWskqg73sTDKqjzaDZVkGYhrn8oCwbxKf7IF85tt1n5dFcqNp3VlWF4e0sRPZQx2cW1GqC+KBr+4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324319; c=relaxed/simple; bh=VQYmYiArcYPOCwXYH2OSIeRlsH93cEG7r5xGn06R5Mo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n6desgx/Sc2Pf4LzHx57X5+HNtgUnBIe7lHDEkRhl17sOv+CEH9w7F7AlJNgb8NFL7StZh8awucL+l8YlegoYNrAtRCQOf1r81p+ileb1Qu1wnYz6FVNQnm6564Zbyk6hBE/8ESYJGpEVZIbPIZ6gyPodE6xnQ7ygqn5LZUhHP8= 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=fx7y2Leq; 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="fx7y2Leq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AftPOq9OaYjyMac3XYXqtaehlMe1wtK0KKj9ck0H7kdYwnbN9iDqsuZQFB5BCTq5SOOqTT2Oz+z4bs7c+8FR0CMQPrPLjcWALSUp3jBhyKLrRFSz0TslgVAE/m3zBH3xwpGBWx27P14V5/RqUhd/1e1TSx3Bq/dtE16LRIbHB815fEaWV1kbhJcxDqS8TNKnnxXR0StpV09sebeuT2qNGPMRNRYfhsbuFSHZzlL5JE55Lz5oql8UM40yXo2KIOM6gVWSMSVxI3LV6yOQqyTPPmEi4SBINzPWSIWFOJXCfEMs8AlJWm8t42aKdxALrQIn6t5kYV7+zUY7FZC8kg4Xhg== 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=iDGT5beOhaesEsOnd1HFjQW/L49aJkGIqMFpBAJi5Bs=; b=fNmT/oW9lRRTEYVA3H1EgPXQTotBVrfGZ+WrEoTdY1mmMjcbd4gCIqsGBJnE1nzhU71BSv2tbL67TDqe8ZMZHYydZxClXLtBdR3W9ODPPJaHiExcVQ+VB0MwyahwVokEzW/fK2DEEEdakYdU5OS8IyEGNwB4VRP8oEXy/PS948ijlxw107dPTX0nfygn/ADc26tVM4OsYU4G++KQpzIk8HyLRG3uQJ/h7b7cr1S2/0UUbB4gsuY/iZOeDAaVULAMoOtQQWIMXS0vGUU5EvsAmBby/fDtNm/baW6g3/gYTyUgSAbAAISOeelCxJDjWmyu494hQEw0mwpmyJFDFxQytg== 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=iDGT5beOhaesEsOnd1HFjQW/L49aJkGIqMFpBAJi5Bs=; b=fx7y2LeqLkjq0xzGzFYXS5w+19pDHT7UTQX8r2B0At/zPW2UcUPzIS1rIQY6qDoRRSZ+PdmC0qmFU6GkjIndqSM/Mki0sK4KJQy+NdbOnFld4Yrsit1DzEWQvXH/h5+6BS2hOqTr5VyWtXyb+ORJpPUkvORmEUc2rccQhhNYiS0= Received: from MW4PR03CA0231.namprd03.prod.outlook.com (2603:10b6:303:b9::26) by PH7PR12MB7018.namprd12.prod.outlook.com (2603:10b6:510:1b8::14) 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:15 +0000 Received: from CO1PEPF000066EA.namprd05.prod.outlook.com (2603:10b6:303:b9:cafe::7b) by MW4PR03CA0231.outlook.office365.com (2603:10b6:303:b9::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.18 via Frontend Transport; Wed, 13 Mar 2024 10:05:14 +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:14 +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:08 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 4/7] cpufreq: amd-pstate: fix the MSR highest perf will be reset issue while cpb boost off Date: Wed, 13 Mar 2024 18:04:41 +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: CO1PEPF000066EA:EE_|PH7PR12MB7018:EE_ X-MS-Office365-Filtering-Correlation-Id: b969cafd-3da5-4e05-84f1-08dc4345141b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m3/MghirK9frelaoNexpdH2OZEwWGqtfIa5a1d1XWwPR00fc0BO//21BTnNTwoh7bQAJb1gdPplENKH06MPm+2BcPGFZN/Hiz4LMWzl8LQ+wVa4JpIVwAY9lnCoQHqUNaDpDHXRcVy2i6cz9XLpCoRr/w+k+gTb17hDxVIT6R8nAvyrbr6K2SPYKq7G8DTC07vHXE05MZgq+tRDTmgDdQJv/c+ph/fJDaRPKsmYZkfNDKhioV7UqOaGfL57S8rkR6re7VV7vyGbC6QSydssj19hmX4RDNm19Gd6xzzSFCFW4kANId/JYkNydFbgCr6TYAhnl1c0tSJa3W1FaYL09GuWzU5hqXw4Mo3hI6sTQp+s/CN8dlFXpqawgZ2lkOzOPT7fcNSVyRaaQ02HYZP1uyIkEI+M+sfeoPBZa5Jt0ZoAHjziK6coiIxX3MC60TntSL6sKenyqp2HD0VZIZKbzRjJE6gE/dD4DDiJ67UywKxbHDYzdfhtqSWTA7J//bumwN+ts0cAfV8nPQNNf1U3ruvy/bOQeDLahdOkdy3jdlv9HHPhzI07cys4lzebGoik1OghRZs6CqpJTLIKxpYpiHB+toDoSIZEfRHhxvmUna5XGunXRglZJeRdMZan8bEmYDZELACu4LOKbBx2y1u1y9Mx9jLPz9B+JnsujtXXYUfD2ZZNxV0KySk1zYA1vZ0kENOicJWQ7fPHytf2l9EBoTTvT2c1QLWlDjKuDMLZ6orixICv2chg4MURV5GZ+eFK2 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)(1800799015)(376005)(82310400014)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 10:05:14.7357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b969cafd-3da5-4e05-84f1-08dc4345141b 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: PH7PR12MB7018 From: Perry Yuan Select the min perf to fix the highest perf value while update pstate CPPC request MSR register, here we need to limit the max perf value when CPU boost is disabled in case of that highest perf value in the MSR will be reset to original highest perf value which cause the BOOST control failed. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 0965fbf660dd..d7afbded6e3d 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -440,6 +440,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, u32 des_perf, u32 max_perf, bool fast_switch, int gov_flags) { u64 prev = READ_ONCE(cpudata->cppc_req_cached); + u32 nominal_perf = READ_ONCE(cpudata->nominal_perf); u64 value = prev; min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, @@ -459,6 +460,10 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, value &= ~AMD_CPPC_DES_PERF(~0L); value |= AMD_CPPC_DES_PERF(des_perf); + /* limit the max perf when core performance boost feature is disabled */ + if (!amd_pstate_global_params.cpb_boost) + max_perf = min_t(unsigned long, nominal_perf, max_perf); + value &= ~AMD_CPPC_MAX_PERF(~0L); value |= AMD_CPPC_MAX_PERF(max_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: 13591202 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:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13591203 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2042.outbound.protection.outlook.com [40.107.220.42]) (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 E785E3D0A9; Wed, 13 Mar 2024 10:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324322; cv=fail; b=FjYBRrW86GIgz5jlWhKaoUbW3xzX6dAOIY5aNRRktN91dmhSqK8285O7Q1X0lzev/pfKtNlLC4F3XTrYg9fkdAdYiUsvjf2eY6mtEY+wg0xE7awksJ8u5ukNvQHPnGnmPDhEjnNJ74oKw3VpwQU3C9eWnE6nDG334n2DNNLq044= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324322; c=relaxed/simple; bh=NaQlWgruB8f75lyyUje9ch+TOpc5FR0j63DSnL8OiQo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C95zZIe2lMK+EXVme+2+A7wQXT0bOD0VIbvadbn5trlqnQe8xDVVHaJzSrFrIic4hh88jvdis7VfvboPi4xWdflq3LrlTEoEiUxaT6l1WmtknyJuvPEOmP/cXxCd/j2/jzQalTjik3lrXfjOVzqvqEzhPfXAfAcj1LNnnBWiGLE= 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=jKAxdt0j; arc=fail smtp.client-ip=40.107.220.42 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="jKAxdt0j" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Db92L22DY7igmTlEhU2NMErtAGDycWvnuKTqaosnzBWAUyvHjP/3qdzw2PC+cw11Dn1+2SzVXSfv2IsgWsbt4mbYvlN5+RJ7aMTZf/NY8gyygwc/YuP2f5LYfapcL2ory1it4KP7Gh0shdkdsOoRVHYIZ3TAz+4i/3j48/WfkIKIzFoc3apWJ2ZjRdQQGA7YP62OyNOhcXfOPM6Wmg0Z1/RIAI8hgu3j9xGONd2c51DOFi7MVyzQ0nyQmOtyVwYZesLTE/5x3x363eRMYze5XqXtCg+sicb0aJuM26/8wWhtCWboOnoB1IZp53CxAvhkeqGG8XRxcz+NQDfBo/uqeg== 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=admHVOE3wrrt3hMxyBkh1upakPhDQiP9yxu/Eykl4TY=; b=Fg8za6GMqx7L/oGhjQ04QLXFRBo1uRxXleqasyViFOY6eT8pOCQhEyoPkBmtYPTREd3UIZ6W+UHJV6IGGXQ76Lhd+NyCTW/GPTJJ5reUkc4QTT5zK9afzrvO7e34t5RZJP/w4u3Ttre4n3j29YTcc/9KMWYSZcXFGfpERg8SDCwCQPLis8y9xiEq4SICh1a2PbY9zpPOY2674eevN04bxK89EJSM1GEIjeKBNm18HejhDIJyZs4URLMg3BluvwR3vJbyqjUDub7HviekCO/wolNkdJZFETBW1KiZk99DMgGJpmqw9NzoWuF1P6313t03rTx7g6k8yz3099/aKz4P4w== 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=admHVOE3wrrt3hMxyBkh1upakPhDQiP9yxu/Eykl4TY=; b=jKAxdt0jrJw0pTMig4JkzgOYGyjnKeUbLpCR4R7MrWiOQ8Bq5+fk5i1we4oxCZejOg0jeEbgQLfK3IOE4ttAFJ2QyEwcXD4ldRiHv4f3groBA3c9mZ31F5jRRrdGvffrTFLKF71wnmp3Euyg0iOahT7nIX4X4ZU3KMQuvKueQT0= Received: from MW4PR03CA0231.namprd03.prod.outlook.com (2603:10b6:303:b9::26) by BL1PR12MB5754.namprd12.prod.outlook.com (2603:10b6:208:391::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19; Wed, 13 Mar 2024 10:05:17 +0000 Received: from CO1PEPF000066EA.namprd05.prod.outlook.com (2603:10b6:303:b9:cafe::20) by MW4PR03CA0231.outlook.office365.com (2603:10b6:303:b9::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.18 via Frontend Transport; Wed, 13 Mar 2024 10:05:17 +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:17 +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:14 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 6/7] cpufreq: amd-pstate: remove legacy set_boost callback for passive mode Date: Wed, 13 Mar 2024 18:04:43 +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: CO1PEPF000066EA:EE_|BL1PR12MB5754:EE_ X-MS-Office365-Filtering-Correlation-Id: fdb33923-f454-4cd5-23f8-08dc434515bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eiqpKe6HPgYqvwosMYsT+PCNOBqHNin6DXW6oi1VAtypteGuSEvtawpKdJ9J1ztbpWBANM9MOt5pM/Jo8maO2f3G6onuldtypWwl5q8pdy0NlbfIpyhuKzQneQZMzh60zudLbtFXSZdw3XWYg37e65xCe/dgrClJQDyGVmxVmSDw7wML/cuSl9NJA8oWMOCXJea9//ejU95o+4b/x7jtAsJMZcQc1RyKew5oL8UTMsfbCm/X4/x8OwYOrSGRXc8bpl9OHjWMqBSOPj3TUATNcohu9rTyY88boEaRu3pEi+0IdmhthXbMUID3pYa0h0ImvHNy7kGF6YdyhtEk0nCDDV0DQObZhDdrb/0GBLqohdU4nkYjZymoCb0BRLpg+Yjy3Yf9KmCsPuSlig6IcG6WksvBm+ex4Ko4S0XWgV7xzfF4EtzkszCBmKWSD9iq1LntvVaiQAiWIeLUg4uWJPelb9A68YiaPPcTRzuhOrIGikXVZXB60j2ZPcfhp+sP6myH/0mWcY5bbVf+seTQXRxVdeluOyP4JRxSQO7BQrUVTeFI8uLCk8QhyyrjsDddofiJCeNBl/mq2TJWIuR9K3j0LRPQ6v5XUtLy/zpvuV7Fk4xu7PJb1zGp0OP2adGF7WQex2hA2cUiT40XJTc6b/wI4BNlupS22LTRdsS2qPffK2pUjMlIXkx7Jwf/hA0qNxca822I2MbiOPLQXzvvKc6HHRrDG7zusk4WfRaWR8f0sXx7rzU/BJFMIFoTb3v2AtVT 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:17.4857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fdb33923-f454-4cd5-23f8-08dc434515bf 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: BL1PR12MB5754 With new freqency boost interface supported, legacy boost control doesn't make sense any more which only support passive mode. so it can remove the legacy set_boost interface from amd-pstate driver in case of there is conflict with new boost control logic. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 1 - include/linux/amd-pstate.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d7afbded6e3d..4a24db868cb1 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1689,7 +1689,6 @@ static struct cpufreq_driver amd_pstate_driver = { .exit = amd_pstate_cpu_exit, .suspend = amd_pstate_cpu_suspend, .resume = amd_pstate_cpu_resume, - .set_boost = amd_pstate_set_boost, .update_limits = amd_pstate_update_limits, .name = "amd-pstate", .attr = amd_pstate_attr, diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index c6e2a97913de..7130b297c522 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -56,7 +56,6 @@ struct amd_aperf_mperf { * @cur: Difference of Aperf/Mperf/tsc count between last and current sample * @prev: Last Aperf/Mperf/tsc count value read from register * @freq: current cpu frequency value - * @boost_supported: check whether the Processor or SBIOS supports boost mode * @hw_prefcore: check whether HW supports preferred core featue. * Only when hw_prefcore and early prefcore param are true, * AMD P-State driver supports preferred core featue. @@ -93,7 +92,6 @@ struct amd_cpudata { struct amd_aperf_mperf prev; u64 freq; - bool boost_supported; bool hw_prefcore; /* EPP feature related attributes*/ 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: 13591204 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;