From nobody Sun Jun 14 01:35:18 2026 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010050.outbound.protection.outlook.com [40.93.198.50]) (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 91FD036C9CC; Mon, 4 May 2026 23:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.198.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935717; cv=fail; b=MmBMsapJNZRZbJ8Zv6cKtCmW7WRqVG4k9gdUZR0qrE7TjJ61jt6NSDPDAZQARcf0cokyQMHNy+YlmCN+YFTyE539B9HiKhPUmfqqDce1mkZtubzHjJ/+eP4u9lszE1f0TagadqGocxNWZTXci00VNrnF84zsKtlkDepRLaALUug= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935717; c=relaxed/simple; bh=8W1TVJju9Ngm2MeMp25yzFLGLZFZ+BUEJmp0hyl5Siw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=afYZEH4X6b9SkqwPxZlNyzCnTdc5sxghRB1y/vfC6+FHuJEy9+ykKylTqPsQsjABE7XDW40uUYd8wVCt59LE8SxSpMEChEciaNNTrf/w5sZ/y49/VFkdZRBNjRugSe4l3My+b/BYD3G8FgFWKFI5rjzITMst8lUux9/IleHAXLs= 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=rtE96AQ6; arc=fail smtp.client-ip=40.93.198.50 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="rtE96AQ6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OiO8GdwBIApeWOeTXlhR4ykZ5NzFojJRA8xigqIrfl2Vjc1Y+QfOfPpiF3OH+YjnjskNqEAanfQrFpGtF93zsg5bk1HXhSefTudF3NG2f8ti3lMqoO+5lZi++9Fi59xdC4hek33wjxct/MUqco8itBnluzj38pMXvmctuNK4qJBTY0kHr5tELebF+cO2I2mYmLDsZQsjqsTFMFFYefVdppmhO5ah7ZxKZ1kIIUEeQ1jY8d1sjF89nvOyqMf9h5KeEJlZaQysG+0dNa+2qCDqkVgFvFWhkz/bWu3YvhR+gND+79q483KTvxSw6OqU6Do98oVHLr/ZbgKu5FdDmyHRHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=eujsdyE4ZFQunKpBYOkk0PvfjY7/ne8UmAo3Be1S468=; b=tubXhi2uR5l6spW64+QGoix7ygRSsVnJDUFbvIqLFHNoxQB9oAiP2KxTcftMs6qXVTByysiPUXBncCvL1k8jGvlABaaTN3tT9lDoO7RXBwnrScDCdUqbxHzcXtJryOWyMV2YXHyu1qePXcCTDBa4zRpisbjcXnyF5CAVsI1ccubD2NXx26lZl8gQKjd1tifEhuvns841gwlksXBHs4nTBrzy5RlG9CcdS8IJWucKeo/kAfXDAuA4fnusBzprpF7EMD0NlXzCltA9ODMTZBIsyQ7B5HMzpL4d1pobRgzcwm+D1vgmsGkYgYOoS3Jf9bgNQc31pRP+oSruV5JusXiDuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=eujsdyE4ZFQunKpBYOkk0PvfjY7/ne8UmAo3Be1S468=; b=rtE96AQ6KjQp+mRLeLCg6tNNGpunrm/8jNvL1fdVG/4UnQaFynxV6T9N2SkSouN5ginR4CClbs5YUHDdU7ignK8UjYlDxAxKKUTY/69IrM2IT4BP/MbDu4vtY31vnaMErwbfheANN9SKjEPq3hJtM+TBWWq6D7Z3z/jNPIVkiwU= Received: from MN2PR04CA0003.namprd04.prod.outlook.com (2603:10b6:208:d4::16) by DS0PR12MB7827.namprd12.prod.outlook.com (2603:10b6:8:146::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 23:01:53 +0000 Received: from MN1PEPF0000ECD4.namprd02.prod.outlook.com (2603:10b6:208:d4:cafe::1) by MN2PR04CA0003.outlook.office365.com (2603:10b6:208:d4::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 23:01:52 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MN1PEPF0000ECD4.mail.protection.outlook.com (10.167.242.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 23:01:52 +0000 Received: from ausmlimonci-lx1.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 4 May 2026 18:01:51 -0500 From: Mario Limonciello To: "Rafael J . Wysocki" CC: , , , K Prateek Nayak , , Mario Limonciello , Kim Phillips Subject: [PATCH v2 1/5] Revert "ACPI: CPPC: Adjust debug messages in amd_set_max_freq_ratio() to warn" Date: Mon, 4 May 2026 18:01:37 -0500 Message-ID: <20260504230141.484743-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260504230141.484743-1-mario.limonciello@amd.com> References: <20260504230141.484743-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD4:EE_|DS0PR12MB7827:EE_ X-MS-Office365-Filtering-Correlation-Id: 975d0128-cdec-4b80-77bf-08deaa31214a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|1800799024|376014|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 1fZ2wEXdPNdfaI34Y89LA7zUNTHTf4F7g5h0nhXxHtYxNJ6xpv26YUuyGW+hPpHC/I9E1d1g5TBrdKlA7TbD6+duq/tMkFiBNyc7pmzKr7ZzrwJ+CebaQ0pNW/pK8hlk7HEzeoVbUe4+xCHADB2yr/RqEs9ig5tQZHUJw7FQf+ezwRZGcwPyDXrdkgmrovuK/aSDIVILCkkvdRqTIMpzoIUgLZWRJpKtUz6wZxL9e+oTT3Jqri6RpoJVnx78yzNoCtdcxa4yW9QK9B6yc9eYh9ogj9ZV2K3Bj9Uz5MxqJpEOnTwnoNjcIXv+6C/I5KylRtPbrwWz4xTiDwtVD1vRfL6s2aV1SIWTrqoep2NklnM1wBKUuhN6eonq81xShQxEztbtWb+zsG5opQB3LyxqKxwpuAu6e5bi48qCxLwBJF56/k9YqsdHtYnB94kTleuK15SSuIqhy7as6uxbnQcoJ1xkWUWWEPPhPNskDVRWzOgu+PQURM3CPlfms8d2BsSovevD9zgwtM8jC9X+Jy5qfbrJWMd8AyKhAdtWOQwuq+Ifg4K2o9i2Yz/wAczSBDJAEXVJnpgeEl1b1NVUfGIwMfU3ebARLhZqD4/zRMdjD+H8Oe1qKGZ7bd426HHvkag9BK+xWpLnaZL4aFeVGtEIVeADeAB/KCNfQwfeULy0YA9XxEVxNE9ZwXfkEeEINHDDZyI/UQnSW2gPwlKpoqUBS2UhESNbdm9hEyYhGW46S8A= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(376014)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fF7xyohkjy2IkxV0dHfv541S9GlNm/klFuvmPM1PiOBl2av2mTNuoNEWqTVN0U/ZAuAusdV/FRtpkxGRJnAznU7h6Y5MyrCmUCvmaJuSEGngX7zZ9twOr+Q/s3k6MHYedKaD6M8zgXnoDxlSyMHIeVq+xCcsw42zn1q/6WgbrgPhRJ2F7x28nOc0+ng7UchntFKRrCFCbZngiFn/zERhJLqF59rr3cJTQ50gpBpRk2U2K9ARzneHIrdC0v1QXDqLjYq75rGYh9S8NpnN4ynYbpZ0nJaXCqT6SWOozZtL6yA8eYeDbI+weYyMfRn0mwU0NCZJduj8aUUMqFgfxEuT2RiY0OilAx15gc3gENNQx2Gdvl/fdS8BYoIhOdbDu4bxz6bTiC+LZZLzQub1rgHH0VhuWaWBYnW+dfF6qh7AYsu0W49D8teNGiU6b9oS4Hav X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 23:01:52.1480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 975d0128-cdec-4b80-77bf-08deaa31214a 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7827 Content-Type: text/plain; charset="utf-8" Some older systems don't support CPPC in the firmware and this just makes noise for them when booting. Drop back to debug. This reverts commit 21fb59ab4b9767085f4fe1edbdbe3177fbb9ec97. Fixes: 21fb59ab4b976 ("ACPI: CPPC: Adjust debug messages in amd_set_max_fre= q_ratio() to warn") Suggested-by: Kim Phillips Signed-off-by: Mario Limonciello Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak Tested-by: Kim Phillips --- arch/x86/kernel/acpi/cppc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index d7c8ef1e354d3..be4c5e9e5ff6f 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -88,19 +88,19 @@ static void amd_set_max_freq_ratio(void) =20 rc =3D cppc_get_perf_caps(0, &perf_caps); if (rc) { - pr_warn("Could not retrieve perf counters (%d)\n", rc); + pr_debug("Could not retrieve perf counters (%d)\n", rc); return; } =20 rc =3D amd_get_boost_ratio_numerator(0, &numerator); if (rc) { - pr_warn("Could not retrieve highest performance (%d)\n", rc); + pr_debug("Could not retrieve highest performance (%d)\n", rc); return; } nominal_perf =3D perf_caps.nominal_perf; =20 if (!nominal_perf) { - pr_warn("Could not retrieve nominal performance\n"); + pr_debug("Could not retrieve nominal performance\n"); return; } =20 --=20 2.43.0 From nobody Sun Jun 14 01:35:18 2026 Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azon11011038.outbound.protection.outlook.com [40.107.208.38]) (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 17D2D38F934; Mon, 4 May 2026 23:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.208.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935722; cv=fail; b=sfllhMSphoyQxuysZ40eHQWO6rhkk2rWB+BM/cCAHXoTksUGPD/Y2gRbBNhkZmD/t7KhXtkd7CsU/0RokPY9Wz7UVeNEeFNocaNY5gg6wwuiqcirLg3dNzTyOzojD+SVcNI4EN8jHJzwzvI1eKl4+WWptk4ZqMz50aa3+gLYl1A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935722; c=relaxed/simple; bh=nPBEEZTPOv3WynOxeYpY1MkrATCBomPUZLPqzdjCYxI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a+EsyJj0FanXx9t1xtp0FUmrZ9sWhvgyCXMHrKLdbPH57CbtJhI7/pjDVkrdkkwJ9fK5WajN6OKBHZcOu0Q0Y9vCudCyZd1VYsHOIWXffM1+lHDEpZeOf1oYLwaCvf221iAYxKFGZFvez3159Ruj2+sQmJC3vDHE/zOpbfS9fKY= 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=Nn5tVfOS; arc=fail smtp.client-ip=40.107.208.38 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="Nn5tVfOS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yVmpafgd2ZztutmM2BEWtTS/uIVVBGYyf+20eH0S5juwQu9vv2y3FFObRkFK44kk9l/kHfmFNywdzobgT1rTuoG9pbEoptGTVkp/H6qgYSdchriiN8tijgn4SoRNx3zxVcxW9aUUTdcUGrayAErKG83rCvWr82m1qeql7ETwWUojVBkeiS+ncq3CqoxFT3JjPtkJK/P6+WU+kK7rCAexBD+dq9V2JeOsCDlH6J19MyCpzKQKLzd3SW/N+6gAZRW83BsWnupXdKja2O4l1O4uoO1PkEpQovrh4B3V034iezHSkK9kij/XJ8i85edh00od6+lCzlkhz+zy1FY5KwS6HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=PyrvObeUSRIQLXRlYKPn+8bDiJE7UsgiK6XHN0T7g1g=; b=ZWqx3Un8/9WjRejaF+t3fTT4miKsllmm35RO4yWjkW4gb+ZxJEAxGIs+j8DWNWjqCSzTjst/IoUMc9JW0jr0uQvt7bbJoPGhGW19mbX4p8+iOHonN3xVBqjVnDVKYqVp2nccUulgOJ/YKdsJRIm873KlEVYuPB5NVurnWKZkZEVoIs/A6Tw3PXxPfao+GIA1ZzBu3jf9DYEYewPeBPMHnZs83lk2jEq6GvrXdq0xQ1oA31yL5BpyiDfDJC4hzXfM1UreOa/teiT0dIs9RvnEZcizu0SmAjTWHuHE6+UepS0s24umqdRSVEdXC4lWGxkKS1G9m20cH44yuPNQsdBtNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=PyrvObeUSRIQLXRlYKPn+8bDiJE7UsgiK6XHN0T7g1g=; b=Nn5tVfOSwxTAVPJCCCBUt1JMNeNxujV+mA6FlwCfDDtiaSplrrPoqMQdJ3iqSeU70hnescxEplM7h+Ohobdg+MqM8RLTjNIOpQCG0wiKPcV4l+TtpctHU2UwjZWR/FQwKV8oi04GOz+Z4XuxGgDWPg+Bu5lwCAkzihmfeydNqqg= Received: from MN2PR22CA0008.namprd22.prod.outlook.com (2603:10b6:208:238::13) by DS0PR12MB6440.namprd12.prod.outlook.com (2603:10b6:8:c8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 23:01:53 +0000 Received: from MN1PEPF0000ECDB.namprd02.prod.outlook.com (2603:10b6:208:238:cafe::3d) by MN2PR22CA0008.outlook.office365.com (2603:10b6:208:238::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 23:01:53 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MN1PEPF0000ECDB.mail.protection.outlook.com (10.167.242.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 23:01:52 +0000 Received: from ausmlimonci-lx1.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 4 May 2026 18:01:52 -0500 From: Mario Limonciello To: "Rafael J . Wysocki" CC: , , , K Prateek Nayak , , Mario Limonciello Subject: [PATCH v2 2/5] ACPI: CPPC: Add support for reading HighestFreq Date: Mon, 4 May 2026 18:01:38 -0500 Message-ID: <20260504230141.484743-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260504230141.484743-1-mario.limonciello@amd.com> References: <20260504230141.484743-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDB:EE_|DS0PR12MB6440:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ea33ac4-078c-4b1f-d962-08deaa3121ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700016|1800799024|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: PU3JDYYwgpqG6NDqoNqoCyWNYNAJh/LOSz0wyZKLi2otjzLtPMYVzSKuWd5lxa9od2NTahAVXVWRawNxepBSCCc5pqwmZqe5x1iDP+YiciSxZUnNFJBJ9Ku2Cah0eu95xtg/FhUhTCgZ9hNfsbOuLpZOIRUfkuQ5AxWclEfdzP+PZmn+yTzFahmDQ3YZkAPe/x1lEqScrSewaWlorRES16E3+fqdXVgvAWeVw/WBGCUq7owJGLhx6ICWOX333C9qKSV1OcEh6XwDgtHiWRM9+hAZU/F9yV+TMTaRhR2M9BG+dGOXDEAxa5SeNJSuJdrnxCOwb2N3BPP5ApuQM+BEC5lLh/D6bsuOqQlZcjaY6lxbJBQrdMp9JudhAnaj/iEF6VZrQCze4Y3ylvyDXh5K48dtMYgnFtsD6Irl7ATeOXYujKSPfqgtNi8FjkPqB4N4JPwse/VGEG8/Yz4PnK8IpW7aYxGEdsUL/eQ9yAB8iO1Oph8/3M6WN8aEI0gZsbxkHWY27Q1Sls7ltiE8iAJXKWDyCBXcjZ3Ui3cTgdDnl/BgcPrQWb6UY8oa6CVEtcPzQ219kdhuJhtPkdOkBqfkmLVXgudeAIOJ5D6LRa/ApAkzzNJ+zUA5ICaaqEj7W32ItEMegexzWjWsF2o0vp00vVWYBs/sRFQboZvEooEkwyVVAMPV8kAxyemX003FFkcuNpYBvt3NzvsHoV16aU/8aV6Ex8nh4fySyW0mv89M8cM= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700016)(1800799024)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RDl8LviSh58AdjDBlKwniQP8zPltyOPr95u2FqopgdH1EmCbboN5F4zfcz8+ztVR9UE/W+1lttbvpSoVRlVKXETgFJlwTrMROWTbBIeUqFBugXZWEMnccOVLgy1n8zcMyDSNa/T2kuQAzJ58K4HR2T0Gcw4pBiLLH7SmAgLHP5NfZLsPozCUfFoJLKJ1Rm+mewGKWS9jhyj879yikAGvQVhjwcBCkJoj9B+Q8RQ21HyQlpm6yXBGvB7/a63FUtAMp8oFQWJP7q8Z9lCtNt5BEH/pW/AdThm54k/6G8bJljJGB96g9zYB9EpxnCgirtcvt2Mf6TuvDciqgrskwgfEE70u3iCDzaS/HNHO3DNmI4GQbQHEabyRbwcE1z+xRYgIHrDrv7Jl7xUoZ6rnTxV0qtRrb2pWOXEYKRbwWxyJAKE+LLNyiE2/e7GpKS2teZAf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 23:01:52.8790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ea33ac4-078c-4b1f-d962-08deaa3121ba 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECDB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6440 Content-Type: text/plain; charset="utf-8" A future revision of the ACPI specification will be including a definition for HighestFreq. Add support for reading it. Signed-off-by: Mario Limonciello Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak --- v2: * Fix optional register mask --- drivers/acpi/cppc_acpi.c | 31 +++++++++++++++++++++---------- include/acpi/cppc_acpi.h | 7 ++++++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index fbc620adafad7..f96a83b58072b 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -134,7 +134,7 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr); * cpc_regs[] with the corresponding index. 0 means mandatory and 1 * means optional. */ -#define REG_OPTIONAL (0x7FC7D0) +#define REG_OPTIONAL (0x1FFC7D0) =20 /* * Use the index of the register in per-cpu cpc_regs[] to check if @@ -186,6 +186,7 @@ show_cppc_data(cppc_get_perf_caps, cppc_perf_caps, lowe= st_nonlinear_perf); show_cppc_data(cppc_get_perf_caps, cppc_perf_caps, guaranteed_perf); show_cppc_data(cppc_get_perf_caps, cppc_perf_caps, lowest_freq); show_cppc_data(cppc_get_perf_caps, cppc_perf_caps, nominal_freq); +show_cppc_data(cppc_get_perf_caps, cppc_perf_caps, highest_freq); =20 show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time); =20 @@ -259,6 +260,7 @@ static struct attribute *cppc_attrs[] =3D { &nominal_freq.attr, &lowest_freq.attr, &ospm_nominal_perf.attr, + &highest_freq.attr, NULL }; ATTRIBUTE_GROUPS(cppc); @@ -793,14 +795,15 @@ int acpi_cppc_processor_probe(struct acpi_processor *= pr) if ((cpc_rev =3D=3D CPPC_V2_REV && num_ent !=3D CPPC_V2_NUM_ENT) || (cpc_rev =3D=3D CPPC_V3_REV && num_ent !=3D CPPC_V3_NUM_ENT) || (cpc_rev =3D=3D CPPC_V4_REV && num_ent !=3D CPPC_V4_NUM_ENT) || - (cpc_rev > CPPC_V4_REV && num_ent <=3D CPPC_V4_NUM_ENT)) { + (cpc_rev =3D=3D CPPC_V5_REV && num_ent !=3D CPPC_V5_NUM_ENT) || + (cpc_rev > CPPC_V5_REV && num_ent <=3D CPPC_V5_NUM_ENT)) { pr_debug("Unexpected number of _CPC return package entries (%d) for CPU:= %d\n", num_ent, pr->id); goto out_free; } - if (cpc_rev > CPPC_V4_REV) { - num_ent =3D CPPC_V4_NUM_ENT; - cpc_rev =3D CPPC_V4_REV; + if (cpc_rev > CPPC_V5_REV) { + num_ent =3D CPPC_V5_NUM_ENT; + cpc_rev =3D CPPC_V5_REV; } =20 cpc_ptr->num_entries =3D num_ent; @@ -1402,9 +1405,10 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_= caps *perf_caps) struct cpc_desc *cpc_desc =3D per_cpu(cpc_desc_ptr, cpunum); struct cpc_register_resource *highest_reg, *lowest_reg, *lowest_non_linear_reg, *nominal_reg, *reference_reg, - *guaranteed_reg, *low_freq_reg =3D NULL, *nom_freq_reg =3D NULL; + *guaranteed_reg, *low_freq_reg =3D NULL, *nom_freq_reg =3D NULL, + *highest_freq_reg =3D NULL; u64 high, low, guaranteed, nom, ref, min_nonlinear, - low_f =3D 0, nom_f =3D 0; + low_f =3D 0, nom_f =3D 0, high_f =3D 0; int pcc_ss_id =3D per_cpu(cpu_pcc_subspace_idx, cpunum); struct cppc_pcc_data *pcc_ss_data =3D NULL; int ret =3D 0, regs_in_pcc =3D 0; @@ -1421,6 +1425,7 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_c= aps *perf_caps) reference_reg =3D &cpc_desc->cpc_regs[REFERENCE_PERF]; low_freq_reg =3D &cpc_desc->cpc_regs[LOWEST_FREQ]; nom_freq_reg =3D &cpc_desc->cpc_regs[NOMINAL_FREQ]; + highest_freq_reg =3D &cpc_desc->cpc_regs[HIGHEST_FREQ]; guaranteed_reg =3D &cpc_desc->cpc_regs[GUARANTEED_PERF]; =20 /* Are any of the regs PCC ?*/ @@ -1428,7 +1433,7 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_c= aps *perf_caps) CPC_IN_PCC(lowest_non_linear_reg) || CPC_IN_PCC(nominal_reg) || (CPC_SUPPORTED(reference_reg) && CPC_IN_PCC(reference_reg)) || CPC_IN_PCC(low_freq_reg) || CPC_IN_PCC(nom_freq_reg) || - CPC_IN_PCC(guaranteed_reg)) { + CPC_IN_PCC(guaranteed_reg) || CPC_IN_PCC(highest_freq_reg)) { if (pcc_ss_id < 0) { pr_debug("Invalid pcc_ss_id\n"); return -ENODEV; @@ -1491,7 +1496,7 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_c= aps *perf_caps) goto out_err; } =20 - /* Read optional lowest and nominal frequencies if present */ + /* Read optional lowest, highest and nominal frequencies if present */ if (CPC_SUPPORTED(low_freq_reg)) { ret =3D cpc_read(cpunum, low_freq_reg, &low_f); if (ret) @@ -1504,9 +1509,15 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_= caps *perf_caps) goto out_err; } =20 + if (CPC_SUPPORTED(highest_freq_reg)) { + ret =3D cpc_read(cpunum, highest_freq_reg, &high_f); + if (ret) + goto out_err; + } + perf_caps->lowest_freq =3D low_f; perf_caps->nominal_freq =3D nom_f; - + perf_caps->highest_freq =3D high_f; =20 out_err: if (regs_in_pcc) diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 3771e2ed507de..053ea67f767ff 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -21,14 +21,16 @@ #define CPPC_V2_REV 2 #define CPPC_V3_REV 3 #define CPPC_V4_REV 4 +#define CPPC_V5_REV 5 #define CPPC_V2_NUM_ENT 21 #define CPPC_V3_NUM_ENT 23 #define CPPC_V4_NUM_ENT 25 +#define CPPC_V5_NUM_ENT 27 =20 #define PCC_CMD_COMPLETE_MASK (1 << 0) #define PCC_ERROR_MASK (1 << 2) =20 -#define MAX_CPC_REG_ENT 23 +#define MAX_CPC_REG_ENT 25 =20 /* CPPC specific PCC commands. */ #define CMD_READ 0 @@ -114,6 +116,8 @@ enum cppc_regs { NOMINAL_FREQ, OSPM_NOMINAL_PERF, RESOURCE_PRIORITY, + HIGHEST_FREQ, + CURRENT_FREQ, }; =20 /* @@ -131,6 +135,7 @@ struct cppc_perf_caps { u32 lowest_nonlinear_perf; u32 lowest_freq; u32 nominal_freq; + u32 highest_freq; }; =20 struct cppc_perf_ctrls { --=20 2.43.0 From nobody Sun Jun 14 01:35:18 2026 Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11012027.outbound.protection.outlook.com [52.101.53.27]) (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 9E34438CFF8; Mon, 4 May 2026 23:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.53.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935718; cv=fail; b=baoskAcfPniEbHABY2gOR+9Fyp1Zh4Ogf7/vNCdm3P/dZhIfqRV40ytiClbLTcxUinrWPFsPS46P6XmKN8zj0TkaEmeBAL6ChN38hHvzgDk9a03CImg7GgkuthjKBGZtCwRfDeIrE7ya6DEji1YG4xRU5c4487nockai11SkUr4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935718; c=relaxed/simple; bh=ujWfsM+K8Hvja/lclvZjnHfPXyI1EFAgPlbaSo5ZRtI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Bka3ADIWqp1RD8cMXneW3IZL8lcif9rBZq48WNATse01iBokW7RV+iqaMkDKNNxeoiVMAZ//SQY7xXwpn0E9SJgwkWb3iAgt5XGg8gRK93oAJb8HSmdrRfLNWq2nf0VhCHjJ6vYmlSlEHOManaLU9nUASkHoMwTfeyYg6m5m/jY= 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=OPEYKXgI; arc=fail smtp.client-ip=52.101.53.27 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="OPEYKXgI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UqoTyTBdMOnA9u2HTi6M2kZ9GIOYiuTY3lMkSG0njxJLnkjqYYIs4OHYYoml6aoqfW0BDPp/XLy2Rm8R1BARwP23eC+bKA/RWr0U2YL6STGFXEYzpRrMzB6kUrAPl9jg2m5iz7SY60oKtPaZiEtzw2UGbQeykE7mLU42r1VeM/yEgnm0eNXnZkAKbBM7VclGa+HcYJmhnmyoHXnbCMrCokW6Ix4CM/MnzOxn24sH8kZJWgQ7yA2TQRGWxpGWcS54G1ICHGcPAN7CTGfiHqxGnzX4i1bVDVQVTx/aJCIfXm5aimqOxWAZ2/QSftJYtLnpglUOhV9WSzcE/BAqF5hBow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=AVpP6QNaEaJUtoqMeTEGf47znfpbWBm7v7T1b/rphUU=; b=ZrQTz5UMzbtyqfl9W5nCZmGi1iVDa21LBui88BSIXmtyqOE9SE+lAo+PgN2fkCjU1gZq3bsPcW7V8TmIXezlhk8Igi5K2LHMGY/XtkGJFal62PTykJNcfLEWi0JLN+6r2ZJq02vNai9Q9t4Ai57vI3boSlpjGIf2TO7uoozTwMuWZFO2NoBaaxOpKk2otZpd90jhb06yTLWBWXn3XTa0aMkitbx3QctDzSFXdOaTvGjDmChrC2qiAXjawBQeIHzmdalsdhecRn1ZGKoeCbFCHQ0J2WlPOFHEUzd7xeppGhNIVytHIzQE3aS/HLjJXt2V06szPluXroH7sFQIcviSRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=AVpP6QNaEaJUtoqMeTEGf47znfpbWBm7v7T1b/rphUU=; b=OPEYKXgISTMJ6D/rpyFkaxZd1EN63++qNI3nUPe6tRLl/11oR8Asx5yx7NPZQ0WkZRNmoDLlasTbVWSqEf+M7OBxD0BwKzi/P3iG8oW6f7MFJIWuBQf+mBLFHgd2Lhr5e9/jiJNCpRlQWCZXnZsg0y9cR4BYO+ChUEsCozcGiqg= Received: from BL1PR13CA0448.namprd13.prod.outlook.com (2603:10b6:208:2c3::33) by LV3PR12MB9185.namprd12.prod.outlook.com (2603:10b6:408:199::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 23:01:53 +0000 Received: from MN1PEPF0000ECD6.namprd02.prod.outlook.com (2603:10b6:208:2c3:cafe::92) by BL1PR13CA0448.outlook.office365.com (2603:10b6:208:2c3::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9891.14 via Frontend Transport; Mon, 4 May 2026 23:01:53 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MN1PEPF0000ECD6.mail.protection.outlook.com (10.167.242.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 23:01:53 +0000 Received: from ausmlimonci-lx1.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 4 May 2026 18:01:52 -0500 From: Mario Limonciello To: "Rafael J . Wysocki" CC: , , , K Prateek Nayak , , Mario Limonciello Subject: [PATCH v2 3/5] ACPI: CPPC: Refactor boost ratio handling Date: Mon, 4 May 2026 18:01:39 -0500 Message-ID: <20260504230141.484743-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260504230141.484743-1-mario.limonciello@amd.com> References: <20260504230141.484743-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD6:EE_|LV3PR12MB9185:EE_ X-MS-Office365-Filtering-Correlation-Id: 610b3712-bc7c-4d1a-a1b0-08deaa312214 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700016|22082099003|56012099003|18002099003; X-Microsoft-Antispam-Message-Info: wRN08QLgVtAziimdiclXAGy04i13Ys0CEfWROx+X3LiXa/WTwAQSH4F1FrOirjiXdMm/xVhXvrI8xQXuiZtbDXxNJTfuvyzoepRYzfZUmJi0p90DuQpYN82Y/HI+32JtCgsdr17IMp86K/Uwx3YxTnV70Fm6HxVmUTbklrLRAoslRtXWza3cKVmhX2kkZYZR4/8p8kH5jG4Qbp2oVHBfpgF3pBYwb92sqgv+o8oupAMX8vx8zceHdl1eQS1PlT381a93P/dzLoG9eLYPPRwz1AO73D39p2mQmI2OZIwE5rPyGpF+OVI30bJB6R54ecSSk/2jaL6Z6/m1gtwZ/x4WbS5AJkFklTQuLO8ZPS0oRLbYaXF2R4p0ClZa+9zJBVXNl4eThlXus3yeO94b/J0boYdcvopEmlExs1CdcsorQslqm3kFk7Mtrs+2j6Zw+7TlVIX83+6eUOfH9pCQCG/7GHfgGHnXl6gX9dVHu9UmnlZmeMioELiRAvJnHM+H6HVMpHtcxBc03DBZQVwQIg9NSWWnmAH8mL3ba6X4Mc08cxRmpjej7USk2QZWfwbhl1xg43EZmk20lEmONzl3KQsaQHre+7q+xaG3qWeScIjvh/erItXPa6QkYitlbeXnyKrgHbaC80ZaLLWPdb0LpyVr0hwhrde4b++1gxpGgg1DdsOgIViR2Dc3nqZ+kAuWKIJs0e1t+M3W8rp/8rTT6VMkF+abiB4IkZU2L2ku90rKnhQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700016)(22082099003)(56012099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e3L3vkgMrV/bcKQADpCc0cABw5mLU4flFvRQquvjafGRffAnQVL8UqKI2ENVjmqeHGpFrowCw0/4PEbI1u2syGf2pBporzAH9OyccY7himTEO5l3uy6agSZmY92PiPY6gx6yY4QBP8CoGJko1PDsj6NWwc8DR42Q1Gw31OuFaVaSxMNfBV7I1bEqttJ82DvrO85rNrpagdHEWY15mKgn43T1vygxKWe3ihoiXMO9wnk9Eh2YiyGEdLOLINy7pMN/xrQC13ZPCdtgj85PuNqDjPEww/MeT0Pwx2P5oTWXzH5nKJcNUxphAWjy0pBTdKPxZsMRVhN6kZj255wNERkjhKun0gGxRfb8D+SEv1MhSHVMsOEHezsESPcUZaznSpxAl+OC1NpfpASRAaBQ++8DZYEfCCg27nxpKHj7jAUpLYQE0/Q9r1nStcEdS+kQRYKT X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 23:01:53.4609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 610b3712-bc7c-4d1a-a1b0-08deaa312214 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9185 Content-Type: text/plain; charset="utf-8" Rename amd_get_boost_ratio_numerator() to amd_get_effective_highest_perf() to better reflect that it returns the effective highest performance value for a CPU, accounting for preferred cores and heterogeneous topologies. Add a new helper amd_get_boost_ratio() for doing both for boost ratio calculations and update callers to use it. This refactoring is needed because on some AMD systems (Zen6+), the boost ratio should be calculated from frequency values rather than performance values. Signed-off-by: Mario Limonciello Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak --- arch/x86/kernel/acpi/cppc.c | 122 ++++++++++++++++++--------------- drivers/cpufreq/acpi-cpufreq.c | 5 +- drivers/cpufreq/amd-pstate.c | 12 ++-- include/acpi/cppc_acpi.h | 9 ++- 4 files changed, 86 insertions(+), 62 deletions(-) diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index be4c5e9e5ff6f..b581447711079 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -81,31 +81,18 @@ int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 = val) =20 static void amd_set_max_freq_ratio(void) { - struct cppc_perf_caps perf_caps; - u64 numerator, nominal_perf; + u64 numerator, denominator; u64 perf_ratio; int rc; =20 - rc =3D cppc_get_perf_caps(0, &perf_caps); - if (rc) { - pr_debug("Could not retrieve perf counters (%d)\n", rc); - return; - } - - rc =3D amd_get_boost_ratio_numerator(0, &numerator); + rc =3D amd_get_boost_ratio(0, &numerator, &denominator); if (rc) { - pr_debug("Could not retrieve highest performance (%d)\n", rc); - return; - } - nominal_perf =3D perf_caps.nominal_perf; - - if (!nominal_perf) { - pr_debug("Could not retrieve nominal performance\n"); + pr_debug("Could not retrieve boost ratio (%d)\n", rc); return; } =20 /* midpoint between max_boost and max_P */ - perf_ratio =3D (div_u64(numerator * SCHED_CAPACITY_SCALE, nominal_perf) += SCHED_CAPACITY_SCALE) >> 1; + perf_ratio =3D (div_u64(numerator * SCHED_CAPACITY_SCALE, denominator) + = SCHED_CAPACITY_SCALE) >> 1; =20 freq_invariance_set_perf_ratio(perf_ratio, false); } @@ -225,21 +212,18 @@ int amd_detect_prefcore(bool *detected) EXPORT_SYMBOL_GPL(amd_detect_prefcore); =20 /** - * amd_get_boost_ratio_numerator: Get the numerator to use for boost ratio= calculation - * @cpu: CPU to get numerator for. - * @numerator: Output variable for numerator. + * amd_get_effective_highest_perf: Get the effective highest performance v= alue + * @cpu: CPU to get highest performance for. * - * Determine the numerator to use for calculating the boost ratio on - * a CPU. On systems that support preferred cores, this will be a hardcoded - * value. On other systems this will the highest performance register valu= e. + * Get the effective highest performance value for a CPU, accounting for + * preferred cores and heterogeneous topologies. On systems with preferred + * cores, this may be a hardcoded value. On heterogeneous systems, this + * may be a per-CPU value. On other systems, this is the shared highest + * performance value. * - * If booting the system with amd-pstate enabled but preferred cores disab= led then - * the correct boost numerator will be returned to match hardware capabili= ties - * even if the preferred cores scheduling hints are not enabled. - * - * Return: 0 for success, negative error code otherwise. + * Return: Effective highest performance value, or negative error code. */ -int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator) +int amd_get_effective_highest_perf(unsigned int cpu) { enum x86_topology_cpu_type core_type =3D get_topology_cpu_type(&cpu_data(= cpu)); bool prefcore; @@ -247,14 +231,12 @@ int amd_get_boost_ratio_numerator(unsigned int cpu, u= 64 *numerator) u32 tmp; =20 ret =3D amd_detect_prefcore(&prefcore); - if (ret) + if (ret < 0) return ret; =20 /* without preferred cores, return the highest perf register value */ - if (!prefcore) { - *numerator =3D boost_numerator; - return 0; - } + if (!prefcore) + return boost_numerator; =20 /* * For AMD CPUs with Family ID 19H and Model ID range 0x70 to 0x7f, @@ -264,8 +246,7 @@ int amd_get_boost_ratio_numerator(unsigned int cpu, u64= *numerator) if (cpu_feature_enabled(X86_FEATURE_ZEN4)) { switch (boot_cpu_data.x86_model) { case 0x70 ... 0x7f: - *numerator =3D CPPC_HIGHEST_PERF_PERFORMANCE; - return 0; + return CPPC_HIGHEST_PERF_PERFORMANCE; default: break; } @@ -273,26 +254,59 @@ int amd_get_boost_ratio_numerator(unsigned int cpu, u= 64 *numerator) =20 /* detect if running on heterogeneous design */ if (cpu_feature_enabled(X86_FEATURE_AMD_HTR_CORES)) { - switch (core_type) { - case TOPO_CPU_TYPE_UNKNOWN: - pr_warn("Undefined core type found for cpu %d\n", cpu); - break; - case TOPO_CPU_TYPE_PERFORMANCE: - /* use the max scale for performance cores */ - *numerator =3D CPPC_HIGHEST_PERF_PERFORMANCE; - return 0; - case TOPO_CPU_TYPE_EFFICIENCY: - /* use the highest perf value for efficiency cores */ - ret =3D amd_get_highest_perf(cpu, &tmp); - if (ret) - return ret; - *numerator =3D tmp; - return 0; - } + if (cpu_feature_enabled(X86_FEATURE_ZEN5) && + core_type =3D=3D TOPO_CPU_TYPE_PERFORMANCE) + return CPPC_HIGHEST_PERF_PERFORMANCE; + + /* Zen 5 efficiency, and Zen 6+ */ + ret =3D amd_get_highest_perf(cpu, &tmp); + if (ret < 0) + return ret; + + return tmp; + } + + return CPPC_HIGHEST_PERF_PREFCORE; +} +EXPORT_SYMBOL_GPL(amd_get_effective_highest_perf); + +/** + * amd_get_boost_ratio: Get numerator and denominator for boost ratio + * @cpu: CPU to get the boost ratio for. + * @numerator: Output variable for numerator. + * @denominator: Output variable for denominator. + * + * Get the numerator and denominator for calculating the boost ratio. + * + * Return: 0 for success, negative error code otherwise. + */ +int amd_get_boost_ratio(unsigned int cpu, u64 *numerator, u64 *denominator) +{ + struct cppc_perf_caps perf_caps; + int ret; + + ret =3D cppc_get_perf_caps(cpu, &perf_caps); + if (ret) + return ret; + + /* Use frequency values if available */ + if (perf_caps.highest_freq && perf_caps.nominal_freq) { + *numerator =3D perf_caps.highest_freq; + *denominator =3D perf_caps.nominal_freq; + return 0; } =20 - *numerator =3D CPPC_HIGHEST_PERF_PREFCORE; + /* Fall back to performance values */ + ret =3D amd_get_effective_highest_perf(cpu); + if (ret < 0) + return ret; + + *numerator =3D ret; + + *denominator =3D perf_caps.nominal_perf; + if (!*denominator) + return -EINVAL; =20 return 0; } -EXPORT_SYMBOL_GPL(amd_get_boost_ratio_numerator); +EXPORT_SYMBOL_GPL(amd_get_boost_ratio); diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 21639d9ac753b..a1a005b29daba 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -640,12 +640,13 @@ static u64 get_max_boost_ratio(unsigned int cpu, u64 = *nominal_freq) } =20 if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD) { - ret =3D amd_get_boost_ratio_numerator(cpu, &highest_perf); - if (ret) { + ret =3D amd_get_effective_highest_perf(cpu); + if (ret < 0) { pr_debug("CPU%d: Unable to get boost ratio numerator (%d)\n", cpu, ret); return 0; } + highest_perf =3D ret; } else { highest_perf =3D perf_caps.highest_perf; } diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 453084c67327f..f5c7cc05220c4 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -476,10 +476,12 @@ static int msr_init_perf(struct amd_cpudata *cpudata) if (ret) return ret; =20 - ret =3D amd_get_boost_ratio_numerator(cpudata->cpu, &numerator); - if (ret) + ret =3D amd_get_effective_highest_perf(cpudata->cpu); + if (ret < 0) return ret; =20 + numerator =3D ret; + ret =3D rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req); if (ret) return ret; @@ -520,10 +522,12 @@ static int shmem_init_perf(struct amd_cpudata *cpudat= a) if (ret) return ret; =20 - ret =3D amd_get_boost_ratio_numerator(cpudata->cpu, &numerator); - if (ret) + ret =3D amd_get_effective_highest_perf(cpudata->cpu); + if (ret < 0) return ret; =20 + numerator =3D ret; + perf.highest_perf =3D numerator; perf.max_limit_perf =3D numerator; perf.min_limit_perf =3D cppc_perf.lowest_perf; diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 053ea67f767ff..0d7b047cb1efd 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -194,7 +194,8 @@ extern int cppc_set_auto_sel(int cpu, bool enable); extern int cppc_get_perf_limited(int cpu, u64 *perf_limited); extern int cppc_set_perf_limited(int cpu, u64 bits_to_clear); extern int amd_get_highest_perf(unsigned int cpu, u32 *highest_perf); -extern int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *numerator); +extern int amd_get_effective_highest_perf(unsigned int cpu); +extern int amd_get_boost_ratio(unsigned int cpu, u64 *numerator, u64 *deno= minator); extern int amd_detect_prefcore(bool *detected); #else /* !CONFIG_ACPI_CPPC_LIB */ static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf) @@ -305,7 +306,11 @@ static inline int amd_get_highest_perf(unsigned int cp= u, u32 *highest_perf) { return -ENODEV; } -static inline int amd_get_boost_ratio_numerator(unsigned int cpu, u64 *num= erator) +static inline int amd_get_effective_highest_perf(unsigned int cpu) +{ + return -EOPNOTSUPP; +} +static inline int amd_get_boost_ratio(unsigned int cpu, u64 *numerator, u6= 4 *denominator) { return -EOPNOTSUPP; } --=20 2.43.0 From nobody Sun Jun 14 01:35:18 2026 Received: from BN8PR05CU002.outbound.protection.outlook.com (mail-eastus2azon11011068.outbound.protection.outlook.com [52.101.57.68]) (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 9332D390209; Mon, 4 May 2026 23:02:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.57.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935724; cv=fail; b=K3H4dbYIJB+Ks8gGGxl1LrN5LrCmoKN8b2WYE13JR9JM8X3eU9V70h2bEmcdf5gGcn6s+ubpa3gVRHfGJkWwnM+WBF6O+eGy8iSDPGvZa68aQbuzU0RRDqNeZt+LZhgdRQ/2IniVNKf9Gik7xj+m79Atai/sF4E0GnP8KDvmU7Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935724; c=relaxed/simple; bh=rzozYoGCON92sHNogKL0QITfvx1DSZFOpG2V3871Wf0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QP6uCY1Kgx5S/rR6HQH7QK5m4/nwwAk7TgeYYjeRDB1IzVBKJHIh8tc9V+7xuRSM9K/oGruzfskcC71AOdsNcEDCPaVUVnF4/1JKwmTQoaC4i0s8/lofiihG0TTU3vuGXvEciQ97HbbFnSxu9DMrL2/8iOhFMux7KaXoro7PB5Q= 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=cv9zD3fx; arc=fail smtp.client-ip=52.101.57.68 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="cv9zD3fx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kyxd4TUJ27Gexvbg+zmWSuS8ig/MdL1Q5ROX3ZnDhZ04KxtwSD+Z56b9hJxaDj7cm3S/bAxEK4Wnw1GaxuqasHg6YZPwuvKzPOmYncpjvSWFnpELtgHVJaKWsQlGVwpSAC0Fs0nvR7si/fDxkxKqAo7yrMl4kWbBU/dd/m6KhUfBA6wid3Ag3T/+Wqwjdnl+BclB+jF3YulUT/zytZfiQSLmNr8giicUvt/S+AQPE6UwniHt7H9BxebH8BBUwkG6G1QMFZuTjE8BNv417y0UQhvVuYopcqhNUnlTyYAicjnkgLZX2joBBSLbFnoaFjx/iB5OXTcm1/yPNfet4orr4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LxsyJZ8quAY8CsGRrV66WF9feUl9sUhMDg/JTu+wKRY=; b=qN7eKpPfUDV1fhe8qkstCryLaYzDzYs54V+CE507dNv7/AtyxegxKf2czEr8tkQloPFs+SaVto3fN0OtJ+CICr0PdJkY2e9qWpDEEYrUJfTu3ynbICivgvl3fFEaTdvu4ym2BTfFvti8GNFzFIn5ySXO7BaKkweb/XU9Y191sItlRRcg/FOdVFtAU5xIgNDZdDpGi22QUS2PGOTTqXLaWNsZGg5S050lgFqxRwI8axhqlYMo6MSo4/AkJ99CzSFb6lLautyfUGIb5+Kee/G12/RQZ0uXC3S++3zKO9Y/jgkpllTcewuY8d9SMyKbdcrCdvaWF1WyuRQ//qyiRUpU/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=LxsyJZ8quAY8CsGRrV66WF9feUl9sUhMDg/JTu+wKRY=; b=cv9zD3fxznej5sl+o2pHZWGgmBVZ362T+iVaoTvR6j4HlVlX/sZPBkmGrc+/tT/uDj1ootWx6uCK5L39jO8tQVsFzV69TfSJhpZDVZ01hLNkR1YnUdWGs02zSpWRbfQ8iFnfv9y7KpUClqMtjIDJ30PnAVeAUA0+WgvGHKvrXH8= Received: from MN2PR04CA0002.namprd04.prod.outlook.com (2603:10b6:208:d4::15) by PH0PR12MB5677.namprd12.prod.outlook.com (2603:10b6:510:14d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 23:01:54 +0000 Received: from MN1PEPF0000ECD4.namprd02.prod.outlook.com (2603:10b6:208:d4:cafe::41) by MN2PR04CA0002.outlook.office365.com (2603:10b6:208:d4::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 23:01:53 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MN1PEPF0000ECD4.mail.protection.outlook.com (10.167.242.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 23:01:53 +0000 Received: from ausmlimonci-lx1.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 4 May 2026 18:01:53 -0500 From: Mario Limonciello To: "Rafael J . Wysocki" CC: , , , K Prateek Nayak , , Mario Limonciello Subject: [PATCH v2 4/5] cpufreq/acpi-cpufreq: Use amd_get_boost_ratio() Date: Mon, 4 May 2026 18:01:40 -0500 Message-ID: <20260504230141.484743-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260504230141.484743-1-mario.limonciello@amd.com> References: <20260504230141.484743-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD4:EE_|PH0PR12MB5677:EE_ X-MS-Office365-Filtering-Correlation-Id: cc24a1b9-efc5-411d-821e-08deaa312259 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700016|1800799024|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: VV/jRqR/AWb2lGv5iWB0nmF/nmgRGnvkxywg1XWjqHlS3D7KUyRndJDZcLuknMCKYWuW+KgrgKc2AAOSy6IvAWut/4irDZQZWqR3lRCCBu6fXtG5L/WPa/O/5B6wESZuQ04Y+aBV2GEEba5jkP9OLdc3lhA2XQht/dTVlQqVHtwR4Od9wq/eO+4DNJnSknRLZIwXOW/OlDoPry5C6NVuCkm4DJTcqdZ1pj2l5k642JGnbRN5hqbhhfST0KKGTSCHw50/X4d+1t6InLc5Fr2cR8hc1P0m4Vs4gSr1+kz77I4ehXVZUqKXu+nsbQPpaVkq4X02/dTNLZQJ0G06BRolPjhHANS6W3zYpMzx2EVbPTDq/zaNDzsLrnsPNGiNtHlWMM0dHVO+RUCT8oaLPheD1bhbhXiEKF0hcJ1sOyVzJek91U8X9q79uWgmOJzMuoW+8BfxVGsLL2nIUsRJywz4l1soq2mIELhuQVkVsV0vvbu8Px5nR3hcMtXcLfykE6+28+xVw1MkLDHJamoyPDrRFnX2CnV7EbKX1+KM02FlXVEeujeC+EOOCqy/u7Xk/5bq6YtpnrRO6DVuAfRJJ6S1ClAVmyAdyrEVj7AcN4gNiwD5qcnSZe5FlIQRqqZ6CK3VxrFSifbdVegJP/mVRc3Ra+xwUw+TKpkCmSsIfNem+40BxV+P/U5cxL0XSIe/SGBZBEQZ4taNjAbs1gCNs6MnzXwxIIfWjvlHrPOte4AxAtg= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700016)(1800799024)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SXTIBhIvIVDf9fHdWWi3/2k5w8eDCwc6TKK9UGTA88iM6Fz4vWOqB9AcwNYqJs0aKJwL1mUrRhVAVXXuUUGHsLcf/q5rY5Hh6SCKJnxDl+lKmVXddGM/EkPLBNYW0pXzmUT3Y2C3SQB3y0ipDvphEu2O84bpLb9C0fQiIj+I+hKg86z5d7riN130N1IjLPOIBclygOyYQ1kNcnmIpH5dZXT2rOzrShkIaMh3yEtUb91AuHGFBiAjh7G4kWe4jADMenAYYeisbpyjFvfdmkcgNGc1vgM4zbws/3Hxpra1jsIdrftJox9n0HQTmbrg68oeNb3q0a3wqHczSUkvtJZgeLdSNyx6HD3WZep3KA6d4/RTXMoFhxQ6Lj4/Bz5nN8o9OBH6Ryysr24sZkLLg3Jqq9DDGPp/a7W+6LQdRHzd2Bqyb3lecVIbUOyYniVuV0Ly X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 23:01:53.9172 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc24a1b9-efc5-411d-821e-08deaa312259 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5677 Content-Type: text/plain; charset="utf-8" Update get_max_boost_ratio() to use the new amd_get_boost_ratio() helper function instead of calling amd_get_effective_highest_perf() directly. This ensures the boost ratio is calculated correctly on systems where frequency values should be used instead of performance values. Signed-off-by: Mario Limonciello Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak --- drivers/cpufreq/acpi-cpufreq.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index a1a005b29daba..6e80540311f60 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -626,7 +626,7 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c) static u64 get_max_boost_ratio(unsigned int cpu, u64 *nominal_freq) { struct cppc_perf_caps perf_caps; - u64 highest_perf, nominal_perf; + u64 numerator, denominator; int ret; =20 if (acpi_pstate_strict) @@ -640,33 +640,31 @@ static u64 get_max_boost_ratio(unsigned int cpu, u64 = *nominal_freq) } =20 if (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_AMD) { - ret =3D amd_get_effective_highest_perf(cpu); - if (ret < 0) { - pr_debug("CPU%d: Unable to get boost ratio numerator (%d)\n", + ret =3D amd_get_boost_ratio(cpu, &numerator, &denominator); + if (ret) { + pr_debug("CPU%d: Unable to get boost ratio (%d)\n", cpu, ret); return 0; } - highest_perf =3D ret; } else { - highest_perf =3D perf_caps.highest_perf; + numerator =3D perf_caps.highest_perf; + denominator =3D perf_caps.nominal_perf; } =20 - nominal_perf =3D perf_caps.nominal_perf; - if (nominal_freq) *nominal_freq =3D perf_caps.nominal_freq * 1000; =20 - if (!highest_perf || !nominal_perf) { + if (!numerator || !denominator) { pr_debug("CPU%d: highest or nominal performance missing\n", cpu); return 0; } =20 - if (highest_perf < nominal_perf) { + if (numerator < denominator) { pr_debug("CPU%d: nominal performance above highest\n", cpu); return 0; } =20 - return div_u64(highest_perf << SCHED_CAPACITY_SHIFT, nominal_perf); + return div_u64(numerator << SCHED_CAPACITY_SHIFT, denominator); } =20 #else --=20 2.43.0 From nobody Sun Jun 14 01:35:18 2026 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010067.outbound.protection.outlook.com [52.101.46.67]) (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 7CCD8391822; Mon, 4 May 2026 23:02:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.46.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935722; cv=fail; b=tWbMzLgMWxo2tCQrhVuD43LOIFZ2y37tqZTz3Wu5lCw7oHKlTqhKpPXTdf2PQ5zU7WrdomOe66s+qI4StKjCZlU8/XOIxH6QAvnJSorn15xCKO/8FCXbUA/4jjbFa3WGLGHrX4LQloER6qmLPR7ifdtnjTnxufC8gVYSFqfYFp8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777935722; c=relaxed/simple; bh=qUWH8iEvvQDkeVaNdjWkgfq+hZh6K4dxYy/g8QYHF2Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KDIczj/mYdTnGaV3sYun6mtUVBDXF/+gN5xBUmtWFG7yu7o7clcEgfx2xW5vs3n5V+PbwKfaGR1Wn0VauhchV/v+DmebgfhtGGHjuLFZtFat/v9medAxGn5iRs4Vlpgk0wDHQ1l0NtMe+mUaT6muQtMlohLsFGZyYbW0HjiUc8A= 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=sMgERIiZ; arc=fail smtp.client-ip=52.101.46.67 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="sMgERIiZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PHcEE1ar3kFrp4q+cqUh+W7yawCMC5mP7ra0MT5qAnTix+SgoQ1ufGg39SCrzpk3Mv5dda/dLMeYMOvN1xFXdD1Nnlkd0PocYiAPFnPpyoC77p0mZsJFoFGGXr1li/qx2dbLskJc3xHBLIhmFK6u7RnVOhGbvxTzv/66RoCFTl9py2nsHJ1q85NJFFBK8A28NsG0llNdvCbsLyP4g4aEGOWv0QxVwiYkBEraXhGwMlggZSvT3WeE6hrmEDj2swE1OcJwmqQ2AKPS9xAIJhLPi5H6pTdcyo2WIUbpD/QYVXqo9+xfccsus/T/6LPnX8mBhyVwVx+UmFIhFvFX61J5zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ebogru3M5s3gWGQV9Jd4N+OmTep0IHAkGzzU/9d72Kk=; b=AA2+kUzKN2MGIKV0Kz5yfFW9CEqOyPoHv9StyQGbIMd7OdV+40eqAIUn0rMn/esxx0mbT7mMuxlyJViFxaqIA8ivy3Vj+1dVZ2DyqlsZJDyOiyvQxzcYJeYZwgLre0u5tgMwvGA3BRvSH4t1Bc+57p0Q8CgXvcHMUo/mHfApRemlECxYGKqnu6RO9y3+XN5mt/TlMa5HH2ITwFQu9zoP63Cgm7hesO+TA0rlUuwSFm/fbhYp5x66GSOd9dx9byNcFwpujV8z+PP0V3tzE5VrHgw1gtSSBu5TXQQiGypqV0mqINCHcle2hugGF3tCuk2zRwm3maEWR9X101X/IoxtbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=ebogru3M5s3gWGQV9Jd4N+OmTep0IHAkGzzU/9d72Kk=; b=sMgERIiZuUDhEPeT2wzxxCAaLAaGZYibVR2+3AqWNuLCmv+u6HbLX4gNqT/2Apt9THcyHK/msSnmIMRSoPdUhCTdsgh9O2qmthIkTO+2kyCEWXACzrH9mIimKgXmQETv1tdJIZ8tvgHMOlJ/zGL91wcbMZA57BDKMHN2bvvGqgo= Received: from MN0PR03CA0004.namprd03.prod.outlook.com (2603:10b6:208:52f::10) by LV2PR12MB6016.namprd12.prod.outlook.com (2603:10b6:408:14e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9870.25; Mon, 4 May 2026 23:01:54 +0000 Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com (2603:10b6:208:52f:cafe::f) by MN0PR03CA0004.outlook.office365.com (2603:10b6:208:52f::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9870.25 via Frontend Transport; Mon, 4 May 2026 23:01:54 +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=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9891.9 via Frontend Transport; Mon, 4 May 2026 23:01:54 +0000 Received: from ausmlimonci-lx1.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 4 May 2026 18:01:53 -0500 From: Mario Limonciello To: "Rafael J . Wysocki" CC: , , , K Prateek Nayak , , Mario Limonciello Subject: [PATCH v2 5/5] cpufreq/amd-pstate: Get highest freq from CPPC if available Date: Mon, 4 May 2026 18:01:41 -0500 Message-ID: <20260504230141.484743-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260504230141.484743-1-mario.limonciello@amd.com> References: <20260504230141.484743-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDA:EE_|LV2PR12MB6016:EE_ X-MS-Office365-Filtering-Correlation-Id: e27cd62b-4609-4397-640d-08deaa3122a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700016|1800799024|376014|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: 8W+9qoH+xnhIO+X7NJkQMAqF0uyYWj+zRsxSWwJ/FkCnZpCtb3dpdnch4wGDP88n7kdSIG114V8+b7xQAjZCvhZkE7TOHY1opr5uX5jRrWVftWnEw8dgPoFMfKwRqsGNycI4una3nyEVEiPEvHwBl9DPcfYZTPYNC/unAKaQDrw2plxTqSTcsg5AMv/3f6zlIzxJgbmnxOESfVZPpv0OMawaOIkLb2jcac6hI/O99R5X08xNtVqhj1nhjUIGAb3fW6w5fCjkEhmJWytOT0bN3iCcJn9IciVBUaI9i0Ur05j1CV7RsmNif+r2BetAUIZhZeEhd1fHa+YwGxZjsxZVIPOlOPTf6kEKtgzMh4r2CC27czyVO4lPMF10A65Bthtbk6JNLPhOefKkbHtojZXmCmTSoiHgM8tv+OxLnTQiBzIwE+Rrwp3v3+OJHhH1xWDka3oQ+rpbLOhRExtcO5gZggheXlETe5T+MKo9A1YQOPjL6fYXxaLfvYePFRDsNR/W/JntFX/ANAiGZuJPr32jqsVjetMAqDW6eAD/11rRPgQfnwdpLBhDRQTDj7Uoqvt2hN6DsI2cn2I6RVuf1eIAhYwGWsD22AWLhdXl0dEGrtIScQTgH6cHQ32iaggaRLRzSbMoabWsPZFk3nM6gRvNo5cM20Z3+699FHmdZW4gQLGKXk6ashbYi2guk6CrBS2lkQuvYbVSuHc8JaxB5LcP4pdQ5+NRKN7xuRX4OE8VKHs= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700016)(1800799024)(376014)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S/gSpOSSOmMl/u9VsuTmI7NIel+xvW/mxWe7WZog4Y+1fOQOf7yTNyhvKOxXQ63YdFfapJteLrPGWEKb2T7UYyRzjVUR4N6eCIY3jsQu8FYpIenk3YaAVmfmRBkXMgZa7AeyU8cmAhWH6u+ROp3i8R1ce2xO0HpAefQ/21BFJTj9Ff20yueEQSPOP48ppWqflD5HJXM8n3W0FygLJjuITi1GUWUTs8QAh670S5yxg2iU/2MWxKfd6YWzYJamMhO8yJTXIApfWvsYdhENvueknMI+LARBDTIO4cPeKsCIMcHJFGAY8vpIbDc50dHePD7JkVrFNo0SjyQUq+cvWMc+hsc4C5soSj1RYCkcVcIIu6DG+htX/RrZQrTjZ50RdrMCRFfN2+VeujPMeJqLJAf5n+WSpXtkIBrSaKzfjIogoUDBRd3GUaK7jjO1psLl/qy6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2026 23:01:54.3728 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e27cd62b-4609-4397-640d-08deaa3122a0 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECDA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB6016 Content-Type: text/plain; charset="utf-8" If the _CPC object advertises the highest frequency for a CPU, use this instead of trying to calculate by linear interpolation. Signed-off-by: Mario Limonciello Reviewed-by: K Prateek Nayak Tested-by: K Prateek Nayak --- drivers/cpufreq/amd-pstate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index f5c7cc05220c4..9703b54ee4820 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1026,8 +1026,12 @@ static int amd_pstate_init_freq(struct amd_cpudata *= cpudata) =20 WRITE_ONCE(cpudata->nominal_freq, nominal_freq); =20 + /* max freq came from _CPC */ + if (cppc_perf.highest_freq) + max_freq =3D cppc_perf.highest_freq * 1000; /* max_freq is calculated according to (nominal_freq * highest_perf)/nomi= nal_perf */ - max_freq =3D perf_to_freq(perf, nominal_freq, perf.highest_perf); + else + max_freq =3D perf_to_freq(perf, nominal_freq, perf.highest_perf); WRITE_ONCE(cpudata->max_freq, max_freq); =20 lowest_nonlinear_freq =3D perf_to_freq(perf, nominal_freq, perf.lowest_no= nlinear_perf); --=20 2.43.0