Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2461528lqo; Mon, 13 May 2024 21:51:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUm1A5zXf9d4ZcIFBfVOyQc0fKh3XurkgjnemHKzb5j9isjhZD9g5HLpcNmXdKhhLUxVUgYzw+nlx4PZQsizg+Vvz4ZcE1Jf4ChVIrazA== X-Google-Smtp-Source: AGHT+IFwM+Lz9YBfbqzfCpeOVnwQ1y04ZtwchW1GV0ydib/jnB+4yX6Sby6By30RoWNO8cOvxqxZ X-Received: by 2002:a17:906:af14:b0:a59:ca33:6840 with SMTP id a640c23a62f3a-a5a2d5cb813mr643798066b.44.1715662296331; Mon, 13 May 2024 21:51:36 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b4c66fsi617125866b.278.2024.05.13.21.51.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 21:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178314-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=aaSzbB67; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-178314-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178314-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DE58B1F24287 for ; Tue, 14 May 2024 04:51:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8F791D54D; Tue, 14 May 2024 04:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="aaSzbB67" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2042.outbound.protection.outlook.com [40.107.244.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C05114A96; Tue, 14 May 2024 04:51:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.42 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715662270; cv=fail; b=FV5BXrgpADheGIJQddVVdlQd04atEFDq4x3BJAIjR7jGsYSV2quxTbSwsrISfnrFbkk/mEkCdD0Zm7sRpXjTIkVWBTD1kAfZ2vl3WHuZOwD4cpu8Amm3ay5hGaHXty5ArU3NJeBX8vgOEFID7JSZF/PmcVC7vs460Q7no1Ne8t4= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715662270; c=relaxed/simple; bh=ER0Mc+NOt22QbTe2QJUj85fR5w5Bqij76lEITNnWHQw=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=XvgCQENaWRJOkUzsJzElVYInXWAirxpgrjRjDEkMJTmtYNgHQe7qAe4Ix6UdrKwNSSuDl21itm+ext2SCmbcb2U7Rk14ogL44wuR8lEBsvCqAB8zJy9cgrG58GbrKasMODJRS+xURtMHDBoAIEWAUPvh1vCgoCr6BGBqhDib0qU= 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=aaSzbB67; arc=fail smtp.client-ip=40.107.244.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/KDsQsjpdsaYq9ZnZAXnwY4EJYVvolFOyNAJJmuKG7a87lcxmqR9YIgvXrJWq37JsW64IlziO5g+KlwrH3pJiwny59JE7USwihMneuIbmnoMQrgMvquSeUaRqSAFrLYM1ZutBNBT2Iaxu3MmPJ5/vYNp7NlS+ou1Eioi00sYTQEHdGlkXuhkOgRxnexfQet+lFQ5v4QiCDLeRvyjBg6cLPGVEInS1y6vFmtM+dRIrPN+lulC6zQcoSJ2xDBTtqnhZWFDNfwG7vYlfdzhrTImjvQY7QOF9aEoLO2oUaSzolWRN2Ctg+lTetruUzB/+jbO+IYRcOTLB/QSHP6NtQc7w== 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=BNx01ljHD9NkfEfBFljSsYD0Pyg5Njr1zEXj7Ukjua0=; b=CQ39CAGYBcOf2axGJAsZDYwFsVNb0FnOIrpSMpvyjG8Ne6/Gz0WTRiMzI1WtI84ujM4MrEBkVkPPpRM8zb6VhdNuJvA8wfk69ETR6yCmoQahhECDBa/GjpWqOHd9YpOU+XhK6Ry7mB1EtQBef8p9eEcQrhjE5zCXmY/IuqgcLNc46KtORPt6B7YgfISM1LzMd+LjD2JqdAWnBy29EzuU7GUtyCfla8JZOn2b+sBRFvMw4NvJm946hEp8byV8uG8PUNwcwlpCexn+LtHVQFT7vqqP4WdmqdtJmEkvITF71ZzC4yfAdDQitSkQ0cUTnFtPpNGYsd5A/2TehS4Z6ywU9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none 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=BNx01ljHD9NkfEfBFljSsYD0Pyg5Njr1zEXj7Ukjua0=; b=aaSzbB67HL6csk5o8UBJNyoMi76vsRRwVKwdimsC4SUW2dPQSaMDwBlKic+D+Inft/KsjTx9Wc3RpwA1FPVxNA9emKjY9CNdmOyB9A9wzgna9IwHpM8JfvPkqCqPPXWFnGPmVoKeegpNMO7/Z97lB1gAgN+aD3rhIDTA/3h30s0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from LV8PR12MB9207.namprd12.prod.outlook.com (2603:10b6:408:187::15) 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.7544.55; Tue, 14 May 2024 04:51:04 +0000 Received: from LV8PR12MB9207.namprd12.prod.outlook.com ([fe80::3a37:4bf4:a21:87d9]) by LV8PR12MB9207.namprd12.prod.outlook.com ([fe80::3a37:4bf4:a21:87d9%3]) with mapi id 15.20.7544.052; Tue, 14 May 2024 04:51:04 +0000 Message-ID: <85302e25-0eca-42d2-bee3-733b608bb33f@amd.com> Date: Tue, 14 May 2024 10:20:55 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 01/10] cpufreq: amd-pstate: optimize the initial frequency values verification To: Perry Yuan , Mario.Limonciello@amd.com, gautham.shenoy@amd.com, Ray.Huang@amd.com, Borislav.Petkov@amd.com Cc: rafael.j.wysocki@intel.com, Alexander.Deucher@amd.com, Xinmei.Huang@amd.com, Xiaojian.Du@amd.com, Li.Meng@amd.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: Content-Language: en-US From: Dhananjay Ugwekar In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0067.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:23::12) To LV8PR12MB9207.namprd12.prod.outlook.com (2603:10b6:408:187::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV8PR12MB9207:EE_|MW6PR12MB8914:EE_ X-MS-Office365-Filtering-Correlation-Id: b531636c-e2e8-4c5c-fb9d-08dc73d1759f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Rzg5dHh0aFJOMVBRcEY1aE9UUUFTejVzemFkMUV5K0hVc0NuNWYxV1FlTjZL?= =?utf-8?B?eWhKN3JudXROMzhFbkxDUGFhTmtQVjNPa1kvaCtmU0E5dFVMYnNWdHRnZldu?= =?utf-8?B?VHlnYm1sZUJOOWI3TzhTT1lrRGZtOVBtM3hNckEyQ2VvMEErRTNqcjRoUUd0?= =?utf-8?B?QkVIV2VEUldiRGFPMEx3a2dlc0hCQ1p3ZUcwUTB2VTZWK2ZqUWFja01XUTEw?= =?utf-8?B?Y0M1TEFhZXhLMkNiRzNYNEtTTHpZWFYwUERBMU1JaDNMYzc4Z00zZzlacVdr?= =?utf-8?B?cTNxdi9BWHd3eXpBNnBpckVTVmd0dzlVVE52SEpnRUUxcUVEclBHSi9ZSlhl?= =?utf-8?B?WEJ0RGRXcWVIbkJqSSs2K1NPMkg0YkVKakU5QXNnOGxjVThQYjlaNVc2eEJk?= =?utf-8?B?REUwRFZSckZMb0FYdktTUzFDbkhiWEdxS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KNUZ6dkU3alN1TVlMQ2VhdjBIUWNFMURPU0Nj?= =?utf-8?B?cGpzNVA4TUt4dGV3bDF3ODBKK25CQnUxY3hTc1htcm1qb280S2hpNXdWemor?= =?utf-8?B?RXgrVEZyT2Vod2pObzUvVFh5NjhqMythN2QvSVRBOVBFanQ0YjFwUmowZVRz?= =?utf-8?B?bmR6ME1Ea2YwalhJSU5CMnFMQ0hWUU9NZmQ2TkhhcXBJa1IxQjF6SGU2YmRq?= =?utf-8?B?MnFOY3I0c3ZDNTIxbGR4RmxOclJiTW1xTWdhTm9Nek9jQkpFZXo0ZXg1cnNs?= =?utf-8?B?MlczODI5WjEvWE16T3VvcWFCV0VueXpPd1o1SlU0UDdQMHUyaHF4RGxrUGx3?= =?utf-8?B?WkQ1TGpHd0JEM2huWWFqa0xQdGRObnl2Y3UrM2FpNE9veUkvVkdvYWRRPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV8PR12MB9207.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RTJGU0JmYllWQnduQUlDMG5YSG1nN3ZGaUE0VXREMll6aURTcmFKemQ3aDZG?= =?utf-8?B?bjN1Ym1pbWhETkVrNE5KOFpGTHgvMWdQWDRSK09wNkZMZWhtSExTY3NUdStv?= =?utf-8?B?OWFWeDREeVlET1U5SnhNS1AyOEJYN0dtWnNTVjNZejdnNC9udE1VVzJPUGdG?= =?utf-8?B?dFM1R1FwK2RRaXJaakthZlVxVk9kdS83a0YrZGNxUldHY3A0cmxSQjZhNmsr?= =?utf-8?B?Q0pBOTFGc0xCdGpNTWR6bFVOSTlQeitwZzRZeVdnNXdEL2tIRGd6K3YrYWJj?= =?utf-8?B?bWI1bzFydnU3Q0x6TXRC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r?= =?utf-8?Q?t9Jxupqjh3YadqmbNo1tqpqPJ?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b531636c-e2e8-4c5c-fb9d-08dc73d1759f X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9207.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2024 04:51:04.2533 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: V9II1dsYnxtnD6HMC4ByvO8u7anur8tWwbguf2oNARLrwLTZa06lsF+6JpCpU2VRStbmEiq7jXjPsDsxjCzzpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8914 Hello Perry, On 5/13/2024 7:37 AM, Perry Yuan wrote: > To enhance the debugging capability of the driver loading failure for > broken CPPC ACPI tables, it can optimize the expression by moving the > verification of `min_freq`, `nominal_freq`, and other dependency values > to the `amd_pstate_init_freq()` function where they are initialized. > If any of these values are incorrect, the `amd-pstate` driver will not be registered. > > By ensuring that these values are correct before they are used, it will facilitate > the debugging process when encountering driver loading failures due to faulty CPPC > ACPI tables from BIOS > > Signed-off-by: Perry Yuan > --- > drivers/cpufreq/amd-pstate.c | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) > > diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c > index 6a342b0c0140..614f6fac0764 100644 > --- a/drivers/cpufreq/amd-pstate.c > +++ b/drivers/cpufreq/amd-pstate.c > @@ -889,6 +889,24 @@ static int amd_pstate_init_freq(struct amd_cpudata *cpudata) > WRITE_ONCE(cpudata->nominal_freq, nominal_freq); > WRITE_ONCE(cpudata->max_freq, max_freq); > > + /** > + * Below values need to be initialized correctly, otherwise driver will fail to load > + * max_freq is calculated according to (nominal_freq * highest_perf)/nominal_perf > + * lowest_nonlinear_freq is a value between [min_freq, nominal_freq] > + * Check _CPC in ACPI table objects if any values are incorrect > + */ > + if (min_freq <= 0 || max_freq <= 0 || nominal_freq <= 0 || min_freq > max_freq) { > + pr_err("min_freq(%d) or max_freq(%d) or nominal_freq(%d) value is incorrect\n", > + min_freq, max_freq, nominal_freq); > + return -EINVAL; > + } > + > + if (lowest_nonlinear_freq <= min_freq || lowest_nonlinear_freq > nominal_freq * 1000) { > + pr_err("lowest_nonlinear_freq(%d) value is out of range [min_freq(%d), nominal_freq(%d)]\n", > + lowest_nonlinear_freq, min_freq, nominal_freq * 1000); A reminder, we should fix the below code section (due to only nominal freq being in MHz), 685 static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) 686 { 687 struct amd_cpudata *cpudata = policy->driver_data; 688 int ret; 689 690 if (!cpudata->boost_supported) { 691 pr_err("Boost mode is not supported by this processor or SBIOS\n"); 692 return -EINVAL; 693 } 694 695 if (state) 696 policy->cpuinfo.max_freq = cpudata->max_freq; 697 else 698 policy->cpuinfo.max_freq = cpudata->nominal_freq; <--- mismatch in left and right hand side units To avoid below situation(from a Zen4 AMD EPYC system with boost disabled), /sys/devices/system/cpu/cpu0/cpufreq# cat scaling_max_freq 2151 <--- MHz /sys/devices/system/cpu/cpu0/cpufreq# cat amd_pstate_max_freq 2287000 <--- KHz Thanks, Dhananjay > + return -EINVAL; > + } > + > return 0; > } > > @@ -927,15 +945,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) > max_freq = READ_ONCE(cpudata->max_freq); > nominal_freq = READ_ONCE(cpudata->nominal_freq); > > - if (min_freq <= 0 || max_freq <= 0 || > - nominal_freq <= 0 || min_freq > max_freq) { > - dev_err(dev, > - "min_freq(%d) or max_freq(%d) or nominal_freq (%d) value is incorrect, check _CPC in ACPI tables\n", > - min_freq, max_freq, nominal_freq); > - ret = -EINVAL; > - goto free_cpudata1; > - } > - > policy->cpuinfo.transition_latency = amd_pstate_get_transition_latency(policy->cpu); > policy->transition_delay_us = amd_pstate_get_transition_delay_us(policy->cpu); > > @@ -1388,14 +1397,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) > min_freq = READ_ONCE(cpudata->min_freq); > max_freq = READ_ONCE(cpudata->max_freq); > nominal_freq = READ_ONCE(cpudata->nominal_freq); > - if (min_freq <= 0 || max_freq <= 0 || > - nominal_freq <= 0 || min_freq > max_freq) { > - dev_err(dev, > - "min_freq(%d) or max_freq(%d) or nominal_freq(%d) value is incorrect, check _CPC in ACPI tables\n", > - min_freq, max_freq, nominal_freq); > - ret = -EINVAL; > - goto free_cpudata1; > - } > > policy->cpuinfo.min_freq = min_freq; > policy->cpuinfo.max_freq = max_freq;