From nobody Sat Dec 28 04:10:57 2024 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C02D91925AC; Mon, 9 Dec 2024 18:53:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733770400; cv=fail; b=cu/NbTUwphUpGwJIr5jltDfy4JfCWKqrQ+gdqKJw9Ki7wkP9XUZl/O+T1q5+ELw9kKwZzp4btWTWzo5UrJAlgFR4GawKtjatRwcXDqt7v03m/5SaS7JW2yjjiHVijWVXYs5qFIj/SH5H/TzMpbYhlLwHyW8JZ3Qft0ADokFYXAQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733770400; c=relaxed/simple; bh=1hJEV4TDhoGWDNUVBi1hBVjXPxwh22hJPz7IsiVQiEM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f7U5Jk0ItQcQrhvyhmQ14p1Iv2BgK7SlPw1BLsFR5rpe7mFTQAkl14pqvh5DrhzgbYRq7Lm5K44p1GxwMf9dvOHioCom9BiPA54MAcRph2Xa8upbTXewFWi+KEZcurRYe8831VmSC/spOBgKNnoXP/xzSbDu/HYqvBDAu81kwoI= 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=w36bWWlM; arc=fail smtp.client-ip=40.107.244.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="w36bWWlM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YAU5r+dbkj+MAjmh/83vmP3oKdhb5MKjaK6hLDg9XUQFSknhfhOoiaejEodH5vuHwQl0ZrR+BxHVgz+Gu87PH+SnhZdmBXJT5gJYo+t1Uh7AUuswFUQ7t/7FdHDiwETVSGkrCHhepmy3/pvAlI+Q/QG3+YYKTyDVVgupV2LSZCJPzJfmVngTfS2FzZgoQrwIuHw4I1qQ7GN+Vos7bGaYMde0x+oBHcKEZx4ayUQW3hL9yPB7d3hbRQc4t4m0UeOO2LISZqbfa5gZTSGX/5/fdHvXA5UdQ/T1nVtEAQPVnAXOWnM/MUgJAh19NfT+1Hf5tYzDpOzgSHfIa46NWbQoSg== 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=ucqe8HPLacp3VkKxDehsSMBwOsryPZmCHnwY2O0VS3Q=; b=RSI+yqAdj0yYTyZt6VKcQ8qEv8EtkZeCqsNns7hYq8/C2HgUpxO9TBjH5TaW1zCYmIozlg5yWoKqctbkTDBBbkaPXd3ZEDHitaicBxcoUbvTs8LvFHUVqHkD/0ul/P6HEkPqScDL36qtbhwlHRQyUE/xfJ9bh12T8EVCNxneYCP2zypBGsyzjG9hAOwc6jiFHrJDpi7LeVabGQOplnniWsIztu+S3kxgKefVyZRRiClG4/2DpOMU6JrnL+dW1AjW2vY5ZM8HNt/oUwO6+fr+dqVB6pnZyRVQ03Is7eLQ3DqV3nIPCVmjUZzq6UzNIzbpaz+fzLe3kk0ZN128AVHK7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.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=ucqe8HPLacp3VkKxDehsSMBwOsryPZmCHnwY2O0VS3Q=; b=w36bWWlMVo98i+83kChrFMDc/BDNTUoGXZZt3njfIYLzDoMGHACxnPLHwL5XSlTpA5zcMmQFcanSTBSsQb52Pu6Rpl2oiXXfYdlQzAduCclKEeWznY+ArfQ4UhnJvHf4SQzECyvzGWPhVuPKtJhzkz0eRGq/7sGicdg7o17iT7U= Received: from CH5PR05CA0021.namprd05.prod.outlook.com (2603:10b6:610:1f0::18) by PH7PR12MB5710.namprd12.prod.outlook.com (2603:10b6:510:1e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Mon, 9 Dec 2024 18:53:13 +0000 Received: from CH1PEPF0000A34B.namprd04.prod.outlook.com (2603:10b6:610:1f0:cafe::55) by CH5PR05CA0021.outlook.office365.com (2603:10b6:610:1f0::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Mon, 9 Dec 2024 18:53:13 +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 CH1PEPF0000A34B.mail.protection.outlook.com (10.167.244.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Mon, 9 Dec 2024 18:53:13 +0000 Received: from AUS-P9-MLIMONCI.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.39; Mon, 9 Dec 2024 12:53:10 -0600 From: Mario Limonciello To: "Gautham R . Shenoy" CC: Perry Yuan , , , Dhananjay Ugwekar , Mario Limonciello Subject: [PATCH v3 02/15] cpufreq/amd-pstate: Use boost numerator for upper bound of frequencies Date: Mon, 9 Dec 2024 12:52:35 -0600 Message-ID: <20241209185248.16301-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241209185248.16301-1-mario.limonciello@amd.com> References: <20241209185248.16301-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34B:EE_|PH7PR12MB5710:EE_ X-MS-Office365-Filtering-Correlation-Id: aa0e1ab3-491c-4861-6450-08dd1882bbbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?adSuj5qgR1obDd1DUedaC28FxhxB8rmM7W9VqJ8Ufe/CevUAXQMfvoXuKoLe?= =?us-ascii?Q?1gEgneGz8ymYl9cUBpuMuzUMAM9LyRTm5NXeYhyca/OO32XJXqYD77A7lJaq?= =?us-ascii?Q?1aq9FRssbBAQ9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HF2ScQW?= =?us-ascii?Q?3Cd5ThuOvXK1Cl8A3s+/WotRNH5Bm7tLMoGHfwRaRvddZu9q9Gv0alA5oB1Y?= =?us-ascii?Q?BNisG7J9lQmCBSZF0NN06j24n6jZuqFny1fVnY1nucXd8nLHU0AyL9eHilOY?= =?us-ascii?Q?aF2w+EpY8uD3fjCrJgA7vyfIv1y1C7tbNz9RABNtgiZaYFJcZFyRS+Wnnj+j?= =?us-ascii?Q?E7VQ77IjLes4EVE+f0vYV7yaeEwx1be68IrI+now2IKzyLR3jwDLlAEQu57E?= =?us-ascii?Q?LucagROrdG47q1QK6HPrZGTzeRwUNwgFgyDBBVF5Lv3TEEjEl0FOnDSGNAdp?= =?us-ascii?Q?5QOCbck8cuYwwRL5D6spIquv8KYBN4oGZ0p263y7g7eE2VKTmy2VLki5jkUv?= =?us-ascii?Q?enXx3F/mCkWGPdZc+Dom8r7C8dh/6+glxBTAgdJU9NTEFrDycN2X/sjpJtlX?= =?us-ascii?Q?kc9Ox078ORt8ZGJt6+h1LKCTOGE0v9QD?= 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:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2024 18:53:13.0263 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa0e1ab3-491c-4861-6450-08dd1882bbbd 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: CH1PEPF0000A34B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5710 Content-Type: text/plain; charset="utf-8" commit 18d9b5227121 ("cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled") introduced different semantics for min/max limits based upon whether the user turned off boost from sysfs. This however is not necessary when the highest perf value is the boost numerator. Suggested-by: Dhananjay Ugwekar Reviewed-by: Gautham R. Shenoy Fixes: 18d9b5227121 ("cpufreq/amd-pstate: Use nominal perf for limits when = boost is disabled") Signed-off-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index c51026fe636a9..5e0edb65de32a 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -593,16 +593,13 @@ static int amd_pstate_verify(struct cpufreq_policy_da= ta *policy_data) =20 static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy) { - u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf; + u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf, max_freq; struct amd_cpudata *cpudata =3D policy->driver_data; =20 - if (cpudata->boost_supported && !policy->boost_enabled) - max_perf =3D READ_ONCE(cpudata->nominal_perf); - else - max_perf =3D READ_ONCE(cpudata->highest_perf); - - max_limit_perf =3D div_u64(policy->max * max_perf, policy->cpuinfo.max_fr= eq); - min_limit_perf =3D div_u64(policy->min * max_perf, policy->cpuinfo.max_fr= eq); + max_perf =3D READ_ONCE(cpudata->highest_perf); + max_freq =3D READ_ONCE(cpudata->max_freq); + max_limit_perf =3D div_u64(policy->max * max_perf, max_freq); + min_limit_perf =3D div_u64(policy->min * max_perf, max_freq); =20 lowest_perf =3D READ_ONCE(cpudata->lowest_perf); if (min_limit_perf < lowest_perf) --=20 2.43.0