From patchwork Fri Mar 15 03:38:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780891 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) (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 42ADFD29B; Fri, 15 Mar 2024 03:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473968; cv=fail; b=VOLP3D4lv1VTmxe/Fq13UJMWXbg1iNSnrr42eQYLr+T/9Iej+F8Y6F6cPBcGU6HvjaerQoYo/zgJNu99tRIa6Edql0w14uve1+ApcbNQJqihKhtb4RZAb8bQBuQDaXl2i+UVBHnrSr5jIe3Kdtvey/p9AdxZOVTK/vxlrPjW7p0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473968; c=relaxed/simple; bh=/Ws93YPfQEKtzmeaXIjFwmKBI9PXsY3tbO6nBDCtKg8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W/CJCzXvGcdFLVQd7d3GOutYdGcXSuOglLziaSXKw/Jq5nuXynHGBR4nSB9g2kT47hAPLmoCfW6tJvRcckt+W6uoXg2LhTLLpzuS42rvxaUuOKCOGeqJUPeCKEz8pwW3iiHPRDy17/UotP4jTMqnW5FfFa57YZGBv4I8iWjsUAA= 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=16HsZVn8; arc=fail smtp.client-ip=40.107.236.41 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="16HsZVn8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K5/P6d2uAUk0Gb3oytZSU1JMkoCXQY+eHXnDXrRKlIFN8y3PIzWyGn8Y69z/hK4yvnH4HWzT0AXEo8014R4DSl2ZQCZ/WGM2JsEnW9/IvxiAKBOwaeRb8o7+3m1kvoGFWswATNPqFHMLgPpwIrB/RMmRgzBBAHC2NAHJJjE0LUW0219kRaLoj++BXi04HimBY5NFJFOS6jRAWTFK0Fth8DoFg4htXq0gEnwR8bvC6VlDC9JZRqCWMFIgSDX5RtA2A5ZhyLsiJmZTxyzElFnPpPEosRHVraiFduiBqse78HN88Wq7uClfV6UPMS9aRQaSywm/48gv7M0URfjqJVOLcQ== 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=CBbk054G3uTAd40lzenfkFawnSHZZ9Uc9Lt8FKpIt+8=; b=R3B6RSAG+pcO0kdA1AUnZB23hiWSO2aLlD5FvLH53KHqcNIE5xiv4vORRfHM+gEkqCzlL4NnEbFgOeDTEbr4CqRVYws0pChQbGl2oxL4G/h4yFdQudkrLq0UkH2Xxf0Q58tDGHPtZXEZlu6yI3o//LPweBjAqSMRTB6q/U31VpCqGTM2bwQS4VxcDZpHjf1vYcaviLCVrIrnpYSqriVswIeJU0fq4tUbJxqSR993FPcSdgkqfsG33cQ083hj6OeqwZqPQD01jcoiZ34lm2nETPu5apfK+8fZ72z2c246p7F0UxXPd6rEehQGyDN0teYCz+u4P089dGl3kX7JB5yqFg== 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=CBbk054G3uTAd40lzenfkFawnSHZZ9Uc9Lt8FKpIt+8=; b=16HsZVn8OdBAzihZeuIO+3LFyw/NzXJx7lZpTeniGf+3ATabBbP4YVnbHVXNVlC41H9XG9V4IcoQFsnD4UoaCpjYingmSnsGXL2+xgyQggssOf/p5aFV6t9uaZKkkaQB5j1r1YjsvD+N4E9ji9Ozv8C+dD7CrYz7cvTWp5uxliw= Received: from DS7PR05CA0073.namprd05.prod.outlook.com (2603:10b6:8:57::27) by SJ1PR12MB6313.namprd12.prod.outlook.com (2603:10b6:a03:458::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.35; Fri, 15 Mar 2024 03:39:21 +0000 Received: from CH2PEPF00000140.namprd02.prod.outlook.com (2603:10b6:8:57:cafe::6b) by DS7PR05CA0073.outlook.office365.com (2603:10b6:8:57::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.8 via Frontend Transport; Fri, 15 Mar 2024 03:39: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 CH2PEPF00000140.mail.protection.outlook.com (10.167.244.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39: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; Thu, 14 Mar 2024 22:38:43 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 1/8] cpufreq: acpi: move MSR_K7_HWCR_CPB_DIS_BIT into msr-index.h Date: Fri, 15 Mar 2024 11:38:02 +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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000140:EE_|SJ1PR12MB6313:EE_ X-MS-Office365-Filtering-Correlation-Id: f4391eb5-81ad-4549-002d-08dc44a1805d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a233nHzdPYlanzny9jV5Xztchm1wVRLZYxypgsnoxf6VBTNIgcWNqmmCg3W7VjIUe+mwEDC+kmQKhbLSPqk/27nk3rNt+bhbwKG95Yv3jqU6+93LfJ75VQLOQ9qFeW9sQrYBz7iralAFngGPMRCbEEtJfXlpDiu2hKrk39Hr4ysg4m0IpDvYrMvlXgGxgZLho5Vyo5OcykCanLegy8LwXgvZ5rZop5fBavGailqbBuwGnaUCMxa5WjyR/0Q8Q6dcwJUmB4/w8gD+UcpzYk/IltI4Td3esvHDsFnVT7+QpC8xDkv2890Xi2c+iPptZvU/0BLXtyG9Gui4ZDLEZfIUsDsY4THvHT39UnnCzN9N+Z/TDluKro/F6YP8FfRyUID+x5Uo+aRKOjNe8VKa7x1UH1EDcU72JrX7V5wyTdd1rfjQCm+GP8anMN8hHUmDi36+iLn9NiyEN+fEVBMswWNVFhH0cKQWhC0ZkI8Yqwqzkomnfuebpv68aG3vQOSbUV5pFE47EhJ66h14HjYpK/5KgvMo7EKI0tEnBMzRTNR6avRXzWnMKHkZfETVqrocDFI7n9I2akRA6ahFP1lQ7iwxlwQttCbdHZbi2Um0v0KsMwDkyAGW4P2BcdYF3s0wCbcGMfX0vvWGHUyQCCiSkmyskX0yvNHqdnMi3afUH6YyyOJEUL79MysJp8PvpFg4XRISQyurhR3Z+w2V7HlNX5JxicBQ9k+23o0ihii+H2q8aAjhfisrht3QMx9vVpMcjK4r 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)(1800799015)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:21.3144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4391eb5-81ad-4549-002d-08dc44a1805d 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: CH2PEPF00000140.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6313 There are some other drivers also need to use the MSR_K7_HWCR_CPB_DIS_BIT for CPB control bit, so it makes sense to move the definition to a common header file to allow other driver to use it. No intentional functional impact. Suggested-by: Gautham Ranjal Shenoy Signed-off-by: Perry Yuan --- arch/x86/include/asm/msr-index.h | 2 ++ drivers/cpufreq/acpi-cpufreq.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 05956bd8bacf..41503647192e 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -775,6 +775,8 @@ #define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT) #define MSR_K7_FID_VID_CTL 0xc0010041 #define MSR_K7_FID_VID_STATUS 0xc0010042 +#define MSR_K7_HWCR_CPB_DIS_BIT 25 +#define MSR_K7_HWCR_CPB_DIS BIT_ULL(MSR_K7_HWCR_CPB_DIS_BIT) /* K6 MSRs */ #define MSR_K6_WHCR 0xc0000082 diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 37f1cdf46d29..2fc82831bddd 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -50,8 +50,6 @@ enum { #define AMD_MSR_RANGE (0x7) #define HYGON_MSR_RANGE (0x7) -#define MSR_K7_HWCR_CPB_DIS (1ULL << 25) - struct acpi_cpufreq_data { unsigned int resume; unsigned int cpu_feature; From patchwork Fri Mar 15 03:38:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780687 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2073.outbound.protection.outlook.com [40.107.94.73]) (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 7E3DC8F6D; Fri, 15 Mar 2024 03:39:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473969; cv=fail; b=UQ5kFVlM6slYL6K4TUjl782qxWFQYV1E7mZr4eyB9xlf1oyoMBkkfJHfpWyia3ixksr+RMJ4YPl1zjNWCTu8Wpi9FRJDgq0qPBdgq4+YJQTrTPuWsd7Zb11FJjbDFVX0vJk646uPUoWwUhvF5QI+3Y2gJRBgbeG4DmkI54eEtYE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473969; c=relaxed/simple; bh=myJtL7eVAV+4yD+ImS+bI48DqHfbyv/Vj3k84fTTcuI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CppL4IB5/Q97Ka8krVDXyPj/MUfiUYd8GzOUu79dfjDpadTzJFCOFEBVBS7OGkD/I/190OcYJ6HM7tdWdchr7fCKm0aXzd8IIUFTi/EEreshw2bosMaFdMjL99wx/oT/9HGv2BZcu50h8OPTv1qG7Xs2PQKFnXwGz7JUuWl5Qrk= 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=Hdsm0hur; arc=fail smtp.client-ip=40.107.94.73 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="Hdsm0hur" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=My/ZV3LUGF2ZzgOHKPxC/fEIYfPPl8+7sDlh/ywGb/4QzMYYiDwwEsR9yb3wSm5e6voGuagedcspgL+6MBs1h+DVt+WxkvPjuG8y+KWyDj4LaqwZ8M8CNYLeMX2qv4l9QxpHlE958ed17bPsaUN+aRVGWTekW0dirJOb0Fb1FumFV8xwZEiDb/b1FgF8VkzAF4MXLmmHzc7kHLxid3Wfz/eIco7nZu29gPx20q3r0trexmaRvHXKS35eM/1vXeojKENdecxcYjccp4FroJelFbBCWoKty5xPS4CM/F/jcbxhu86+T5widik77O2QvglU2CrI30feZlyVdxvL4whfkA== 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=Y2CUmmbWWiTBviynVZojda1E6sD0YWvwzT88KdFIIbU=; b=bBle/lgHeov41zSZFIo/eyIlc0k0jnvG6Mx1Obv3RC8zZBk5QVd9g/TTewse/5ApIq2769ZKU0Amd5s+W+CcrHQlAo3oufopPSuruVVYYIJNC6m3NC1Ja4GiuiYUXvepC8DMzm2p/z27f1f57RT/yRO1xVCJe236OZO+xL2zLR8hu0Fh7fQCXxzYSkHf8YEtu5QG8icJ9kmh89Ytd/tXgkwB4bvbSJILqNYN/QFIFM3jnRvZV7OZX+bqSHwai510GaFc1j1rZRxMVvFNSJgTMBd5PH6y6mLikfl/CL0SH49End9C5zqz7RgQ7v35V++5f8lrF1ifkEen3l75lcfKwA== 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=Y2CUmmbWWiTBviynVZojda1E6sD0YWvwzT88KdFIIbU=; b=Hdsm0hur1IFbUUizmVbSM6O5gfqor4cFugoMZU7pD0HKKWewg5lXQdAXXXsw7Vi4mRX/zBkKVxOxrcYny9Wjo4oQmIi/vD8c1cLA/aEpxu94gAv8LaYWTChkpaLPxI+GrkxlpOWD8LRZwRsvolz+WddDxPSUXbDVuIf+TGsdoLE= Received: from CH0P220CA0014.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::29) by SA3PR12MB7877.namprd12.prod.outlook.com (2603:10b6:806:31b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.20; Fri, 15 Mar 2024 03:39:25 +0000 Received: from CH2PEPF0000013E.namprd02.prod.outlook.com (2603:10b6:610:ef:cafe::59) by CH0P220CA0014.outlook.office365.com (2603:10b6:610:ef::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.37 via Frontend Transport; Fri, 15 Mar 2024 03:39:24 +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 CH2PEPF0000013E.mail.protection.outlook.com (10.167.244.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:24 +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; Thu, 14 Mar 2024 22:39:21 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 2/8] cpufreq: amd-pstate: initialize new core precision boost state Date: Fri, 15 Mar 2024 11:38:03 +0800 Message-ID: <11aa1b6bba983cd5b2d07e797df657c9317a6624.1710473712.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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013E:EE_|SA3PR12MB7877:EE_ X-MS-Office365-Filtering-Correlation-Id: a2e6120d-6d7e-4fb5-f6e5-08dc44a18244 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AAwAPL7wT2jcVEWYC09MdLhYwtZ5yqTv4oSwFe5ve9d0KmABn8wz0nlq1XMjvlReUbDaC8iUNuqSgKfVTtAoSBhuCZ6qddln4vgMDmyqXz1jwTIluHBzjSW5eOiFJrAUc7sIaJj1ylAp8p/CkrKsxkcvCg1cA4r8kLw+By4gSxK6EdScOig2LPRgv0wmRhh5GOt8q1tFI/SPnKZAjhLf0a9EA3OJKkg0hrvQFly5evna9L0rC6XlvmVAMpErYgVNobOfl0bYwjMQZ+btW3V0aoqh73n+ddmcgaHCJyoKebulBofWF5ld2MPo/x8ra/0GrVvZfTaDCQ5UcFgz7D5YZ6XsIh4qfxOxOTCyzPuqXGyunIaLF+Sis8nNFY6Xiglt928R3h21MRM2tKnxkt9uOEtA9XjpOsiOQOVlki/AuyW7ifTGLMiKW38FhGzHnYZxi56jiG+5FGAn9A7gH+BimhnFExdIhSHgrOK6JyvxTDq6nnc7ieWnF87EhDjq47vGcCQFPnafp4FZ75gWTjOgCqsiYfByj40hvFRn43lhVXbjpCmPlCXacC5EC1vTv2ZlR6byT5a6q3l+oyZJd6Q2Ck6Xf6IeZuvedavY4AS+2eHzarbsd23CjOmqDlndiHNwn4DDY9cjStH7cIiAR5ED/Do1xFe+BBd3fa3N9k+1Of9NxXHWzq7EupUUPmdhiGxLaUUhpVnaWEnEN6ZnH3IrOg== 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)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:24.5123 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2e6120d-6d7e-4fb5-f6e5-08dc44a18244 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: CH2PEPF0000013E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7877 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" Cc: Oleksandr Natalenko 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 | 13 ++++++++++ 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 3877d4ecb5d4..e5eb09f874ba 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -68,6 +68,8 @@ static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; static bool amd_pstate_prefcore = true; static struct quirk_entry *quirks; +struct amd_pstate_global_params amd_pstate_global_params; +EXPORT_SYMBOL_GPL(amd_pstate_global_params); /* * AMD Energy Preference Performance (EPP) @@ -714,43 +716,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 & MSR_K7_HWCR_CPB_DIS); + 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) @@ -923,6 +903,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); nominal_freq = amd_get_nominal_freq(cpudata); cpudata->nominal_freq = nominal_freq; @@ -974,7 +957,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; @@ -1385,6 +1367,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); nominal_freq = amd_get_nominal_freq(cpudata); cpudata->nominal_freq = nominal_freq; @@ -1435,7 +1420,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 1fbbe75c3dcc..383359f9cd6f 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -131,4 +131,17 @@ struct quirk_entry { u32 lowest_freq; }; +/** + * 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 Fri Mar 15 03:38:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780890 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2052.outbound.protection.outlook.com [40.107.96.52]) (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 2CAB2D52A; Fri, 15 Mar 2024 03:39:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473971; cv=fail; b=BCQHBQYI5NbzKd5ZFrbmj8DK4ZeaDEtMEC3dSizDm49x8FfXJUF4FlJIiBZJto/IaE3dwDjWMbUDJ1UwxGEIriCrd6kzaQIBItanYRjdYpT3KtlcBZIDNtIPBmoxDBdWjWMgDX/e9EZ2uanFfBG+YVemwigdO66VqWV+kVspSPM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473971; c=relaxed/simple; bh=N2G8uH8/vhXB25ngc2NsVER2dgxrzzuxHwILKz+YtFY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SIx+G0dXshFk/JwaAYGhhZ+nwXrq6TwUz68GFRvgbsOnk2RzdQtnJL+/hy0cGhNN3n4K5EcZTNcEYO7VeAy/M3huranoIJQHtso792EqvqzVv3Wfs86nRTdb0EDsaREwPl14ZaON5uvqd7hw9UZgnAx+Fhv7BDBoRWtzFMwtKoQ= 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=Ptw98Llb; arc=fail smtp.client-ip=40.107.96.52 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="Ptw98Llb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kmmWFLcJlF36CbBKQ7iPlqJoDFfvymDYmsvEbI5ytdakBkT2zm/ozJrBvYG8lSQ7kGtTjtx+SvyBaplGiMtPu4paeV+UHhqZXG8rwjjhoBh8Y6YIGtMdGnQWNK1tQkoZPGZA0h4tWcO3PAiL1eu7jMhJATFQSVYWxUxKvjoLaGkX2WDtcQsEMr7Egde1Fki8CVIx61NbDjKB6153Z/LnLVXLeg+Be4GcL+TwlZd/IAJHW6CPM/2KLm7Zwhq1WPOh4rZUUyACZ1mQPXKtwjgxSKsIf1+eBpMl07zpwy1coNZ5nVfyrG1BpcSz9PTNn/cRfh59gSVlCiXMbBNcUy6f1Q== 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=qrasiwfP2K2/k40S1xZcI0oX0AKyW0N1V3XTQ3Qg+sY=; b=cb6FLQ+U28exi1DN7hLQ4mEcV3N5QRxwhuxlOy49pzGOgjQtzaBIWMHtw2Hwcqq+tQiDNZkIKjOEbL9GXd8PWCFNoMkC3Ya6BKrR/z0QIRkar+NjXdrcyo1fD6BcufjiO/pQ8zqd+7wf/mrVO7a+HVfPtFMa3SJN/qE5OIuwIEbog3adngl0o45aFQLmdCXS/zNelO5FSlcmJUw2cqeb5/8ZQfMSvZ6NYjdTu7IwsbKA3y+KxUhMs0McnI47xPN3c/+3J1WBbKMWBRnG+gHuTa+JZZYDQCu8giRspZhZHXf2THAH4TpXdP1gqwJKWj4BD3B1zeUELFKbcLo6dW92kg== 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=qrasiwfP2K2/k40S1xZcI0oX0AKyW0N1V3XTQ3Qg+sY=; b=Ptw98LlbNPRZOeJ+pKKSEDsnIpCKo2sUOuIRH9Nh8HkR4K0ryoqd0lN1YC97q5FXOvwmvQYY/pICz5OqIbHEvJFaGW/txVwJXBtuQ6UQUPa0nVE33Pax2s/FNhBeX1qUSxsunzZlSkBtHljfgCc6dUuQstAs3yI2XJJQ5tJQWRk= Received: from CH5PR05CA0023.namprd05.prod.outlook.com (2603:10b6:610:1f0::25) by MW4PR12MB6897.namprd12.prod.outlook.com (2603:10b6:303:20a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.20; Fri, 15 Mar 2024 03:39:28 +0000 Received: from CH2PEPF00000142.namprd02.prod.outlook.com (2603:10b6:610:1f0:cafe::2d) by CH5PR05CA0023.outlook.office365.com (2603:10b6:610:1f0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.8 via Frontend Transport; Fri, 15 Mar 2024 03:39:27 +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 CH2PEPF00000142.mail.protection.outlook.com (10.167.244.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:27 +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; Thu, 14 Mar 2024 22:39:24 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 3/8] cpufreq: amd-pstate: implement cpb_boost sysfs entry for boost control Date: Fri, 15 Mar 2024 11:38:04 +0800 Message-ID: <44b62d7415b9c6cfa7467ff82e88566131f4bb9a.1710473712.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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF00000142:EE_|MW4PR12MB6897:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a63c1a2-44d7-4429-4c75-08dc44a18431 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t6i8rsZOJT5uvjglUS0arcM7bzN7Iewi30CA+tigpnpc33ubg9vidU9U4ujb0PCgUXZVmfSqb4FgGh3fGPuGfDufD1S7mDFIolthZfs5PZju1PdNi+rJreTxZLTtzAdgCxIYX1Ffzm6cdmJ3y7fgEH0cZnSUmVwIr9Qu8j3j/s5GW04EpZ3fXCuPS+XH+TTbNC3JPAXA95KEuukpA6IxtIoBE6U3wd1KMl1fjkRNDa4OuYvRO+UweJTH4JUT3ddFgXr4INnTFZoaMi/zPrIMyEvm+9XyXBU7/kGRELu503UiAuF5ng9WzYB3836nEuBTTzli6dQzs5MvenI+koVaiwDA2q3x/1pxSDEQ5vz5XdCFThj6T9XfH464BhgZedhpm6CI8CqkZICNJykJOv/R5BmpFnAJt1RluOIPQ4eijf8rbCynglWkOU/n7o+gduB81nNijzs3k/7A9AJSdREul62kdCkk7Tu9dx5EGYrOMPnf+n9bctuoAfDPlr2iXOA149p4Xu5+CRUANyubCl1ZtGkZ5lh9GCVbqlq2P7WcOc/7fdt6NPTC3/FTqQl9ajsH5A7Y/1CHJJQWrf7Yv0hJ7G4sOFgUD5XB/IOsU13Ma3NVDQd+S+HOiOEZOp6HD9v6s9CzN5yDzqH44YIPDmXriq57RLhhghJouk8NEqWigLklzzXRLiWCGXnel7WDZ4RDb7d0ZoWaj0VlU7AHXNn+Qg== 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)(1800799015)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:27.7390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a63c1a2-44d7-4429-4c75-08dc44a18431 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: CH2PEPF00000142.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6897 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 e5eb09f874ba..025f35bd3b01 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1276,6 +1276,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); @@ -1286,6 +1381,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, @@ -1310,6 +1406,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 Fri Mar 15 03:38:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780686 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2083.outbound.protection.outlook.com [40.107.212.83]) (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 34895134B0; Fri, 15 Mar 2024 03:39:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.212.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473976; cv=fail; b=NI4UHdwB1qOyKcX1ZX7aWvDOQinAkjrZ0DlQAU9E/Sba3Cq9/hJAvAMZTL2zWzBVxfYyoIMVNUVKJtLkdQgY4MZL7/YcQq4kSU9rk0Pf/ezWD0wLkk3XyGg6MgorMMHnZgQNOlFvKgLQysE2GmT20GbHKt2J5ThfgPIUPaFRRTw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473976; c=relaxed/simple; bh=+uFcfpJDE68rgL47pzCgAFUoFsWg0SjQdeV1gtJ2GgI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KRmGsO0XXJqgncmcmpqnhq7Q/vxRJar9H7ssXmWWAMygQt4/PCL1uuFAxzFQ9BO47jdhNCOMvSpNmKEVCwHZPzYT3TUrdYvDyHeTz1ZhLuDoMvuTrlD2KBWOxXdaeeEWHKcm6jPdKPwrJUn3Hl7YfD5NaQmJiAQ0w/MH3nYa1Po= 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=bh5ThzXG; arc=fail smtp.client-ip=40.107.212.83 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="bh5ThzXG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DfLsXskDRYsda/FbnwgaVbId2HyoS357P3EiFNIjm1FPKbwVWvkijf/ZpZ6AEPMf27RiJOCS+gJklBJj/okzZMNYzOpTwvMkCFNfjlGLc5tImyjzJDes9ClGH2ezXRMKdqw4cCbtQIlwRU8Mqs1+nLKJaKrYle1ZZleRe4RfUSBMqcyubUoQaWQQ7M/3Co7VYl5HLssuCaMjlR0N21yn5EuiwQAWnubjYQFwlghXbwpZlVxC/LklklzfWzgMn7NkVCil1UCnOJ01iY6jqv0EXXa2TaR6v+We1El2JwQ7E7akneNRoKW5h1fnf9L+Ul2ZsoAL+Hr5iRMlPDfX3TW1gQ== 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=ujo8mSxiA2CXgf67YDYZPo7Yx/T7kfjvWkjYF2sXU8c=; b=arkudcpKdMD8N19qHZTvC6lqzZkzaA1UdfCHemJ0COnKoVPfUcTe2l6aB7AE7liRNjRDYnAZmEkAmx9xpKbWyxHm4Z1jrYXgfVORGs6mtboVBwgLzYyCGUAsw1wvbmQnDFsnlVRezNt1eWoPVtsehTT0GCZn4RIvCOyl0eAiGS/ZLf6aFIW0j9hs3Zkxf613l8t0JZPX9/YlVoGjBx3Zaj5/jvSgL1qM4Adkr7/ic1eEANIs6PuDeMpcZFl+YaDhN63utFjELntV0mE9KiisVgjmsbWuuEs/ZTyxQ5Z/wCCP1VZ51QFi+KveLBdjfYeTRtMgZcEfs4atjpVrxNT++A== 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=ujo8mSxiA2CXgf67YDYZPo7Yx/T7kfjvWkjYF2sXU8c=; b=bh5ThzXGpahJKEtUap2s/52QhykLDXJPVd81mK2rPcCPlbU5P2wEOK4YAqzbMquOe9I97gt1VeEPLXnsSxxcArwSO92AVygnrLZneKeqDu86qs7lVMtGOms94hKftZowEoR+0V68xDga9hWgSaiySukfs8JZcfsTseMH6y7T88s= Received: from CH0PR03CA0193.namprd03.prod.outlook.com (2603:10b6:610:e4::18) by MW6PR12MB8897.namprd12.prod.outlook.com (2603:10b6:303:24a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.18; Fri, 15 Mar 2024 03:39:31 +0000 Received: from CH2PEPF0000013C.namprd02.prod.outlook.com (2603:10b6:610:e4:cafe::5) by CH0PR03CA0193.outlook.office365.com (2603:10b6:610:e4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.34 via Frontend Transport; Fri, 15 Mar 2024 03:39:30 +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 CH2PEPF0000013C.mail.protection.outlook.com (10.167.244.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:30 +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; Thu, 14 Mar 2024 22:39:27 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 4/8] cpufreq: amd-pstate: fix max_perf calculation for amd_get_max_freq() Date: Fri, 15 Mar 2024 11:38:05 +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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013C:EE_|MW6PR12MB8897:EE_ X-MS-Office365-Filtering-Correlation-Id: df912904-23d3-4957-7b5c-08dc44a18619 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W5VcEBSUKiXQjzbl1v/SoYascTYY2MgnOx1vQOig4KJfxZpXHs+h3it224/sglcjJvj2V/D81HdpRpOjXot2EiHd00nD8XyM4JCGCqVPeGntmcpppnwzEVfN20SUI/4OLQxzCaTkwyPx7MiB/JeewzP5SPBF4gR5o4M0gQP0a2wf5tbRlL+dz/ppHaI6zvDRDdUxVL26a5YJAx3LrD09ixqTOy2KozB6Ourg3vvkOlNWver5N1/cf5m5uqu/Rb7YiSU8m1jtLSFmgDsBP4DjU6v/PP/u3T/TJvO6bm4E2L2ynEJWY3MtPt94dkA6I4OZ1QzkTIUQR3PekZKlMvv2oDGbs7pswloVKQUBsuJxBlJNf26mm2XMHsIMuw7JGuk2QWl/zzajenhORTBvrk+O4pia5h0vIXonz0bb9In8CUymnTURzgqASND/dk8k6OUJ5FRy07TnLFzjffgo6AEB7dZYSfxhAGrhuD0hcsfrJ6jv8KgWOsOYLSxVAwPFzHYWuPosA8YFKRT9yH1GXB0IuKSlmV6xL/VkXh0HenvDohcfYelLUmQyhVAsouhSi0jJ8uTZFRyQfWr4vANFOUvCnlalV6//V2+oZmzfO6nDawifS41RyzX51VWJoWGDvqKDnFRkHuuGFic+h66kcisFkR8Rn8KAKXF4EhumDUYGYyOcg79XgnLbpJS/u/gVsBrfZz/PofoG7VDfTvTRhq3xcB1EJ6P1UC+8beYW27zPlHiPGeOI/iKs1qyepa1p9b17 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)(1800799015)(36860700004)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:30.9383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df912904-23d3-4957-7b5c-08dc44a18619 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: CH2PEPF0000013C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8897 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 025f35bd3b01..a4bcac673fdb 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -676,6 +676,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 Fri Mar 15 03:38:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780889 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) (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 BD826DDB3; Fri, 15 Mar 2024 03:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473979; cv=fail; b=nF9tNG+UzT1ZWUbjs15VaGnEvjYha1YeUICvmz29i7jiDurGWzHhz1ttPq4e25MG+O+l1EVf4nLZNJAiZIkzYXoe+EDpkiu0n5YvSM1rKPQwn3z3gc8mLRaAFrNBl4dWGqsoUT/PK7jIfUGODm+fNj5rbjaacfUptjT1SDENtaY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473979; c=relaxed/simple; bh=2YcgaJVGsyo9caWc4TrsJB8zis71XzrpPTnRn55RcPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gsqs+Mh3VJN0Iuq5qEH1LZJBl27oEMweTABka3p7pbAnXkCofomHpTMsjyBraHZT2QyEwYQ2nU9xAVG70k6SGHG5jM/BBY5acCBIZOvdhw0afB/g1im+dKGcxT/Xe1LuygWkqtqKg6ZbA4uR70P5to5UIiEDpKwIvoxmNRNvBrQ= 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=V9AcM/3M; arc=fail smtp.client-ip=40.107.236.41 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="V9AcM/3M" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yi2Sd3Xq+zokr+XSNoaXLNBPV/HzCUUvwgHx0dR6f6FVj9/CHxzzBFP//8BnY3ZKLi8JW3dRlSJ2qyxuMR2KK/BKs6srGOqhlZ62X1JipMB/NaBJa1DRwGL2NCz4kGml9p3ggvvKi+qH3/f9i9P4vQE6ra+lNz8hYrcR+HdrNn2JsSRIFP2IjgA1uaX0zD0woLSHZBoNKObNzAy18luSWWIAmfN3/vttt/vezvOa+3Gcj8WeJUMbri/3e5Qre+YsjFFBMcpCoVPGrwmCEuJ9ZSqbHSH/4IEdWN+bWVoau/n5Z+h2cSfbOtzhVVQjsegI8fDO92mX0qTGX7nLvoWq1A== 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=XxCSwl1+rNMyLVw5RpEHbxSBQ6gujOJvaLZW3oLvGwE=; b=BJDKRSbIYZXK7e1DsBzwRnZZA7uPC2ZvkZ1jhNy8k8Pt/TbOxXrpk9r9kdiP9IWfKCrgXSxvciVjTIPVChKFC4OyTTGUw+U4ZxUNG5V4TVsK/sP64M/BgI3eOhYF9hg4YY4YuOshMc0cahHvPnYmR9cnYxHd7OylYCaOgbPaChinIJEgid+pmuMKPpS/H+DfLMtDWPU/XOBNikvvdH/TzQR22EO7J+zekseOSrwJLpuiTkDlycHILE3AecWs610vok/H1WeLjaelVZ8CxaKTMXG6FoySCWQPEIhI9Ua9AqRJQk5CLRy2R72zE0C7JF6U+4wMmFR5bcVO3z3JWO2IXw== 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=XxCSwl1+rNMyLVw5RpEHbxSBQ6gujOJvaLZW3oLvGwE=; b=V9AcM/3M5eA9jg92WG6GJx14wk5TSa89wrxvJUZzHpKXOGGplriigINdTl4+mNoayNj5N7JMBCIApgFilGQce2m5YVr3mf/PPBBCPBnyltGIUpB3v0UpmzQz4ffrifQKj3rq74Bo8p003rH6dk5ZR018NPLL0HG/hQO5LG8DXcg= Received: from CH0PR13CA0005.namprd13.prod.outlook.com (2603:10b6:610:b1::10) by PH8PR12MB7424.namprd12.prod.outlook.com (2603:10b6:510:228::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Fri, 15 Mar 2024 03:39:34 +0000 Received: from CH2PEPF0000013B.namprd02.prod.outlook.com (2603:10b6:610:b1:cafe::2f) by CH0PR13CA0005.outlook.office365.com (2603:10b6:610:b1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.35 via Frontend Transport; Fri, 15 Mar 2024 03:39:34 +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 CH2PEPF0000013B.mail.protection.outlook.com (10.167.244.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:34 +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; Thu, 14 Mar 2024 22:39:30 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 5/8] cpufreq: amd-pstate: fix the MSR highest perf will be reset issue while cpb boost off Date: Fri, 15 Mar 2024 11:38:06 +0800 Message-ID: <0a2c227ccd39c8d350289edeb46970eb394b6dd7.1710473712.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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013B:EE_|PH8PR12MB7424:EE_ X-MS-Office365-Filtering-Correlation-Id: cf60fefb-9ff1-4420-66c8-08dc44a1880f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kKCkf1lA0fGGVlsvQrhPSoMB2cJC09VamzK+Du+/sDqvQ+wKfxT2IOBGOfhuivVMyT3azRfuWxAl8F82A9tOh1RqL9rlQr4zGrcPnSTdt2lIQmeUnb5nodEycCEQ9eCJ5RN8rJvwaORmYI1JKj8rzcInc2PExAnaTcggKtmwgRIt8nywNq4tkaA7o7pu7BUvKBA06jcu2SU8s3RmiFCu639n1XHTvrHzIZbT3QJIFjpuoSCQcO6vc/zs4Hd1178Va9/N81YSL9kHMDte+K8PmPYXcCTCqTU59ZbKxBSJZ0+K6/ny3Z/5Sj94jz4wCsu5soqjgosshjr6F7EULmJ95QxyIVO0jbAZlW8BpWNwWnTOWq26I9vTd2ZChSkvmKoJazk2dxpAl6jDVpFNzFALbbjXYhM4xgB+W2CxtX05AtR61kUTKrFJCW62DptvolhNX/8fMEJ1dhgB8VPYyS3tG+KFisjdIVKn+3OSD5iaMLSY+GdRiMbN2zerucFufYtj2w1NmXTPS1TX6zQeE58Yg2enuUHlVd7oY5kKLhmvtxI6hxwpGIZuEQYYYXKjTIjfBrSrrYvp2ohe4HCXM2uGGALDPPXCASWgzs1Ak/Qu73hCp+MCfcXQJRApm/Ci47HjpmMm8dNMmWKFkVA4dWSI8RFVzhy6T/zb37ZdDmbIYdbeVikoTnIyrewc8PciXesAEajVElR7X9SXaJ7+rfIfmZiZi9Gyyh1uWzbiW3pED9DGIv7WDutm8t0bH7YU0y0G 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)(36860700004)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:34.2276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf60fefb-9ff1-4420-66c8-08dc44a1880f 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: CH2PEPF0000013B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7424 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 a4bcac673fdb..1fcb35d5c3fa 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -488,6 +488,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, @@ -507,6 +508,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 Fri Mar 15 03:38:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780685 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2064.outbound.protection.outlook.com [40.107.94.64]) (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 4276213FF6; Fri, 15 Mar 2024 03:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473980; cv=fail; b=sz0pLnbp4IXvRi6vcB/EZJi14GrxGN2/xI6wa/JwSfytpgsh2i8kifLe8dCkY3SrvYc3+Z53TZAxj2IRWPP8AfIWfoxNERaSSNTXY8bJ02KwpFDr1Hzq4adbXW+4uKyV9rT+PPi6IMXLDZVV92+y2sSlEGKz6idmHF+KGxkntx0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473980; c=relaxed/simple; bh=xEj6liAj6IMhbWAhkHuDsMO4hCwxjqNXMN9NlrsX8rk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OW5AAfpEs9fBQH81qMFI4pS0U94XNSq/LlB5Wydz9f+SohBWdr9X+PFVp3wI3x7ihZWmWgSoEJT/ySbMoOj/2zHGMnpPuFdtmQ0yDkF0zno+RWtkctl4BlVdwOYqtmfXb/+Y1X5/sQ98zamd1Q6aeZLoOV4DLcCbTDfsL6n6LS8= 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=4/cZK6+6; arc=fail smtp.client-ip=40.107.94.64 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="4/cZK6+6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RpXqQVqDmbGahTdar7a2t4l01Gfw9AATwLEDOmWuM+lstZsxYsJJmYP6RsCOIPlg0b8q26k1oXQAnKUUg3OizBg8bORbHH/93Ph/CcOtOGS2hBsTDl/ndhVoRqxEyCQhR4kOgzXdVV8VaKZKnmXNBdnjZBEev4JXfI9/T4BpWFBrasJJCrrRLWKPaaHGBgZvMeDa68PERrzml3JaHgrII4x8RNZwUwBwK+ubFyNk/ghHHsFSVBMsKXFm4ZWaY/ZxqCl5i7ZHJFZdEf6Vcd1379tXw0fGqoVHldj4u8+L+i5gX8Kn3NbRRwa3GWkhqXXMBIK2WnrU94BXItjffiyncw== 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=YVkgnzDM/9EQGVuA4jUEgHAf0D09xDbPn6TSYMBNb0r4NF+RleMkw0yWwRCACmnK7Dgh9qiF/rApk50n03vXkX0LcfHS6jFegIYzWv+Q9bAgF94T5T+a9EwES99whNnYQACQifOMu8Rfre+/gKqHqd2GhMsJILNpq47E16xqyQYL/Ks1TkFzjojvIfOLQvAuZZeRxS3pc7qLso/9FkhQNXWVDOA8HwtxhBwcsXNkT0PVRtFHpBcxyONL/EdoJoVo4d5ndp4O9YfpBBHZnkGah/btM05F4p+3neGl4CVqzJDZ3DULndHdkPQ5uj7oFUf1Om7aHU0bDQ6V7xXZfkdrZA== 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=4/cZK6+6+3OK+Ef3W7oYZBAH+/6gsgHpy8NtrknWHqAxT8L/P1z4ETAiY4cXRmVUeqw+J7BVioZd34fLs5UMR/8bmTHGa5urFxkQ7x26CbB+UHZ8u08lgkpeHHB5oiY/AW0bTLcAWOC+H0Hrgu97dbenjoftASUw2jd/Htana58= Received: from CH0PR03CA0304.namprd03.prod.outlook.com (2603:10b6:610:118::28) by MW6PR12MB8914.namprd12.prod.outlook.com (2603:10b6:303:244::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 15 Mar 2024 03:39:37 +0000 Received: from CH2PEPF0000013D.namprd02.prod.outlook.com (2603:10b6:610:118:cafe::ae) by CH0PR03CA0304.outlook.office365.com (2603:10b6:610:118::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19 via Frontend Transport; Fri, 15 Mar 2024 03:39:37 +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 CH2PEPF0000013D.mail.protection.outlook.com (10.167.244.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:37 +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; Thu, 14 Mar 2024 22:39:34 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 6/8] Documentation: cpufreq: amd-pstate: introduce the new cpu boost control method Date: Fri, 15 Mar 2024 11:38:07 +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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013D:EE_|MW6PR12MB8914:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c533132-4295-49fb-6bf9-08dc44a189ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H9ha6PiJqDvbg4misZ6arfiW2rp3ROklv/XDOmnANhzOgY5AWHdi2cHsHxkkHz1Qj9uyVqNQBaaa+ZlysijoUv6uXeeRL4Xkvxm6Q/0DU2FA+KSx0rOYLkQlp7K7Kq6Fw2Bk7oy6YIN08FjKfWj8IHmcpPf6cEb3azLhLPAIKfhwBQ47QAX/FOr5h12QcNc3IOZD2Y4wrxO6jIwf23Pobxt7I2eyi6X9P5ceSX9396VGwTf1fCll2rHcjJ20yuTIPreTHTYc+B/ylNwxn4I7xyJIitYX/CjJmwJE99vvq4SUxueUfd3kBADh74jIB5Cw9uDCq0+f6LowZRlCvUmsRnSzq6yuMGYmfvN5k4YcpTF48kOszSSoBQs9Roxbq0AjCj2ygOzmFUJG3WVd31qV7xeAmubmyYhHeLoo3rNCcbpSHe7LAFlD/6t/c213OrE4gBFVGf4BZZVY/bI6vidx2/PZId9QVIi94od2zraE9ifNFqkzs3zhRK4fk1U9sk5aR/i83ba0MgVOXsBiT3QXeXOZfJ0h2NMO9w/lCGUVLssYAxBqiaXKPEZJcrpGwgrsnAAVDHj3MtlcpKbyDqEXyvHTJBJ1zFCQc/mAmpTMeu34KFJU/SD1MtAztfFe1FHHKxMattnQDTMVUkjBjkBpPq483klFuYqmAPBgqUHQZ/mEJDOSpaGZWq7lBc9bsijB0snax54tBa3Td72QZ7khsXsLKbBJSEAi3Jgcp9KDM4/RNGDh6sHduFDiq6K2DJLf 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)(36860700004)(1800799015)(82310400014)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:37.3604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c533132-4295-49fb-6bf9-08dc44a189ed 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: CH2PEPF0000013D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8914 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 Fri Mar 15 03:38:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780888 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) (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 C6B0A168DA; Fri, 15 Mar 2024 03:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473986; cv=fail; b=B2PoTtGiDkq8uGhDJyYUD4LN5SJjntEtIb9e4fTON9otN0tsaR5f6JDhtIlnKRvxIW1Kfsz+CY8bVXJYg/DS1qcACymso/Qb/uA5FHzBn4YnyyBMLRl80VJsBH9eE0u8tR8ITzl1dPywAA2n6BvlKzg8Yz7bogHn5zGs1omjrW4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473986; c=relaxed/simple; bh=qfSuaVQA6vXMoMlgSbz3rEmG4v18F9u7XcIjVetNxnw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oAPGf+seXsK+DjHPojPVZ1XkCcW4zr/I67Ck/bpyc83XL2Kf/tb7HKpsX8jh+S4ByyAAStxeWcNZLkjEkOzEx6KqLXvR5etTR0vNlh/5iUt1+PtwwAL5wf1GkYDgNnII5381JGxA4BwB6KXNGz1qdBZqfdzdL26qbYEx1gLOCpg= 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=yI+cflRP; arc=fail smtp.client-ip=40.107.94.87 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="yI+cflRP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEWz+vUQCKKYg4nbiYLARFq304tbTBRhvi78ZEIz7PXhsY+Fwv5DYpvydi6qw+4P5lsYex8bsgsH24Qwa2uPODULphLgy4WK62Bu7VjwGJLr2u3UB0ynxo5tHd/PpEPLaEgw5GNhGvq6Ou0BCCD8R/v/DUKLaRym8UYY7zbXziLHL/iWyUkqe5fri4NmYqCvIo7wF84ZDgiW8SlNgwSLn8MhDhH38Gc8TRPpnrLvIb0sHcfY536TwHgZp4qIrpftUv7jv1Y3wgDpWwuMfedBJeP47cRnk2OioSsdttJ6UnG2wzTIeEBdRw3ssIbUIC62rwTOGdX1htRe7FbXTnADJA== 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=7n2wYoB2us2t1x4ls6RtaDCh2zxYC76HMyowEGuLDO0=; b=kO4O1sEY7VzdwMhgyK33WhDWw41xkWpMH3p1CjexHTosKuYlzfKTy6aSrqhbacdg7ibR3qjLQVNBK/W/V05aMM4yZnHfnxG5pPYlnEQa96VEICvJ2JF1J0cfDwT6NaYOKcJbEeUn96VKsSUTIfC7pwQ8HyXgRUj2odiAtLEd5sHqA+OutmIoSUGoz4B7dYEJhvWfTbRhT5xoGF56LC3sr9tk9gtXjVxEg/xo6zTpHkqXntUAixYak4TqGb+v5rCUMCKxFZMNtDp+udWN7ZLaOVJe7BnrEm/mxqXBSH7SpadklLaHK5OFYLF2JIeVYk8ah4j3CuL7TZSuCzX00/rfLA== 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=7n2wYoB2us2t1x4ls6RtaDCh2zxYC76HMyowEGuLDO0=; b=yI+cflRPjjL+9fWj/teu53BCJPrtgQpyog+0e3YuLlLwkSXrch2R8ybVOWOW9ahHIId6tg7UEJAc7QZxGHjQ3BsocQtiW/qutFCUKnnlQH2ymtFbffrM0gT0kHiMG3RHTeLCtfWiG2bY4D5m2fBtu6VielTq9G0Xo5sVvy2Re0c= Received: from CH0P220CA0005.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::8) by IA1PR12MB7685.namprd12.prod.outlook.com (2603:10b6:208:423::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21; Fri, 15 Mar 2024 03:39:40 +0000 Received: from CH2PEPF0000013E.namprd02.prod.outlook.com (2603:10b6:610:ef:cafe::99) by CH0P220CA0005.outlook.office365.com (2603:10b6:610:ef::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19 via Frontend Transport; Fri, 15 Mar 2024 03:39:40 +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 CH2PEPF0000013E.mail.protection.outlook.com (10.167.244.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:40 +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; Thu, 14 Mar 2024 22:39:37 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 7/8] cpufreq: amd-pstate: remove legacy set_boost callback for passive mode Date: Fri, 15 Mar 2024 11:38:08 +0800 Message-ID: <549ec092e5ebed43e4ccf539036f92fb03d716bc.1710473712.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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013E:EE_|IA1PR12MB7685:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c5887bb-8cb4-4d1b-1802-08dc44a18bc0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0xcvaFqkgS7wtwxx2xYstSjDsCao76VnE3zX4h2+EiLkRhlDQYHOS2saUnie8ej8a3BM+ryL+g1TuHKoaYN5TseHfQGDESnaLzlpbWPMFAODVzelprDbp1yW9oK65Vs5qUSc+tVcT5BsP6frUBfPAmLbiVxeYnAF+oJKyTO1/unxM9af+XLhAV5TcN+g4JxRXQnIrYLGA9H+VrFXGJ5yZ52Py5CopggcnF2gz6emdwTQRIf41/wQbAX/UM4EDbVrso4dKrPSIqX/9xX8x1NKq8kzuTOhKhZt752K7mBKNlFoZcBFtNkNf4eZbfJRW10w7pyTk8ubLP47ug9/FASrHdeTnTllyxj7+Av14Uu5UkcIRnYsMzDYKc1VNlaGsEkWVYujE7MKQHnZVqnHEmMabZjRWAfyg2YG+yP6FGDns1ZiqRYjOXNxhy/ZnZilfuFV12BDhbSMXlvRwiaRWQ9qmRVi3LrDCQqmIu4GokH849CTY5vAHrQ6cjsPZ04Ak3eLPMF3dh/ccsA8v6B5eD6h0xJAyhVUpgxoUh7NudWUTcoKKAobCink366nh77Aq6AsuQgc3bqtLn0RJdcxqwlvMN5gM7Hwo+4EcC3lncxrOgNnbkU7n4vHZtbzSphD9EiTvqq+T1eJ2xxJFZXA7y4opfeY/q2iNpZtl2WKdmHMvgMmPchCom9STqkadnN5yE5PfgT+YRIA8Cn4nFbu29V73pOua7CalOwInKRVvBKErAzxlD8vspKbEBfn+M7psLwM 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)(1800799015)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:40.4188 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c5887bb-8cb4-4d1b-1802-08dc44a18bc0 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: CH2PEPF0000013E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7685 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 1fcb35d5c3fa..7c39c44be598 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1757,7 +1757,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 383359f9cd6f..e89cf1249715 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. @@ -94,7 +93,6 @@ struct amd_cpudata { struct amd_aperf_mperf prev; u64 freq; - bool boost_supported; bool hw_prefcore; /* EPP feature related attributes*/ From patchwork Fri Mar 15 03:38:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 780684 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) (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 E28311755A; Fri, 15 Mar 2024 03:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473991; cv=fail; b=ZY2BaLIb/j0J8by3rauhOB9fuUkdn5AiiY7uJyvTrBXlK9gMuBITQaOiBlqGid+ODuNDDIXtFjnnIeRRIhKuAOeKNqZidwHTEZscsKP6g0Y/ww6EQu6SEQEJYwh9eS7RnhklxyoHQWmeBMeFdetpgK5WOhxBtV5/VaVM9oEzZ+I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710473991; c=relaxed/simple; bh=W+dCh9C8EntywcvXhSubkaBnZJJuzKjsF7idcfLgto4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OQEDOuAyDTzOpcvGvmSHGoQSBs7l8/59OtJ5CoSkzT5oXzjrg3KzULQeUVT353nNetfgp+KZUjloZ/a1Zns3HZE3mbVB8nHWoooWlofqXqpkhWElnGtQVj5FFXQ/kEb6JFXNHDtnfgBylacrdp0eZnm/BoUHeqgUEphonWNj3yQ= 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=xY7nkBbt; arc=fail smtp.client-ip=40.107.93.48 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="xY7nkBbt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PjGqa68fjT+noMe9xV5mPbvkLjq+ib3cmtnSeaC+qS55H4ilGnYVwDfikV5YYHHbYGFwwEtjmfPa9Vrfv9QNG8dInA6iID6yt5Wp4EiUGc1z7sMVP/A2/v57PN08Habc+J8Z2oTmEnZ70f0tBJl58UkD5WNswvfuDkEeqvjlZKLtvaWNFwzrA9T4dRB3z3ArcbAzcmymKuPcXJDIiDNPDSUsxDvTIBDLNYFAVD+doCk6rDUBiFAcM09fJTsWlG2+qZDhD84lqkKPH08qMKuk+/a9+b5RO5XAB/kCLqhSOnAjGMFuuZyXof/CAGciT/hNYuqG55DmBqdfXuM5tDiuxA== 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=o8EDLYk3NSyioGPjxU+pIEAuL4I7f4cRvkuByN872I4=; b=JdtcCMhNvtXvr2gFYQefVLoeS+7KHIXJ/Su5mJ8ujP6z7+tdFEnjMlbL+rN92NUnLrexSKnriEWMuZNhhbFPz7+8frnplPMX8Hsc+MLk+OA/3d60QGyikWsMtSLP7pTR+swc+6l+eOl4FPn5VVwCbV791xEA5Vhk3rqT3OAh1l6O8KL0otbeWMnTi1pEUuvMhzxTNqOscnjauD20UnKW6Xtxi7pLTJZPTE9rd2lIsJDBeRmk/v9dNJZIr8vUyc7bfdVZi8HWJ7vh+RouaSVnlYk6xynCuO6UG+6RhfuxRNx3/Hy75SaLDp19w2j5gdrsjRwxPWFcuGz8jNketXkhQA== 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=o8EDLYk3NSyioGPjxU+pIEAuL4I7f4cRvkuByN872I4=; b=xY7nkBbtbWOdw0N2Uxovag6/gdxUnN54kFpmh6fFl8VTuvaWRH3i+dVqK6XVXeCgXaPMq9Hmxqvd2jYYVBXUNCBhVOCwZvPG/LvL8HMxB6nTCx7nuSxqZJCBRZJIiRN5B7tJxZxrMX3Dm1mJDHtG3hT+F5qXQW6w+Y/7ym+ZNh0= Received: from CH0P220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::7) by PH7PR12MB5759.namprd12.prod.outlook.com (2603:10b6:510:1d2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.20; Fri, 15 Mar 2024 03:39:45 +0000 Received: from CH2PEPF0000013E.namprd02.prod.outlook.com (2603:10b6:610:ef:cafe::7f) by CH0P220CA0028.outlook.office365.com (2603:10b6:610:ef::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36 via Frontend Transport; Fri, 15 Mar 2024 03:39:45 +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 CH2PEPF0000013E.mail.protection.outlook.com (10.167.244.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Fri, 15 Mar 2024 03:39:45 +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; Thu, 14 Mar 2024 22:39:40 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 8/8] cpufreq: amd-pstate-ut: support new cpb boost control interface Date: Fri, 15 Mar 2024 11:38:09 +0800 Message-ID: <2ea6bff923bc440b63140388b1a9ec01417d1b40.1710473712.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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000013E:EE_|PH7PR12MB5759:EE_ X-MS-Office365-Filtering-Correlation-Id: dfb98b1c-2434-49ca-2078-08dc44a18e90 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oKesXTYHR5czBXC4Joqd1NgYffy0/JJE55PUmXo3Hx1ycOdGEeBofTFhoivix66dU+u2Xv4m3UrltrSnUQFm6/7fVDh0n3RlrCQsg6B22DfGeMJsNa1TsqzNGmqhJ9tfq9TAQAgeHsb/4nPtyYVqMm+6z3KU/njg/gqCItGh0zcrldNcNbJdwL2IO50dNXP5zeKyb44GFge2DN3BANv70iOHyYUlUqq4ihio9OvHCn/FnhxUwe2oHoySMSeiToaJB18GIdzcv65ZsaX7ILuqhJsGc1mSzYBbD1QJq2byIuxjtzceZhNfmOponr9iIU0euzRCyoiQJkOBBjg2lBPOD9dkL5MGb5MCb2GRoiDFqGSf0AH8ObL1j+10/6xjG1ODNAZtGdkRO7/A40URC4+gCOQfj/VU/SyPuRgbr73deIhsScxU4Z5hHTdH4GGVrh4R+UmMzD/zSfKJLnxihuVRD+Z6SzhhFm+t7eIIjmsa9C+ZNmpeLYadGWo5vQjKFkwKNkfpz99VDuMoWs0GJT0Bjt67gZ8H7avWyrorOikGiFO67YRcUqIPBzxxusH+Ge8RdiAJcKndmkg9WO9tF7poT46bthdxqKjvXt5kpfkpIu9WR4ImG/nIauyPvqTpamHscw8uyeQQ48whUFJC55RCgnc/DC+XPR69J3JIA+Pp5CuK4V5Pjk4yRA/z6LQFhIeN94SXm4SZJMBxQJ+kWbC/iCNpzinZjftvsPh53SeFbvsUdFxuPo6nTTJz7TlV6fok 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)(1800799015)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2024 03:39:45.1532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfb98b1c-2434-49ca-2078-08dc44a18e90 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: CH2PEPF0000013E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5759 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 `amd_pstate_global_params.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;