From patchwork Tue Jun 11 08:52:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693297 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2065.outbound.protection.outlook.com [40.107.100.65]) (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 28162176222; Tue, 11 Jun 2024 08:52:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095971; cv=fail; b=awdDPWEJLIwmJMJmy0IIQwXuCwAIaG8qh72dlr4DlF/dTRGUENmHue8Tf/um3ABSq67CkreHCIhWyG50MGKvtYEiSe3yISw+iUgvlx5KHXbJKodOKL/Uftst+5Y1O2ojzbx+zMSmPRW19cpxdNU3kVFauk4X5PzUo7otbHITD2o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095971; c=relaxed/simple; bh=FlWoHYyH68BTr8AFBfqUJBJTgme1+FbeJBCetictUzs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c54rKoHDYd+++mJvC051LlJI9grVKbeUEHzs4fAclVU8eIGb7X0XH+hj1r9QvKSXv4rLN9C1uUYGtID48DDQQsHikZefLCppgf+QsF6UJ2/0JhSUgtsGe+P6eYVmVnAtAlkoHqKoHwuMO8Mw5RO8/pd6/NKp0SigYo6fZHakvwY= 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=nxX+sY1e; arc=fail smtp.client-ip=40.107.100.65 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="nxX+sY1e" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hYO9YY0qM8IKSJ9oYoS8b+eEG7H/HCuipRhWI316NFc5+gcKeMOuLxvT1OX8GahxGwzhNs8FnojbGlQrpOyrX99OlhRelrcvm5UgO7lnrauywTOJwoAOhogNtR3isHbxUwPF1F2wl/Bsk7ZYpnmv9lKNL80pQx4ohbO5SNd2O8WJYTgEkBolCi+rQfe1FwhPGo+Hn6B7cORCnmiS5EBjnbzRa9SxjFPXz3iXkbfdsuLWQYZALZwasgmmfR6ZZVqHP+6OHkpsMeCtMihHB3F5yTB8ykfYFiTEj9S1qr9y84zVxYLRBIB92kyC9DgxvdrGEqYARzXOhUtY5togKZGMeA== 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=zPxB8jcSgJitubJnSKC2xIccMKbCgoBiCk1HJhRnCks=; b=gprnB7MvSs8tAiGLp5MllmOScGFWQWMS0QYb9i8cRF3z8CJE1ALTiphQqHNw8qR3a5h0vapQ8OJpUNp5tEeVN960ZFuTw2jC0VhWA4Ze/z1auDJqNMsmsHvkVP03c8XqRwTYsOYB9vwCzTTeBDeHEUZTeLoRK67pF/VRPt3Ky48+eY1etZmCKBLRzs1QC/yhQpRq1+lAL4kjBwOuEUtQ9fSJwZdaZf9RDa2SzOkXcTWN0pF8t+nuRrDXAdlsR3vknNDSoJvLHcmmgFeKpzQLb2jqcYGTlP12i2xuu7sfmZLULagZ5fkMQ6L90ttdKdzLrHG/LWUw+NnlZtNwc10eCQ== 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=zPxB8jcSgJitubJnSKC2xIccMKbCgoBiCk1HJhRnCks=; b=nxX+sY1eVOQxg2Shi3aAnA+6imt0T2fAhroJKSiVnInp0qGwTxHlHI9w6pTr0jRkXPYSzn0QBnEKhYRTN5Vjs27KfyRf0qKByAPEX5ObOKmpOuyu2HHIsh9K5fkOVjYjyuh1RFab8/lDG511YGsPZfL+gifxfCQP/dy/FlyWDtA= Received: from SA1P222CA0153.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::17) by DM4PR12MB5985.namprd12.prod.outlook.com (2603:10b6:8:68::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:52:47 +0000 Received: from SN1PEPF000397B5.namprd05.prod.outlook.com (2603:10b6:806:3c3:cafe::d1) by SA1P222CA0153.outlook.office365.com (2603:10b6:806:3c3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.19 via Frontend Transport; Tue, 11 Jun 2024 08:52:47 +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 SN1PEPF000397B5.mail.protection.outlook.com (10.167.248.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:52:46 +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.39; Tue, 11 Jun 2024 03:52:42 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 01/10] cpufreq: amd-pstate: optimize the initial frequency values verification Date: Tue, 11 Jun 2024 16:52:17 +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: SN1PEPF000397B5:EE_|DM4PR12MB5985:EE_ X-MS-Office365-Filtering-Correlation-Id: 2583f796-d651-4343-6acc-08dc89f3ddc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: 22RC141i5+BguVxb9P6rsVzLRJtpQ+oyjBqK5fUpZfXZOkwsZqliDK4TLNiTy/YdWBliR21FASeBNBX2XY+hh9C/4PmynMo5FtuD1HqBnKRgL4ZAqsc+FAmdOhE2n3UpKXd4Mm6jf76tEyEJ3MSAg5QjeAx9vwfNxmcgOo5zATRURhcht4MtdHTeyfCc6yx6E3n4YTA9mrE0DAEUjxmK0rjtQql0HwCsDt/XfeV0Sy+dEo07+pmmfIoFWMTXxmjYTkJc46tJSrIweYvtHkxyP+n/Hly1m70o60noLlL28WwbYRqA9LJXm20cAXjZW5Hw41wOAPaQxkYwSxUE/vRPgQoFC0mEt+4WBLipVAmRFnh8CTUtXjrztytUnfb7Bp3iGv41IcFZNkwARCGbUPwysyzQROfRfmJYrc8H7YXziLJy7RTGEhjV13oJ+R9Mf0K+M61VseE+cTVRLIg+LKd5gTV2IO1zI5vzfRgPgv/mHLbIAOqnE83gxiGvJp4mL9/eo0ICokF3Vk82qSuGJ+Mwv+LT/prD5JKYVr3Nvch5UCMEIzuaYCROrOQVw+rdsmTiHdZMntBit6YabGcn/tZ9LvNBTncLcHoLCjuUDJXl81uDULmBnQPGmxxh2P2/BsFpR1ad3JqsLuf1yXpEii+Kc2qIfKz1cMSjuxCQyEoufeFXDdKghR1dimzvZ5eWYsKvrFiIO4uf8jxDkkJhVdb5LcB1aH3wKfzDl4p8mKbdG0VWIDx+6MaqudDLRur8gdjnck6K7ryNq/cxxaaDPPLCJS93MJMVGp+bCb6o6BYgKjfp2h1CCS62j7ZryotDwxmrmsutHvKTZ6YV9ziYE6z+yHQsr43nyl4dsRwLJgp9K69Va9YoILTGZpDYnnlMw9oxgGWzmYXfDxO+UKqNm6i3PTUWzB30kFifcnSe7iIWlPhfl+KHf9868gxLV6nmR+QFbnHzONYRdXR3GFP51rqaed04rUj7GTgGwyd/MsVMb9wdLLeW0vDfPWJj1G6m1K/TIrZiJtAfX12cwSKnyjqYvTKJTTT+8Eopfi80AJsFq38FFrc8ccIizQbRlPBhbaNIoHi9+ULAuLWnzkYgZxVdi8n3jzm9YRROAwkP88YI3v03VYkNcvfcpmqS+VEt2/w1tHvQPur8ERlyzvot32DCXUqhmEmm5B7CG84dsxcTvTbGRZs1tQvSY+OoCzfb0BmNuIaeihX81NWe7HOYen20ugO9TWnLHM2q2BiWYvJFZdMgZRPHqhImjx4xLSer6sQGFGe8G/7poXkPblwPlt3zHB1wlHW4rgAqGdqDkkXVyAlUu2pKNEn5CQIuLnp8uKW0+2XxPn7WNu3aBCKHFWLuecIgQLM8aAJj1C1pbph9llyuLdikoosPITQQnHJsMagK4+p/GAOw1ZGDNlGFsEXnDA== 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)(82310400017)(376005)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:52:46.9525 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2583f796-d651-4343-6acc-08dc89f3ddc4 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: SN1PEPF000397B5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5985 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 Acked-by: Gautham R. Shenoy Acked-by: Mario Limonciello --- 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 9ad62dbe8bfb..37fce0569d06 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -921,6 +921,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 * 1000); + 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); + return -EINVAL; + } + return 0; } @@ -959,15 +977,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); @@ -1420,14 +1429,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; From patchwork Tue Jun 11 08:52:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693298 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2073.outbound.protection.outlook.com [40.107.96.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 9C3DD176254; Tue, 11 Jun 2024 08:52:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095974; cv=fail; b=rEj+NRgzsbAjxaRQcHHgZiNx6FsMHnK/Y/ZN+Dct3Fzsy3Zvf/DAilEoB//xZHUhtURMrGd96XgU1VlVR4qVDH9J8WQYxhiHbxd3OIxgny6UOreaJM4zxcUREpoNBBrb9h0WssUjvFCo1jzxkYjXlhTpy5+0/YAG6zpb/nkmDLQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095974; c=relaxed/simple; bh=mO2rJwD5SQq+6+yWjz798sXPsyoAFbLwSsPFF4K3qrg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dC3RVE7M8wzc/mKeg0T97Bvve7F9AiGaQQM+7j2UGjnbPHNbh0rqSn/U52Z1HvUsbG7N6tGOdFVCW1nQZDv36cAhTypheLuEWHIHhqfDweWTR3+nIXMIHqzY81dsjQ8aTKdF1uPP1kXt6GLcCc+tRMuvdIeJ60I8XE3OD9VFCb0= 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=RAONRvYU; arc=fail smtp.client-ip=40.107.96.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="RAONRvYU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rx/dMLEH+N2Z1iPWXPVHTju/m59YtpMftz4i++Uv5t8CgiMPu728jdczRXt5AXpU7Aj4A3VAdDzMZNefq12Wqn3hsvW+F9HTq/vrlOdxyW5Mj5YNCeAk7mhKcZSfY/+Qt+oyno7aTpDwBguEEh+tyeFYP4lt9OCQfnMZmqJyulFaOB+NCnFNnUSNR+9J+drabUzm3wsOJ9FgFV+8PVXWvu8iu9wwjXpH5LLUH825V7tMxEGS2ptzPJokGkxHOHXS2UdmRRaeoKVXUns8JizAb59tVbxH4WEo2A2nVSShf9RMmQO7Od6PKQLKUhKl4UgCK4r2d4KlhMQj1eY7BQsoig== 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=Hu2vqfpSGOUEgE2QyBtFvickCWxM0Ihv8YUjSYxv0RU=; b=nrbGECQtpb4D7be69yW/NFnJR7Q/Fwj3iK7nr26DflcQdo5SsaqKiyCmglU5XY+AZ98p4Wwx1r6u23OgTNMZNMY4vpNtoW7aj7u2qAlf6Jqb5fUXCQktKUj7aAMsXHyTb4E1lgXpg3N4BV9U4geZDrgyS4kgGEO3hDnHSYZmnn18BZd44y06l0jR8tMD8g8Z6TkUiLbweW+u2rAmHM+rmPgcBxNnFI7xH+INWOdkVlLQuJ6qKzwDnrIgQsckWLdijtn8Tx0phO4cGzywmFEiyipZ5fF/UYxVrkriWxu5DuF5EqY5YHbAQaYFt3rC3dmdRvBiF9ylwOvkw28i4P6VFg== 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=Hu2vqfpSGOUEgE2QyBtFvickCWxM0Ihv8YUjSYxv0RU=; b=RAONRvYUgGkMvIv71jiziwLSH3HDAqlOk0Xn1Ai+CTorcXRCKpQoX3Y1AGoZvZIuLP7TD6wgIYxrUkbMe1YhalpVO7YdJBrdbuVsiJa/bBFpbW2QN5/4DXci+vYt4AKfJNuAn5idA1VDl/lAOuVZr1OSxjc7hXV9TfFK/dTyAOI= Received: from SA9P223CA0023.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::28) by SA3PR12MB8811.namprd12.prod.outlook.com (2603:10b6:806:312::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:52:50 +0000 Received: from SN1PEPF000397B2.namprd05.prod.outlook.com (2603:10b6:806:26:cafe::5d) by SA9P223CA0023.outlook.office365.com (2603:10b6:806:26::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.25 via Frontend Transport; Tue, 11 Jun 2024 08:52:50 +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 SN1PEPF000397B2.mail.protection.outlook.com (10.167.248.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:52:49 +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.39; Tue, 11 Jun 2024 03:52:46 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 02/10] cpufreq: amd-pstate: remove unused variable nominal_freq Date: Tue, 11 Jun 2024 16:52:18 +0800 Message-ID: <9278090e44050a43692173461eb7a915c123618e.1718095377.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: SN1PEPF000397B2:EE_|SA3PR12MB8811:EE_ X-MS-Office365-Filtering-Correlation-Id: 52889120-865a-4807-ac76-08dc89f3df65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|36860700004|376005; X-Microsoft-Antispam-Message-Info: DR8YwJT4HVTu2tkH2putH83zpLkudkQ3zyszBzdL86bnC06DRNM66vPOKDdbME2DJbIz+Q/ovvKyubZzHzivOViSwBcipfs8aFImcHSFnWpav7PFpFSzp3z65BLcC5bQ+DYqZnOpbrgjELn7Z/dVrL4BNe53lDti0fw0TjiDb+YJlrPJfjSfIiyilb3VbljWvtbT3EVUrh4nRBDZPoHcpVO3Cr1/iWdpFzpr90oCDFAu+fzi8liCwYkUIWh1eSidFiUQUCET+0+b/5Xf2f1p19LvKzftJKpVC3T17EZIgIcCj/h6/DCqrv0bRF0KVOvrvXJzPJhc5eA4QzTn2PVsqa4axaJuigyIdxLyfC1Fm86fQkhrUe6B+qMphnnCV00L1iHTZBN5VKBpiyF5TvpeK5sXglCzrAmugXdGTuTxjeNxpyr2LeZVqv+Rg/eUHvLqVbws8fWQ4rkyQ63gwDOGXNvQUALwqsymOe/ODhC9kRg2+5/7Pfrs0sMg8cr6T2/o4JkE4UMShozuE6UoY2BKeZg03dEbcA9tf+j4O3VIdhQIqo1wTQ6ljB7+m74gz0fgqAn26ngq/pHvTB28JxPhVy5ezWKI4Iz6XAkQIXWDppsN6XL7J3yDyC8RVynLBD1Ylv4krKp0NzisrVSjfdukOjkPMY0L0kMee2DbMfV6SDtauYnJnAnxww2A22XKawjLzcDbTTc9dVuGHGH0u8uvqv/qo/J7QrI0nnXVqtjXpYqnkbE78SD+y5rtp9oZcVH5mpsBVzkFKiiymuJOs4J64p3vWunaW62DStbDBOwe8p6+MPYgwVCV3C3VpsU3N+Q1V3fELEfr/mrSHax1r7XYsuOIOStACVoxHvgQkQq/kVJk/THaaO+jb1Lg4yNVuVNz6twLhHGzboTXIJP4q+ndmP9fup1xson80gRyESy3f6PUt6WkNLarssIATG3MyODObRrQaJr68fFk4pJ2VNJ4VzVWz0FtJ3rFiJF5UvTUtBPy0SIWk5AO9tJsRBpsZfWZNVrVPEbK8e2ZYsOgd9vtglhdA+RlNWc8F+j17N4I5b4ph62ZNf0zMkjD3QIcZtbZjz06RmttkxzfSL7ouAVuz3afY1W8FQnxmxKH72Zih+S/foZaoxmuRYNLZMShkBmcwyV//sToQo28/tCbNgp9wmaQ/lVw1LHLAt/CreBcuPO38d0wMhO8NG7/DngwGIHsxIO7L0ODxX5tvBP5H7u4pfLzcdqMH1GwQhKnvx3D7MfOgLczgbNdmrEiAmEXt4jP+RuPkkfBfI2zrJdzz2clE1n3jFUdGjaVg1dJG2jKHk0htjcx3lKpGY3cdVMjPm76XKCEZmssqtMnS0jvKR3XQqLtNwokLB24AHZaRwRivNJK7733Oh+UrpOBAXBVL9oQ/N3MVecQK19cQ4+cN/vyIg== 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)(82310400017)(1800799015)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:52:49.7027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52889120-865a-4807-ac76-08dc89f3df65 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: SN1PEPF000397B2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8811 removed the unused variable `nominal_freq` for build warning. This variable was defined and assigned a value in the previous code, but it was not used in the subsequent code. Closes: https://lore.kernel.org/oe-kbuild-all/202405080431.BPU6Yg9s-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Acked-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 37fce0569d06..36b1964ca8d3 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -944,7 +944,7 @@ static int amd_pstate_init_freq(struct amd_cpudata *cpudata) static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { - int min_freq, max_freq, nominal_freq, ret; + int min_freq, max_freq, ret; struct device *dev; struct amd_cpudata *cpudata; @@ -975,7 +975,6 @@ static int amd_pstate_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); policy->cpuinfo.transition_latency = amd_pstate_get_transition_latency(policy->cpu); policy->transition_delay_us = amd_pstate_get_transition_delay_us(policy->cpu); @@ -1395,7 +1394,7 @@ static bool amd_pstate_acpi_pm_profile_undefined(void) static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) { - int min_freq, max_freq, nominal_freq, ret; + int min_freq, max_freq, ret; struct amd_cpudata *cpudata; struct device *dev; u64 value; @@ -1428,7 +1427,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); policy->cpuinfo.min_freq = min_freq; policy->cpuinfo.max_freq = max_freq; From patchwork Tue Jun 11 08:52:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693299 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2079.outbound.protection.outlook.com [40.107.94.79]) (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 8523C176FB7; Tue, 11 Jun 2024 08:52:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095980; cv=fail; b=gSyMX4HU6HDiivGd0WVov7+2CBU5ulR2OjbCi5xLNYAffgIqQvfxhxtnJR7h2iDqA6Yz47PZ02kumQLVbVBBH63zP1eOkbxnzi1IKw72kpTKw0OS0Y5yDmD1bFJaw2MQTBKQJfumLFqgyEhMC1cfI8j9slEjyQbNLlJGIDSf2Nk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095980; c=relaxed/simple; bh=tEDfx8mHUWfdUxcRaEpEX9TQCXUn/okttpoUbgGUT0U=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jhkz+Mc3Yd5BqGoQeVmWOQvNuUvqaehrPRN8yv/o2KwVsezfuKBo5fTRQtvoQq0MqTLKlf01fZmnKm+5o+vciHkEi+6aJrlFK9XkpuJRLzmjbS+0cvrSvZWkWBUKSqAnKOLioQmsVT4J2CcC/LM7jmhXzUttq7oK2UxO/RytzWw= 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=dAIiuVGy; arc=fail smtp.client-ip=40.107.94.79 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="dAIiuVGy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UghKGT+JqpSTteR4MPov4TSi5HxDN+JryselHwwFX0I5g4pHMCQwbGkAEvNDl2csjy06EImDgekhMmSWmXiRfcnKQSUeBeoIZjoKd5FwM6ehvYxpjv/VkX7M4pQgJUEKtcbnpyCMBaElY6EAT0NVLEoiZFmKMeCghCo/JMAmtb0ERswXl5le6YGW8fN55gBNyGe5a7lgrz13rmrbbJXszz1IRd/SfGvgDkPDY+qzlPkf5mjs1npFfxM+bbpsxKdOmIeTxjzS2I/u1rO9ATQkQPVDkX8He+upLBKbz4HGD7gGZJZ7dVP6SWcReE5/e8OoJof493XmRJdxntbKonHInQ== 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=liWm75Z0i6PpZUdkpkbQYOaVVs8mZASTyBjMW9Pf+S0=; b=CbXenKj1NHMOy7nSeXzSTNneo1hYIOsAAFrlJxZzn18fznRxVq4w3YnAWipEOheQYuHY63YPdq2Q8Vr4og9T2MOKDhG7F7SBIZjkLimnTMIcPQ8Z12vkfNbvq8jTg1CEkJ8LxDPjC1HFjOARtKUJck9d/a6g2U8Osaj8pHj2NzSdf8Ai9Rv6NGDK2hT0auJ9qDMadr52q46tuBH3X5xKBwS2oRcuvq//gHJXoKazzQbJjC15xTHiNkGtm0B2lmyatJ+xXZu+AwfnMm88+JCT8kE5cUc99eqzZKTRqIqcADWthfBtaxxSw17hG9HdQ3lxr63lxyQWj467Bcj1qqIQzw== 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=liWm75Z0i6PpZUdkpkbQYOaVVs8mZASTyBjMW9Pf+S0=; b=dAIiuVGyXH2518x6dRbaIJ8GYJu2GN9MLK7kGt3Mfc3n7WIHjxShCZ5i6WKXTCslohONNBgM4DoRNe1txr90SkkcAV6a5Y7DtxqQcl6plpOb62H/OZN59fibtuq+p88TuHWyXEy8MSwdc8Ne3jZiJyztCiAzlaWCJHt+POlZLaE= Received: from PH8PR20CA0010.namprd20.prod.outlook.com (2603:10b6:510:23c::7) by PH8PR12MB6890.namprd12.prod.outlook.com (2603:10b6:510:1ca::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:52:53 +0000 Received: from SN1PEPF000397AE.namprd05.prod.outlook.com (2603:10b6:510:23c:cafe::46) by PH8PR20CA0010.outlook.office365.com (2603:10b6:510:23c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.27 via Frontend Transport; Tue, 11 Jun 2024 08:52: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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF000397AE.mail.protection.outlook.com (10.167.248.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:52:53 +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.39; Tue, 11 Jun 2024 03:52:49 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 03/10] cpufreq: amd-pstate: show CPPC debug message if CPPC is not supported Date: Tue, 11 Jun 2024 16:52:19 +0800 Message-ID: <41d5573ed19525f95d79d2af46bd1cce5779d6a1.1718095377.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: SN1PEPF000397AE:EE_|PH8PR12MB6890:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e85a1fc-17de-47d3-7d80-08dc89f3e173 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|36860700004|376005; X-Microsoft-Antispam-Message-Info: p7qHh5u2VnLveiIFQN9NOHHSRIJSq5ztZ/4Nu0K5SqBzBwG9DSJjnDE8y7J+NrqjkzunLtNfMvlwaRWyWIfVF41ru2POkJfcmC0jwjiJ/x7ByT9rz6F1SdEkLRb+kiEOnL9B/+VVhmeA5hTU/beOz41i1CLIArqSEYW78qGBqsULGPo21l8Cu21Wn57eh9VFvi3H1Fpb5dcUPi3LvT8vHGNOfBdgj7rUwcAnRygXG30UkfxfWMOlx+yc+q3tUQ6PVLMmzv40+Y50Q/9q5BOpzqunNimjq69QsAkJrRicB36urxgShkyvH0rC+dWy5Wi8/orJ7+jAbxJka7BUCy6zlqqRJ3+qcx2aa/Q+llLVdoE47OyT+3xKMb6zTy6Nf5u1O8eq3X8A8kg490EgZFiTiSkveW++25mdxV2wODjUSHAbDu5T+0IlL4xYHsKtNzhSXk5327e87FRsLYk1MKR+0JgqHrCl81vJcOysLMcEZ7dpLH13J2IPYjeKa2kFvSAAZaZ7W/ah3yE6IysUOFnaHCKb2dx7Op6/BRg7wzVV/jgpB2z46875hPYRQYNYTn75pjpOKO5KbF+s1+Dt8PXIl+zmj64TvF+XjRsSoYU0Ci8nGmuJxDnUfj5/bbmqact32mbFCveM2iYx7zdugjlSW/8LAZaedTsD5JDSXo5218rXDjjMFxEIKCmEooWbawJ1IQtRCs9p2vDboeJuDrTX/5RpXeYCX/sswwarzP1waLin/oUz2jFaDHfXhKhk9n0IyoTGP6yNruEhPVTVqk3EOf4VR/0NjLV4Fyke9ygiTnzYIfbwQZYAO9ZdhxCh1pYqY0Z/CB4zvzSv8IqR0orbijJB+lQLtuGSuBxz8X7BlV3at8kqK+F2mL2YYpwFAYL0jseFki7h5eSbJoar2QY5IK+Ic1E0mXLpeLZSmW2gEs6coeBbg0zAN9zNmuxwNzIOG0StXrYAnGhb5tZGr1FouWPBaTQH9im4ocwupAP/sw2O2gnYQGEUvL+W+LYAyn/HMgJbrIgVE0CSy1gHn8vgSPP3P7O51hjIW2QgToXd3IarM3J0AJyya2qS3Y8+OmUQJ6ykFXbYBH3OkZn6ugETOrUVbR+RYxfVflQahJ7n2l7npwlKZKittSku4tdWGDdQsx9EV0N2f/ix0+uLAXPuZ8PIc329QQd4v7WXz8OZmkMLE5n2vZimoNjT2fH/vyC3eZkF30hJd0B2HS7iEqNhQWUacwkUG1wTDvYZy97qMDecaeQrd6JH2Mu0ZvKfMGxUqcxJ5V5J+0zPL1kbrdauF5vh08gCbMVj5ab7glQBq3vNwn/N12xFBbS2DzHuw+oZiP39DbDOC+M3gQUCOLUAVdPJ499SGqWBf4lhT859gyg= 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)(82310400017)(1800799015)(36860700004)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:52:53.1330 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e85a1fc-17de-47d3-7d80-08dc89f3e173 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: SN1PEPF000397AE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6890 Add CPU ID checking in case the driver attempt to load on systems where CPPC functionality is unavailable. And the warning message will not be shown if CPPC is not supported. It will also print debug message if the CPU has no CPPC support that helps to debug the driver loading failure issue. Reported-by: Paul Menzel Closes: https://lore.kernel.org/linux-pm/CYYPR12MB8655D32EA18574C9497E888A9C122@CYYPR12MB8655.namprd12.prod.outlook.com/T/#t Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Acked-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 36b1964ca8d3..f166b3b94091 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1740,6 +1740,20 @@ static int __init amd_pstate_set_driver(int mode_idx) return -EINVAL; } +/** + * CPPC function is not supported for family ID 17H with model_ID ranging from 0x10 to 0x2F. + * show the debug message that helps to check if the CPU has CPPC support for loading issue. + */ +static bool amd_cppc_supported(void) +{ + if ((boot_cpu_data.x86 == 0x17) && (boot_cpu_data.x86_model < 0x30)) { + pr_debug_once("CPPC feature is not supported by the processor\n"); + return false; + } + + return true; +} + static int __init amd_pstate_init(void) { struct device *dev_root; @@ -1748,6 +1762,11 @@ static int __init amd_pstate_init(void) if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) return -ENODEV; + /* show debug message only if CPPC is not supported */ + if (!amd_cppc_supported()) + return -EOPNOTSUPP; + + /* show warning message when BIOS broken or ACPI disabled */ if (!acpi_cpc_valid()) { pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); return -ENODEV; From patchwork Tue Jun 11 08:52:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693300 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2060.outbound.protection.outlook.com [40.107.96.60]) (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 040FB17622A; Tue, 11 Jun 2024 08:52:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095981; cv=fail; b=g7vdK3/yVcvtKmgjAmqTzWqRGYVOdmEWBkSQYbFjRJG0uNuvi1YzE81MM8i1RgmgsMl8VDyV3pB0t31DVboYCVolFg0Lrd1FGwQZDy23fG4IX3bO7yByTh7CrQGDEflG4YwoH6bIMPB/ejwQfTNLZjoxCRBGUB086E1TiqLDBi4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095981; c=relaxed/simple; bh=fHRmpdbfZx3GtxKeesg43a9Dqy1v9IsR3A+IIikIXHk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tvssgbB0CJs7YA4qZWfeE5/TubZdpG6mLE+TIl4q/r6fOSh/exhEYswPd5+WW9SngfpKyOLu6kptAkr+7msvwkUNaeH4LRWWe8J7QhCscxSm4PHFw2kRZppeYF9i6uVNHcT3zju9zNen1RrDjRN+X5XzNn2YZWARIf1AupGdIy8= 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=eacUZJdr; arc=fail smtp.client-ip=40.107.96.60 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="eacUZJdr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dHMv1DOFN1IPKro7xt1p3IsLZVWjKj8OMULHObFBB1t3rW2EcKwqDKKXg0kVJcTUWIaGz4BcfU/2AG7u8p7HECs9+H5NuV2naO+Oat7+YndWFghPmpt+TQFuJB+FqRKSobrNV4S17Meqh6FBKPQnZpeTRBCokiDc9d7YWPtlN7ri6Y88db7XXKFO9RZ+BuGlff8lezZmtlOj/JsKN1r22nZkYYRMtvGsy+kUN8SMtRHE4zE1OTsvXQ6PQwDhOnmGr/dKi/990zeLCsfHdgKGdr/FkkHF04ctQSELJK7Zo4qfT+ovZymt7vcJnj5FTF+JQERGekHjyJdUKLKFXxsstA== 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=LbZwkCgd4HQoScuCxe6RAJY04OogKDrjFiUfu90h2Js=; b=kXCpzG+3G1zSpogqWyj9XHpK9TxQRLxZ8dHyglTg1n0MqMUQdAu4n3+1gNmtlSwpR6F28E4eqKEqr4ooU4dJbv/g3TIKf84AfwbPbxSDFb7HnyLbxtejP2BNU5u2SCsHR+QqGL0mpFHnpOQUYP3+wSA8mFVKhkBtYEp2Io9YeTnyNYnIwgl2t8fGbpdgZtFF+vsyyM46vqVJNMB8+tE3yGMSMUODACxDc4VkQFxOD2LT44L63NbxpL95MomWEYRboFa8xqZLjLSad1Rc2rGVGjWCkJjDYXvQxrl5IfLUXqaF9QrQVuGXcYKLSurgh1txgleZWPe3djCsky+76FHKPw== 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=LbZwkCgd4HQoScuCxe6RAJY04OogKDrjFiUfu90h2Js=; b=eacUZJdrPpAyeSnpmkCDzHdHXEc+ytyEpRbYheRaZA/WiNQ6ezzKhr2JtKc1R1cvHk657rtNCKkAIywqkK2wyP4iCcTuOgy7FxtXFpyfBhioPQuLgWo2toEypi+xnYbA9TcqDPXVxvJdWfX3a2Bx4EGiDWhLGDhon+W6G6cKQns= Received: from PH7P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:32a::10) by IA1PR12MB6282.namprd12.prod.outlook.com (2603:10b6:208:3e6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:52:57 +0000 Received: from SN1PEPF000397B3.namprd05.prod.outlook.com (2603:10b6:510:32a:cafe::9c) by PH7P221CA0007.outlook.office365.com (2603:10b6:510:32a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.25 via Frontend Transport; Tue, 11 Jun 2024 08:52:57 +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 SN1PEPF000397B3.mail.protection.outlook.com (10.167.248.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:52:56 +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.39; Tue, 11 Jun 2024 03:52:52 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 04/10] cpufreq: amd-pstate: add debug message while CPPC is supported and disabled by SBIOS Date: Tue, 11 Jun 2024 16:52:20 +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: SN1PEPF000397B3:EE_|IA1PR12MB6282:EE_ X-MS-Office365-Filtering-Correlation-Id: 87bcdd20-52b2-4cc6-5cff-08dc89f3e383 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: PC870c5dv67h06oSjYR1JC7/7sZsOYV8O3/2ju36OvROAJn3ROEeWHGeswUP9yqeqLroNpni36dOTO7qu0TDLe8P7J/rrrXYkZIrQrENpP27us5gnS5jcwmXvpGEL4q8+TOzKDJ99HrUuEBgv057JWOjJf53TJEMjiG4c/oFF4qLs+Y/Pb6giatlAY1LzgfKLM/64LQurYBEM0lJka7Wwp0OvRifwyqvdPBAoTApwSKLy2i99ftZu/TUDjUyHb1W0cFzGg9dEa3D8iaoBbYj/Rk9bCJQWcmg1wyrH8ewbQHFP4ymbu8dnz9r988/mnl1MlBKKI16xb9BoFJtZ6EoNO8ObEbG8ILEqxfceSCBN0u5xdSLGQ+oAfXUnAk2L2tRnN3i0s/aSRQ0C+dgZuLeCCmcUFF85RZ7SOxrAG+V2KPYZcga3CXr92N8yRb6bo3Q8ZLOadcIFaJEYr75oWQ/4tU0ahiCU04227zhJy8TJ6qa17lu6WvLq9KFCIFYKobH4zfsdsaml28zokkvF6Y2kTYfDkZJXpOtXzDptZ8njOz6/HtYnwOdGsep4hqgKCVTM8lovEphsonAsHoIPyW7Hri8/WFZSqQVLtDnm1mRXYMhC9/eOF5Bs2e5zkS2Mk5FA6fPgpa1bwrFrbLGRVPLelCY89zZ2BrbrbeMNKp9dMaVtXw+py++2ZFvX0jUu7vRwu/um3ezmAjFNxHCfATgxaGexIpu1lwyXZUk64AmWvFMLbBfzv1FurbU6gSVhaF2we7JY2l9+txWWw1G11yNxtdkVpIM27zskiJXySlXR0DQFabti5HkPk3/5kYWIm+KfJMLtlgkpOlhfRLUNFsWw8VYWSr12okWRizzXIFzbOqhTUhkspOOEmTNkgjWfyFl2bPpeHYXwhXPMWig4vlHuXBrxqWeUlt4cDDi9dsQGowuh9uFgp2K4PxGZ4v6hb/mTj//c34VrTCntCe1495jpEMAyQQA04FbLLJQS3+q9KCRh7CG4EFDmV7rEyLIz98ZS9L2Z7s0XXN+/Yr+t9IRIo4TFPmkWzRSNZIT3IfpHJ0H2L76RIKqLd/8L7zLtauTQ11c+7DFOqJEQEXpHpNrdEHai33NqAyDrUoLyjhc79YN9QKG7ejqh4ZLw5m8CN+5Kjwo+0s6FlHz1iMFcKCTJh1tOgFeQmq4B8ISRHb4PvvQOtoNEbwbO3FH1Rn4vpDrhL96AdwCAsHynlVZvBcUfLpSIxEu36oDEmAuyDzt/xSvotz291NVsDttVR3lEObafZHq09wdA3FVes/GPcjCcHRJ2izc98Cmga8yMwjIXbIiN6IDHaX2ZdPUPMjaC9R4hDUuMHBsaEhvH3r4Y4hk9e+i7OjfDsgY7SHooPb2ick= 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)(376005)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:52:56.6081 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87bcdd20-52b2-4cc6-5cff-08dc89f3e383 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: SN1PEPF000397B3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6282 If CPPC feature is supported by the CPU however the CPUID flag bit is not set by SBIOS, the `amd_pstate` will be failed to load while system booting. So adding one more debug message to inform user to check the SBIOS setting, The change also can help maintainers to debug why amd_pstate driver failed to be loaded at system booting if the processor support CPPC. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218686 Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy --- drivers/cpufreq/amd-pstate.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index f166b3b94091..6b9fc24001f2 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1746,11 +1746,36 @@ static int __init amd_pstate_set_driver(int mode_idx) */ static bool amd_cppc_supported(void) { + struct cpuinfo_x86 *c = &cpu_data(0); + if ((boot_cpu_data.x86 == 0x17) && (boot_cpu_data.x86_model < 0x30)) { pr_debug_once("CPPC feature is not supported by the processor\n"); return false; } + /* + * If the CPPC feature is disabled in the BIOS for processors that support MSR-based CPPC, + * the AMD Pstate driver may not function correctly. + * Check the CPPC flag and display a warning message if the platform supports CPPC. + * Notice: below checking code will not abort the driver registeration process. + */ + if (!cpu_feature_enabled(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_ZEN1) || cpu_feature_enabled(X86_FEATURE_ZEN2)) { + if (c->x86_model > 0x60 && c->x86_model < 0xaf) + goto warn; + } else if (cpu_feature_enabled(X86_FEATURE_ZEN3) || cpu_feature_enabled(X86_FEATURE_ZEN4)) { + if ((c->x86_model > 0x10 && c->x86_model < 0x1F) || (c->x86_model > 0x40 && c->x86_model < 0xaf)) + goto warn; + } else if (cpu_feature_enabled(X86_FEATURE_ZEN5)) { + goto warn; + } + } + + return true; + +warn: + pr_debug_once("The CPPC feature is supported but currently disabled by the BIOS.\n" + "Please enable it if your BIOS has the CPPC option.\n"); return true; } From patchwork Tue Jun 11 08:52:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693301 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.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 15D28178394; Tue, 11 Jun 2024 08:53:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095985; cv=fail; b=S0NyKmdcv/Hd7M1ha3jHrezzCKy2khwcF2YLGSUqLMNg0OhjXDnhCE/qWvMFgkS6WNuEHvDBx731dBtiHx7TXmaM1o9Kq0gJL9WeyjbghKpcZTvc7giO1AeLtJerWd4LZ7lnhEa016+LBmsABQvQgjKrx63eNUtokURez/xRk00= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095985; c=relaxed/simple; bh=cOXMENuVdaADztOx21wcB1GoqOtFGByhFz28UNsMN+E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S/5gD+qz0JzJ12wPRJfPC8q8ggIzeVLqz7pJVPPIk6gnMvFAwK3FVevyKBsGZLe4dN67qW9eTQh0B45+w0hNeT3F10gS8t1NtmmtqD5F2QvWApULXtHyUsMqoeIy+9T1VtYkC1OAuOqlI1TPVQk6RWpafJvdvCb2s5uLNMKZSFo= 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=oVMDevH9; arc=fail smtp.client-ip=40.107.92.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="oVMDevH9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KVwhVnRYYYtdJkSNhRnUEwR5sFH9Q7XfzKgSWOKmP4XILXDH7JLkyIbef4DLneSQGIleXHgMf3p/d2HknHZJwKUAJjTzT8qaWFoX9BUuKp8LvqRBscof8l4VWmOloF9gAYJU5MrhA53+tKmfpESL2DpT46Z6EYgEOn/ZDEqjqEi600UsR2brAGLZxggqw+hBn/R/6Q0JETQm0jljYZz9Z+MXFoWvk2bVKBo2yToOtpexdfaI/Gu90uB2ba9IDhwEELaYzaCJaXsZHzXG8rv9CueCW2RclQI2WDZo+burhfLyoHogX2QlztfxgjcryxSOGbl/FL5VqPhAh8yEKFuRnQ== 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=EOf+kiEqDJ4292Jkplvh6XWxS5iJPzeS85DFnIYQ+ac=; b=KG1kSSk2mt4vdaobj+ERQsQJL3/C8lZLbYntcge3u5Ic4dWDpJ/W2X19vDntJauLrtOmTOTL/Pp3/62ceycXgHX5FjSYEXoPfS+nYuU6eZ7N6jkCY8REQmOkDBZJlXajFM84IwmtSJ2n7LukoxAH4GFPeihRBPkF3n03lRDkH19fZ7RKit8IoK2h6y9XZ4fYVdJPTSQG5jul/ard6PaqxDSKFDSRIs3/tAdmNvCSeoKv+pj9OxnGP6huzPHOVjSs/5LbdllMwM6+Pt7FGrk/EaNhCW1oI+4yiRnkHAqPOrJJZXgQtuGvzjtuwoP9wEeYQLLUfAI/NSDl2J87xa0uqA== 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=EOf+kiEqDJ4292Jkplvh6XWxS5iJPzeS85DFnIYQ+ac=; b=oVMDevH9Z/HomUgkyY1jO5JpyFlZLsBjsy0ESvz4qkR3+Cqh8k+k9WnKQ/TTiaLvTNFQ4BmDU+QEoJcZr9jcVHeHTKDPmWrVJAKzMB/cSsvQ1eHXGhyUGfeTOdXkhzWbqp5qsJ5TS3jQY38t77q7nsCnx+YBSmOiN309yC+LEF4= Received: from SA1P222CA0172.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::28) by DM6PR12MB4402.namprd12.prod.outlook.com (2603:10b6:5:2a5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:53:00 +0000 Received: from SN1PEPF000397B5.namprd05.prod.outlook.com (2603:10b6:806:3c3:cafe::12) by SA1P222CA0172.outlook.office365.com (2603:10b6:806:3c3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.25 via Frontend Transport; Tue, 11 Jun 2024 08:53:00 +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 SN1PEPF000397B5.mail.protection.outlook.com (10.167.248.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:53:00 +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.39; Tue, 11 Jun 2024 03:52:56 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 05/10] Documentation: PM: amd-pstate: add debugging section for driver loading failure Date: Tue, 11 Jun 2024 16:52:21 +0800 Message-ID: <18032dece7cb9089bf82f2b37c7ab781148d70be.1718095377.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: SN1PEPF000397B5:EE_|DM6PR12MB4402:EE_ X-MS-Office365-Filtering-Correlation-Id: e0b88511-06f9-4297-97ee-08dc89f3e58d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|82310400017|376005|1800799015; X-Microsoft-Antispam-Message-Info: 5RmWTZucnSnWeoF+EUZa87wtjBv6MW0M8CqJw3UBCq4HOJzu6IzV8xek0zrf/gDViOICeYKNM+I0E3F9FGFAppHKZUOKVabbcBbeCZlq0aDGcWTqvbXzU/Bs/Mx/S3+GrLlsKA7OZCahCHNeJX62brSDkELM6QGB5jiG4DlueFBFZalPJTiBcoMbksIfPB/TWGDop/zO6hVbHDqZbAHJS9oBHOfkuL5vHNOG76rsvyu/3O/325Jad+EL4w36CY5Q/nkN2qLzcQ87iaeBrQVbn+0Zf/t8dXk220BG/bdrW3/pyNL+VWYV+SP3ATB1q9SZ2dVAT9/Li1uI+WF0X+BsDRZV3tvnAbS+YbkDRn9/zJ6JDfvuyeHYBYPwpY+F8XwYdat8GImNjcdxohm9NJektVDywHCiQ2ovJo0h3yZGQnMvMDAGkDc7Ym2OZUjOTaM+wPxIwr195cbZthCQsDME5OlyvxNQlVwqhzowqC+9chktt+/KFU2FA9btQW+gSoJOTRHJGAhGpKw3vehsi9SWnbwR9Q655EQgDwDNtOJKuA+m4t2PLr49k7IlnpF4hcrGiZnqw5MywzRHoQ0DPQsRL8xxUtPZb2YtOZY/+l6tjaRzNTeWpAW9Yhe9McX1D5UkJ+QKOcdl7XaB4MZWHdsiUZN+VqSLQ8HJrAjhSQWxTuVPTJ6uszONFLHIE9SxpZYkCWaqDM3pcG751W2q3f2Z6LkObZnzuHThDKKT1bkZD51fPuuTX8uJz1wv3oMAUX4bSnsFk5xVr/uiLAkg8Lt3Wk80NPWXNmJYoXQVFavvttR/JUjnSxrorsSWp3cm3PF+5gLnGJk1eldyPC0bKLVpLzneeMfNttrvvt7A85u8jRpFUSi5mYWDQ5LQ2bW9KVOZ3TEHSzh4RV/DfubWiD3S6uimFj+bEmGLuZ5Emkpo+IjtUn8LskCOoxsUzqzpTv+vJ+4RHoS3cgXjzB00EteVNXcwzQyfYtIrU9TN8hCitV4Vy9mvlAXISZiaTKp6vmOzKI0N++JP1Tb0NyPwp9797MDD0/Ld3LUtCd1Lx51d2yJvWOKpMoLL+uXX6UmSLm2uGRoAeIb/9ECyovpqyD0vKcOy4cl2+JlmjolKxc6oZlvaRHj8+AgfDgODObhLEoC/3T9zh17puk5uruftwsbwQrQoZVpa/wjpT0cg2NJ5mHYHbZBJ/HzH54Sz1gLKRf9crGWZOimkTJdcxmipZKYdt91KO88q8TyAgpDMr9RLXE5/+0V9a8Q3KUkhivqojTPPBWjTh9vCa0ZH4x0sd2qvW1wUP3QHir7iMJF2YcZs3COHbTUxb12Khb6cm4u8WaNsbQv0yLSnYzGO6IjXjKjlUYl/4XMTvws+SvSHw2qZrAQSjA8oWbfznjtrIJ6l/ZsES6qnyfLoK3TIlZijV8HnwA== 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)(82310400017)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:53:00.0306 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0b88511-06f9-4297-97ee-08dc89f3e58d 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: SN1PEPF000397B5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4402 To address issues with the loading of the amd-pstate driver on certain platforms, It needs to enable dynamic debugging to capture debug messages during the driver loading process. By adding "amd_pstate.dyndbg=+p cppc_acpi.dyndbg=+p loglevel=4 debug amd_pstate=active" to the kernel command line, driver debug logging is enabled. Signed-off-by: Perry Yuan --- Documentation/admin-guide/pm/amd-pstate.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1e0d101b020a..de83e742738e 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -472,6 +472,19 @@ operations for the new ``amd-pstate`` module with this tool. :: Diagnostics and Tuning ======================= +Debugging AMD P-State Driver Loading Issues +------------------------------------------ + +On some platforms, there may be issues with the loading of the amd-pstate driver. +To capture debug messages for issue analysis, users can add below parameter, +"amd_pstate.dyndbg=+p cppc_acpi.dyndbg=+p debug" +to the kernel command line. This will enable dynamic debugging and allow better +analysis and troubleshooting of the driver loading process. + +Please note that adding this parameter will only enable debug logging during the +driver loading phase and may affect system behavior. Use this option with caution +and only for debugging purposes. + Trace Events -------------- From patchwork Tue Jun 11 08:52:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693302 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.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 0CF1D176247; Tue, 11 Jun 2024 08:53:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095988; cv=fail; b=SlxAcV5Hi+dwnBsoR5LZQ+Wvj0azY5SKdw5n610r41ipbekafohsf4lLRcnKDCCe75EozUdza1ZfzYlLxpql0YEmuQvjkqPZ94ms2WSt3E9lgMHPugTSqkzDMkZR6wMj/O/JWAOyK3RrdlQH6DYmWkgoQHnz9sLybQlJRKPKZ84= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095988; c=relaxed/simple; bh=Iu2aHbPVK8RZOypYFtPNDVV0ZJvURXShuUm3UYraMjw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TCLXl+9R4gOym1ix53c0/MzWsFV8u/0vbyPzhwtdQ8Rr0/9rj1kMWFME5cEujZDHKf+EQ7F1aXGVaZ65a1RPeLgEprBuNpXCBm8pItw9aCIjrF2a/oFV3Ct91uA7V/6ZdHnZL+ZYvvpcT1a5MrVIXYh6Kg9LgMeHLmiuLtlE9wU= 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=UEpYQgRl; arc=fail smtp.client-ip=40.107.223.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="UEpYQgRl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ok9h261/DNSpA9/XCXleX9iazDxyPg3C8mEVo9ORDQmF+vQhxNTE47/eSp96ELwpyiJG+j/5hVuaEAq4rDMa4cBwXYPRSVRzVhm9mOChY6fSjD/eH79rDYphOEZU7IAGkupBEq4Lyt6xpgEeGEJ35DpCD9Mt2XWqsXUsnIaKSfKohGbp8ZDoRKx3kUaqzU5wPLdZNDZkwY5fYBSY8BeSGdB2dRQVYYgo5Ag3hO/TlBlvPVXw8Dwx5dcMzzZAcif8KfW+YJkir9RtT+U2nacZ/CnG825aQyK9dq5BZHMCQPXBVRGP6wEzsI6OvYetkfV790NYaXaUvblVEofn3ofrtA== 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=9vrcY8j2MM3yB5PQpMNIyq8UzZcb4H4sVlIytplIX4Q=; b=Bd3ycNw5nIFbZ+ORyQYNol01HyFHOKBRj/Ge5DhsvAfLaWhLf0op6pEOAEKH5lkVRK+csAi8ZqXnoBRICFckJBajCfnEK9s+0vt20OrMIhpfp0IXK/3JgB4VBhV7uvw7G/Sm7BkZ3rMHY7qInMloUdU4mOt1rQaY5CfB02V9Xcqior8MlR98uQPN27cKjDuiFpVC4CAk+Mn+UG/Cr1p9bAtqWn4nJDjR2yyIDdb7uz3fR4qfl31fLzguQTPUx+62eFajAAmFOVinbtKtdrZIywwXh7bluVA1VC+y+hrtlNNQa6oK4I1FvCPz+IFYWfIn/x/FfLgk3Aodb25S+P4UHQ== 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=9vrcY8j2MM3yB5PQpMNIyq8UzZcb4H4sVlIytplIX4Q=; b=UEpYQgRlQZrIA0w/yIPG83Gjs7zMwsdIgJ7cTE3v7HmMxj0CNT3qpq3wpJqrOefzfzVPJXjC4NdITf4E5jjOmHDTLl1Xtb0dytnnWYITcOMi0z92aNuK8aiMs0tzKZvxDcHH07fBbUTDoHiLtu+zRD7CUBh23j30HWSepOuwibU= Received: from PH7P220CA0043.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::12) by SJ0PR12MB6829.namprd12.prod.outlook.com (2603:10b6:a03:47b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:53:04 +0000 Received: from SN1PEPF000397B1.namprd05.prod.outlook.com (2603:10b6:510:32b:cafe::5c) by PH7P220CA0043.outlook.office365.com (2603:10b6:510:32b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.19 via Frontend Transport; Tue, 11 Jun 2024 08:53:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF000397B1.mail.protection.outlook.com (10.167.248.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:53:03 +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.39; Tue, 11 Jun 2024 03:52:59 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 06/10] Documentation: PM: amd-pstate: add guided mode to the Operation mode Date: Tue, 11 Jun 2024 16:52:22 +0800 Message-ID: <6e960ad57d31d379f8b0b631581b078fb9b272ea.1718095377.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: SN1PEPF000397B1:EE_|SJ0PR12MB6829:EE_ X-MS-Office365-Filtering-Correlation-Id: 609545e7-b345-4dfd-4312-08dc89f3e7a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|36860700004|376005|1800799015; X-Microsoft-Antispam-Message-Info: uavuYq4jaUEth6Z/eeQWX83HuKdTJyTRCTxdHOsXEJEU8xY/7Jm2idZnwAbGQIiNQkPPPawmM/Ybr9GkNSkmKNvBkaKpnB+aiC6m4Ys8NoTRztwydgr/7B/501B5NyIISV2RLmySuwWIOBNldpGRd43juspPbA63utgWVcdmHVN/Oh3WBzmbTW4Z5aE+H3uBgSjR+tXNZhZn9jj5NCd04Qp819bx5xl6K3DB1R5acVXh+ykTjJc5NTwIbNnk7LJLjs6qoFUtv/N/nxu/6TWGLFhgJtcr99vXGGDI7uzEY1auUI5wd8gCo8O0SYVUcynDbY/AmrbhbLxrdbYq8lLwJkfbgkUSYTzygLAUKylWgP5b0GG/MmY0eZqCIEZWqf0LLtaMsjWm5roRKmADnrYJY7aPpc6rtluWxEx/uayazgWKIVkVv8UN2dlCBcyxVi1ciYFNTRULT5D/L6QdapTwSt9zEGWT75EvL1Ojq2vy7xQWmLNYrpjruq6672aXQ9c1WBCVIadScHNKI0ae+y9IxF/MCG2RcdwuKRXaWms6q2QvT9wImu55HIlQ43C+ztYVdFL1cAOLiHDlB5Ui91bfgW/huPELShHI2VvWiv7/LwB3vyKDvOnqbyg9FoXQ2hO6ovzcnG64969z52a/RgP726Pcgdk80uN6nMuNGlzmjou7kAHUP6HNDuOchN5It7mHrq00v8o2kKmH6qa1Yj+A3p05iZMGQypASXr+/GkceaBzIbXTNkTtWBYuy3EvfG/4vFUZGO1RhO4BT43c+khsVvWuuw91niZxHIASqN2aq8/o+0p+SEjU11nB18x6DUM0WkN3aWwiTVbK+GKW9YQPgrrX/ALlRnqN3VKV2LpDMfwLBWXhhHX/sJUKDxw/mjPovFA5vm9F9ZWjW4jV9UMTlVZp4ZErjdkclK+NmgD4PHn3TMFk2foCywsSbNJEYer9fdet3CZLy3zGohe66PGhIYL0VbOy5yzttvKfBWE4LJnXcriCyMEb+Le/97TcpyVBySy2dVsPjz0/mJX8S+zfcAVJPItfm8oBAS/so9Y8rou16w6MSyGgnvsnp2yc8XFqDXHRvhUObzUwvsdg1sDH8QfoWDZDiRwKsS1nWHZCPR/SbyJ06e2wkY/0CrF8rv2ydsQDq9s/wpwg5ldUHVhOf4C4OLBgZYKidOnJ6a3RKORWJxF8bOHlYCW518mibUBdKwXkPmzTa2qSKvfiYjpCbVb0XiEo/U4L/7mQEOKQ8MeHXZ+8Uzqnee6o0mU7+q3qkx1q3xtItk1hu8J6HTAe4g1YfvsKtVT/da+BmFWHSyVt1JrIEWAfici/aLjxcBfEaJiliubItXA6yMHTbiAGFSLOSOqQRmH5YsYtEPs3GzG0fMB/XNW+An7MLUuCsUR+IAzwSu5qcT/oOyplTAzrMQ== 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)(82310400017)(36860700004)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:53:03.4993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 609545e7-b345-4dfd-4312-08dc89f3e7a1 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: SN1PEPF000397B1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6829 the guided mode is also supported, so the operation mode should include that mode as well. Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy --- Documentation/admin-guide/pm/amd-pstate.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index de83e742738e..7eb35ad21c7d 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -406,7 +406,7 @@ control its functionality at the system level. They are located in the ``/sys/devices/system/cpu/amd_pstate/`` directory and affect all CPUs. ``status`` - Operation mode of the driver: "active", "passive" or "disable". + Operation mode of the driver: "active", "passive", "guided" or "disable". "active" The driver is functional and in the ``active mode`` From patchwork Tue Jun 11 08:52:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693303 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) (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 7294117B411; Tue, 11 Jun 2024 08:53:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095993; cv=fail; b=AFA5mM/txuF67NB/2NjmqTWwkU97fqSE/TAdyQsbz0DKA3KRG39gOBs4C086uP84VbWHIBzupdAPatlgZXdLmZfODgUNV6+tjOjTJqpDsrYW1dz6Nr2jAW+053r8dayqviuxMJ6CYjI458nLNTFGU5Lay8KfRGKs2oR1IM9LOD8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095993; c=relaxed/simple; bh=dq7AmCvLIboyMl3++ORrMtduRucr1CRl1K6MuyX+JCo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bor8sOCcLnzsH2pJDCuDi3cjfHClOjOLlRB3qFdhpVZSPC9BzCzRHK9JD3sIgyng4LwBqwMFlpWZSesY+51AaQpcRFFQqVOYUCwBjfUhdhd8iZonHQtC3qo+d6azpblStqzvfyPG70AGagq5VbK7IOtC07ywVtZY/+9bFB698tI= 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=HXYHvEhp; arc=fail smtp.client-ip=40.107.244.59 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="HXYHvEhp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJZ3e8aLxhG5WAXPfNW1KIpbCkEtJKyAjugcaqAbnfaHNECBawxxRwnYfL0KtzgtttmJyxKbxPXah62u+AxKIbTH5mtjOcoORGq4k3CNXvkTHHotQKYvxpaGbpxK2x6vTSxywPZWyOigpUWr1cSJwnC0csE/nno+kK6UbWCYotGfYrifIzsU3vePemr6K382kMA7eBxhJQASHsKOAubU21xq0+LFfln7+ZwEdE+1T531BzAuH+YEO3AKGOlDXRgsppvLcF7tnaFdYMxCzoSMw0ojYknBIHjLdfwP59sqaKTlFkNdV2yS/MleemTHbNs1mM8Y+F8AW63tADlNNtToAg== 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=/hBpYrUokvCbHTp5B5iV75sgdkUhRth3XxIbjMSNxbA=; b=dBWOm3cZ+unI1cbovMXjapEdZmbQs11wxx7rqqtF01xjUCCP2V+UNhjpr6bzyunfL4vfHDclJ8Cg4t6e/J4IT7Bb+KyRLyucfEB2LgxoMu0thh7blREHBNVuJLWSrPRmKeBZTMjyhbI9A87oxN1njrEIYXA6zF7bg8KQDgfRKhMu9xkTPdoGjGRsPQn7JQVzIri6MU8Px0ynNIihGMdAwoHAjlbZ4tzB89O/Gun+xeKS6TR9IxfRfXnZbo9BZLr6+goA2dputg/4GR11m4A1yUyO0WHQrBlzgm977gslxl5vmvZONGvkZkKJHOR8ToQdEtmI5RTz6xDjJCW9RPV7ow== 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=/hBpYrUokvCbHTp5B5iV75sgdkUhRth3XxIbjMSNxbA=; b=HXYHvEhpvRHaVVDrdQjocBV/4rZ3OexFnnv+k5KtWaWWjbWOUah/CU0eZV0BZNtvtNJYZeKCXEzk7ZEPoW8YnhEc9DjSeyHr3tWDDyZOVSOUtjX5mO4CSWVD9sJZmDNBQS7X5mZ/0e8v7G5ISjE5jvY2iIID1sCXo4C9Ip2R794= Received: from SA0PR13CA0002.namprd13.prod.outlook.com (2603:10b6:806:130::7) by IA0PR12MB7505.namprd12.prod.outlook.com (2603:10b6:208:443::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Tue, 11 Jun 2024 08:53:07 +0000 Received: from SN1PEPF000397B4.namprd05.prod.outlook.com (2603:10b6:806:130:cafe::78) by SA0PR13CA0002.outlook.office365.com (2603:10b6:806:130::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.17 via Frontend Transport; Tue, 11 Jun 2024 08:53:07 +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 SN1PEPF000397B4.mail.protection.outlook.com (10.167.248.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:53:06 +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.39; Tue, 11 Jun 2024 03:53:03 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 07/10] cpufreq: amd-pstate: switch boot_cpu_has() to cpu_feature_enabled() Date: Tue, 11 Jun 2024 16:52:23 +0800 Message-ID: <414f279ebed3b5862b28fe42e1e15c8325c47cbd.1718095377.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: SN1PEPF000397B4:EE_|IA0PR12MB7505:EE_ X-MS-Office365-Filtering-Correlation-Id: 5267730c-44dc-4162-1f68-08dc89f3e9b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|1800799015|376005|82310400017; X-Microsoft-Antispam-Message-Info: BGFZhcnTdw4MGa3NUJj6H2YfmK81BY0h87WaVFiJD33xGwvYSQr0tgycwbPjMBDCjN6nAWVy1dieCHKR3wW55Aoh9fkfaxmIGZsJHt6rI0FfEVH3U/NXPsMFhEtwCqyOX0dPo1v2axo902Ukazf/CkGZCcAGXyGXP9FBLw/5e1Ha6znKF89MZxOm3uwaCt/P641jo48Gr/cHjbcxGG3QRQmGHJNxzMg3aTnk8cnbV37APFvEssfT8izSe0eHd/z44KP8ldbbYFndSybJRk+GxJXjwVmqpDUANPJQIUPqq2X4ZEzueiSll43HtYyC9G3N5I5+MkvqaFjpHuF2OPYI3rIRdCE4+xtope3j9Yvj4hLYLgEgYJsqvtPvrlCA2ww0wP9WUtnEV21m8uTn9Z1m0SaHIO4IoEdpWof+MMN55nnAWA4X5CkbHWkWCsssUKFIVfnd63ife/EIHKYs6zzZ7Kp00DKhajEvYCGkqw0OEa2Zke8IvXI6OCSZ+Fvfo+Jzu19CYkxFcJ6MP7NYWE1jFe4s3BWe9CQFWmG+XJOP41XoXnb+rHwF+Y/UtlH52Vi0471VkuqajG4XDq4dNKKj+koSvFDeuveHIRw+2Cbz+VRW5cEhf6Ft5D+qSzCVv7iOh6F19R0eJi7VmxBrpJxFGugVd5ZeCgmjF+M2RcusGsnSqH3ECmY0yWpgCMK40bLA3GrPF1SPEGY2ekG+lvyJ1GkUBIjQzjGOqy1ULGlDNnKzWDe5dXhfCZM9o8AdZAiwMloIG1sgxa6gtujBbDNbiOzeCOBOI/cUA+W+XtCYfMBtgXzqTZOMrf4ixplIdkXF79kYbIefLe/BNY41WvEY/gig6ITjxnXI0Q18StZqGS5Lb1GwWylwuJJ3LWJw12iyPRuMpDUncAv4ZgSCfxMpRFo62j3gj7GnbtGtIFuF8QQbWnMkc/pRJTEYcyYLXK86QT0j/+aOXS9SRT6q2D8P6NYyYh5q7xRZxo5NfgPoaULrSXof6CZUj5f/pPOeyJdS1laR1UnxgRNQN87+FaD6zb4SzfLSnRENsqZ72ODrLLIKEDuGp9f67vl/kDnbP9VSELYuHZDYYEtNamLZr+NW8NGU0K5GNaL26S06ZGWo6KpmVuLRZDxL4K072SUOgvvtCLRZJysUZXpCny3r8uWPepBBSUHINBMQxjlUaz5Pg1Fz9kFjGCrAewPnBrEZ30nEx54qKOd0D1/lfOM7i1nthjpJUqO3YP7g/dPWLz0rvHe+iDBHq/oPzh5SHHNvgSrnmg2aJ+ASu3ibYSMH3u4vsVZbnNwBwqrFqGdhPB5DxzTfqfxj9F3btvSHN23UAi+YTq8qjJ1JgW42dRI2MfzKhGY6hLJdfQ/kKtEVNKy0AoiHfc1KRSHDISzqLnbUe/OoMsy7Qa1+05QIRH2NSHmkMQ== 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)(376005)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:53:06.9915 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5267730c-44dc-4162-1f68-08dc89f3e9b6 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: SN1PEPF000397B4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7505 replace the usage of the deprecated boot_cpu_has() function with the modern cpu_feature_enabled() function. The switch to cpu_feature_enabled() ensures compatibility with the latest CPU feature detection mechanisms and improves code maintainability. Acked-by: Mario Limonciello Suggested-by: Borislav Petkov (AMD) Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy --- drivers/cpufreq/amd-pstate.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 6b9fc24001f2..cb59de71b6ee 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -157,7 +157,7 @@ static int __init dmi_matched_7k62_bios_bug(const struct dmi_system_id *dmi) * broken BIOS lack of nominal_freq and lowest_freq capabilities * definition in ACPI tables */ - if (boot_cpu_has(X86_FEATURE_ZEN2)) { + if (cpu_feature_enabled(X86_FEATURE_ZEN2)) { quirks = dmi->driver_data; pr_info("Overriding nominal and lowest frequencies for %s\n", dmi->ident); return 1; @@ -199,7 +199,7 @@ static s16 amd_pstate_get_epp(struct amd_cpudata *cpudata, u64 cppc_req_cached) u64 epp; int ret; - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { if (!cppc_req_cached) { epp = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req_cached); @@ -252,7 +252,7 @@ static int amd_pstate_set_epp(struct amd_cpudata *cpudata, u32 epp) int ret; struct cppc_perf_ctrls perf_ctrls; - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { u64 value = READ_ONCE(cpudata->cppc_req_cached); value &= ~GENMASK_ULL(31, 24); @@ -753,7 +753,7 @@ static int amd_pstate_get_highest_perf(int cpu, u32 *highest_perf) { int ret; - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { u64 cap1; ret = rdmsrl_safe_on_cpu(cpu, MSR_AMD_CPPC_CAP1, &cap1); @@ -988,7 +988,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) /* It will be updated by governor */ policy->cur = policy->cpuinfo.min_freq; - if (boot_cpu_has(X86_FEATURE_CPPC)) + if (cpu_feature_enabled(X86_FEATURE_CPPC)) policy->fast_switch_possible = true; ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0], @@ -1221,7 +1221,7 @@ static int amd_pstate_change_mode_without_dvr_change(int mode) cppc_state = mode; - if (boot_cpu_has(X86_FEATURE_CPPC) || cppc_state == AMD_PSTATE_ACTIVE) + if (cpu_feature_enabled(X86_FEATURE_CPPC) || cppc_state == AMD_PSTATE_ACTIVE) return 0; for_each_present_cpu(cpu) { @@ -1450,7 +1450,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) else policy->policy = CPUFREQ_POLICY_POWERSAVE; - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value); if (ret) return ret; @@ -1540,7 +1540,7 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) epp = 0; /* Set initial EPP value */ - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { value &= ~GENMASK_ULL(31, 24); value |= (u64)epp << 24; } @@ -1579,7 +1579,7 @@ static void amd_pstate_epp_reenable(struct amd_cpudata *cpudata) value = READ_ONCE(cpudata->cppc_req_cached); max_perf = READ_ONCE(cpudata->highest_perf); - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); } else { perf_ctrls.max_perf = max_perf; @@ -1613,7 +1613,7 @@ static void amd_pstate_epp_offline(struct cpufreq_policy *policy) value = READ_ONCE(cpudata->cppc_req_cached); mutex_lock(&amd_pstate_limits_lock); - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { cpudata->epp_policy = CPUFREQ_POLICY_UNKNOWN; /* Set max perf same as min perf */ @@ -1815,7 +1815,7 @@ static int __init amd_pstate_init(void) */ if (amd_pstate_acpi_pm_profile_undefined() || amd_pstate_acpi_pm_profile_server() || - !boot_cpu_has(X86_FEATURE_CPPC)) { + !cpu_feature_enabled(X86_FEATURE_CPPC)) { pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; } @@ -1834,7 +1834,7 @@ static int __init amd_pstate_init(void) } /* capability check */ - if (boot_cpu_has(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_CPPC)) { pr_debug("AMD CPPC MSR based functionality is supported\n"); if (cppc_state != AMD_PSTATE_ACTIVE) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; From patchwork Tue Jun 11 08:52:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693304 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2059.outbound.protection.outlook.com [40.107.102.59]) (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 4F60D17B41F; Tue, 11 Jun 2024 08:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095994; cv=fail; b=bcn0X9AgBLCvCCynVvlkFrdZVwYfl/zFeKG3KPoEAcnNZe1YTyaH1M8iW5j+Pl1kvQlSDhTa+1fd2K6BP8ClqQJ9eY/TfGict7y2CgQVBZKCLmMMqirfYTMs6pQI2COEgO4ix1FIvrOGqAsCTr3iGE+O0m2JlzlrVhe65xia4W0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718095994; c=relaxed/simple; bh=fFfsKxNhZvDv10T0+KsP6LiJUPQ5KyzqK+JF4C5Lu60=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AB74IkXQnJ5W2oTYzCIkJw1/ghuTutAbRNvgOglZZ3wlwK/KHQqeDAVCgpLSFE1WgFvFoevYm2h7MyjNdjJzs1jDo9QFdskpqOTpmqpwXuMK266ccgBL4jwBk6Czz/6DnKQz4YnkkGUAE5/7lSqgQ++awFQcoN66J/wROIFpOEI= 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=sAFVDwjC; arc=fail smtp.client-ip=40.107.102.59 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="sAFVDwjC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DsXJ43wcgQ0NDxt5jyRu2ckqAj9W9UmhidE79bLNZUvVhSxHd8v5LH8i4Yglvit6FUAX84k8o7RWvIJUc/IjDE2S/zzFSEW67JqHvWbokDKhFLLM7Igi2QSgXIzH5OS6zeveU4nPKr7M9hHdWhGeqshPP6dVK+pAkLAYKWZhhwe0Od6ZfYpvUmWmhnN8H75sKKk2rQQH2uH8+H+HBoBnTEmUlaylqIRXazwd62lFH8V0h+Uw4pgdNn/5UDrHKUU8CpyLlJWguUk398yAbgZVvGpwYox1Rj/ZWMjD4NyIk64Zcn/139Q5v6KWBZsSHwfmGCuFJuVwh6S1l+XCOScUZw== 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=VpS9Lp4lgApv0tVb3MEd6FRzJU5Az/KlCTpi+pU3/2w=; b=H4vVfoYZsoDarFSAQuC2bWKfKkj6Xnu7CH6+EJdzpNsEF5yEfLbUZqK9YpJi0YLfowdQjDAQrkaFjnzWoBdbUGH5ygDQa6TSGZbFUEahnen7vgCUOdHwwzdrDdUnjapiQJBMWzyL1XyjzZDGV90MLjEgcM6pWBBRU8UKGzMtMh5+PQMz9jbRHbDkJZ4HNoum11IfCKjF2o+hW1+punrN8TQsmA231ojLPQmaKnllolKknKSWOr7L2uLZuP6+UUtDd5ewlxkD6SQpELX+2nGM1Q7YEAxkcty47XfYe/gQejPv+3I95oFDM9atdWjFWmeJkU8E54Lcye7Hsan8SuGhgQ== 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=VpS9Lp4lgApv0tVb3MEd6FRzJU5Az/KlCTpi+pU3/2w=; b=sAFVDwjCl16JuzQBNFWWJ+MUtQjU03Eb49f1fqFJNUYPlgryfdoKShqhgDxvEyd1eRsOrYDW20pwf+f8cjnFSR76FjnhNFLg8hPB8w517bwCMw3ZL57Zmq2+chTPqsymARLgn+QK0bGGnEOsqBLtBJHlpDzYVMcfY5YcYfA33Ds= Received: from SN6PR05CA0011.namprd05.prod.outlook.com (2603:10b6:805:de::24) by DM4PR12MB6133.namprd12.prod.outlook.com (2603:10b6:8:ae::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:53:10 +0000 Received: from SN1PEPF000397AF.namprd05.prod.outlook.com (2603:10b6:805:de:cafe::5f) by SN6PR05CA0011.outlook.office365.com (2603:10b6:805:de::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.19 via Frontend Transport; Tue, 11 Jun 2024 08:53:10 +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 SN1PEPF000397AF.mail.protection.outlook.com (10.167.248.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:53:10 +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.39; Tue, 11 Jun 2024 03:53:06 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 08/10] x86/cpufeatures: Add feature bits for AMD heterogeneous processor Date: Tue, 11 Jun 2024 16:52:24 +0800 Message-ID: <7a2817ce6e8e6a2787bed8285dba8d81423d8414.1718095377.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: SN1PEPF000397AF:EE_|DM4PR12MB6133:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a0be98f-bf7e-4b3c-bcf5-08dc89f3ebd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|82310400017|376005|1800799015; X-Microsoft-Antispam-Message-Info: 66Kx9u/Ab1NCOcnZqLlDBRrPYgUabZS5nv285H5M9oq9xYSunb4iJBoA2vjc41gP4+8Ut4OXFRndZ5CXPwYzsgI7pPKG+gUubs18TMyCYl5iQI+9pU8MQCnD89qNeSmjp0e/1FynKGPkUkuqpRjmxM47+X4zXDJCqrDpbYV+gUcSbcdTh6RhXEs8NTac1nVEyH++3aM+ANwZeasnelETL2JHGivMMP1uHTXIM7Gyxd9IW4SPsCrJkjfK5uAFp13bGxGSmfsAhpKzotwOfHO6GYWuXjTUT7rQ6xa9Al3VahC3gFfjpIaQDrC7bAM8picQa4D1wrBl+NwhZQ0HwwnCDNxNnDwZKqiLa1SP1W/GtenlwQ/4YREVecDSPdswr7dwwMX1arhtpAroMHaRFs4fZsw3NFz4FB1Ep+KeTTGXL7TsHJ+JiPvSFvxsRaucvINMyLpnDhN4NH6bdtE+rr9NyeZBguqF41gR062mqY93oJojDSYUx1+BoG65pIJua+KPNeSy8/StcHG4YlaL/EaSBqFiiaB8I6KswCrOSbAzMgwVw+h+5jYDKy7URY9RiqN7YSynu1FfO0/PZQXCjmWdBm2wWt+/B0zjaVujKWswP70cMjAwGr79uHYGwWtqljPY4T5ZZFLU7Kdxzq2EBIok4lBGKms5zEloB+tN4kYT88Hl68YtkuzZkhL1llppcXehtwiwKI/8oNdBNXCO3tLg2i+MvE++qriux5JMwXM2b/8WQqnizBnn0AldrvV3v59nlXeZNBZqkRTn8u+7DEFNVXppfNFCQgrwMz+TTLCVrDCOqroAdY5ufxqWSJZewdZey9Hk23jsdsecNGFMU6z7K5U//R5kbAB+UYhc8lNG0vbkYegY1oNdamH8QhQ+uP8qFnxq9w49Y0proGA9yhvJcAQEt/+6912VSPitlL4aZn0pjZDYy6xXcib2RzU76Z4we7dUPux4SkO9Btnz7WMSqm3cpCCd5J4p3fgyjDuNuhC70HkV+8nVyUpBWq56Cm/HxrFUK2lBewcH9qrIaaLHCPFHDAgKRJlXYcStkmkTpP86TGapx2hqOPKd6c6Um1NkueTDg9KLml8V1hhR6cPvyYyZnd7ek3LQv0+RruqP13zxCvWKAsvsUox+qPF+wNWDkyk8i37vocoThb+Nkz7TJNG1tcCfgATXMWARNO6oSM7cvqKy7TAq+hEa6rFFtUb7I5vXeSwk0OohFW9UjnjYfn9gTj2tC1Zy9DTsqUIpE5zjf5ZI+lPfc5qdjk0UrvxXAgbsLCVL4SqAwoeNllaVmpC7v3BSzMOnTJg1mfTQpQxTbZdQWm5mdVFAtxeWgyZke0Ui0fFcPiITPhjUkSCykyWKcevLv92wiWCZ3t2SRPG5u15DXXp5nNECJHSavgbjg1bp3/2nN2FIVAZESdBYcw== 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)(82310400017)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:53:10.5698 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a0be98f-bf7e-4b3c-bcf5-08dc89f3ebd5 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: SN1PEPF000397AF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6133 CPUID leaf 0x80000026 advertises core types with different efficiency rankings Bit 30 indicates the heterogeneous core topology feature, if the bit set, it means not all instances at the current hierarchical level have the same core topology. For better utilization of feature words and help to identify core type, X86_FEATURE_HETERO_CORE_TOPOLOGY is added as a few scattered feature bits. PDF p274 Link: https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/24593.pdf Signed-off-by: Perry Yuan --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/scattered.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 3c7434329661..39a92338c015 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -470,6 +470,7 @@ #define X86_FEATURE_BHI_CTRL (21*32+ 2) /* "" BHI_DIS_S HW control available */ #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* "" BHI_DIS_S HW control enabled */ #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* "" Clear branch history at vmexit using SW loop */ +#define X86_FEATURE_HETERO_CORE_TOPOLOGY (21*32+ 5) /* "" Heterogeneous Core Topology */ /* * BUG word(s) diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index af5aa2c754c2..9e237a3daf7e 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -51,6 +51,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 }, { X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 }, { X86_FEATURE_AMD_LBR_PMC_FREEZE, CPUID_EAX, 2, 0x80000022, 0 }, + { X86_FEATURE_HETERO_CORE_TOPOLOGY, CPUID_EAX, 30, 0x80000026, 0 }, { 0, 0, 0, 0, 0 } }; From patchwork Tue Jun 11 08:52:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693306 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2060.outbound.protection.outlook.com [40.107.100.60]) (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 6635517B500; Tue, 11 Jun 2024 08:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718096003; cv=fail; b=Acokuu63nkEy4kZUEtnlSQEWsnHQv9CCc0douJ2oKDhXm/y/dNUMde/Sc41mTcasFrFQoG0m+Gc9IuIgeu90aypYX/9hYbmj1fc1ebJrPvp3EQTuY4Cyqd1teKmGI9H9VSm/lJ6MyjqO+oOXHTBHmUrgUlyfXRABaWwfiQvl0r4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718096003; c=relaxed/simple; bh=W99zQEQQ/OGxxPso2jS9+4W6tk4N7XEGoGWIIlK+OCs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JZxWyIAkF9Hg4FOlP9aEqCa6kXG9EcVQo532GrWxjcOo4XT9aGiSWqtcBvSNRshgkL/+b9Fi1TLzOqVMBxJpo1M7mcATPbjYBvTFisRC1dPLraZpn/CYmNLQ8Ma4NFneYoIRCtGigOuQVOllu9uYPT8xfWh8UWvPaDCMfrVskrc= 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=T34zTJ4O; arc=fail smtp.client-ip=40.107.100.60 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="T34zTJ4O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RREGDQ86XXRfopZZqpzWtbMCPv10TX9QL9+qFUCd+U+ehB8vjcg+oU63+MkpDqcDq4Umz9yqpIdNMRSuE0Ep9T954+g1DbYLJ6eqv7sXZsb40fVpWN+jTSzXv+xtZ2J70tRzYuEC0cLQlzoISQjcgLpV77l2rbgF9L51H3p0OLgFWseC5eqiTTW04SHEismwuy3KtPzggqaaKGYrnKJWtC6c/+kQz8zSzpSm6ni6HcXRwrx793T1t7ucm87nGQYI0R+amdYBnh8l6VFtvLs6QAl7HjeifCZiw5SBrCAOcxlWn4ZsmNdQN4dQLY/txrro48tSv98Ue+kewP4DCiPj0Q== 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=NRrjJrhZ9mOUhVW3oEGJa+meilMx3yjHSMrYjj0j9Eo=; b=cthpmEG6ah/VPx7ERKtCwZCwIcXMHwxNhJ/jkU+ezzIKVzXJZA69wZP/28IMf6Zjl5bbyNpqJzeSDE+1oNhKoyb0M+2rCbb0l7ETVVfrfNUPprFK2WWY0A/hXzyUUT2ZTzC5AZdmDbFpoUlifEM0IraDZ3SpWqjChZws2Fw6keMhEWPUzinjdRGWR/DUD64xyBLXHwRBuIS/qgRvgEKT8gfGTGzV/1mtpFJzpoh0hUqhqdKq7PPl+1QvkM1Sl0AshPvc7Tv5J6IFiClMqNjwlKwawUxZoyI4qrQF/qeStQg8tpgYSEyan4oKDz8hrrV1gUQn0Ckg9vfM8uY4qznS6g== 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=NRrjJrhZ9mOUhVW3oEGJa+meilMx3yjHSMrYjj0j9Eo=; b=T34zTJ4OdXiBnCyTzmfJjFdUtyxpSZHSM64XChK9u6FZcGw6YmxA0VppdYZIoi7uxFuP/WBUfXYgjoglu4Wtkcz0gQtIq10Hc9SFygFlRTe5DpUViw7kIvIkMag5WkmnrCec4EchEsGyhuJ0tbTyugNSlKIWKnX5BSmp5Ru4BVI= Received: from SA0PR13CA0007.namprd13.prod.outlook.com (2603:10b6:806:130::12) by PH7PR12MB7889.namprd12.prod.outlook.com (2603:10b6:510:27f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:53:15 +0000 Received: from SN1PEPF000397B4.namprd05.prod.outlook.com (2603:10b6:806:130:cafe::7d) by SA0PR13CA0007.outlook.office365.com (2603:10b6:806:130::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.19 via Frontend Transport; Tue, 11 Jun 2024 08:53:15 +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 SN1PEPF000397B4.mail.protection.outlook.com (10.167.248.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:53:15 +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.39; Tue, 11 Jun 2024 03:53:10 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 09/10] cpufreq: amd-pstate: implement heterogeneous core topology for highest performance initialization Date: Tue, 11 Jun 2024 16:52:25 +0800 Message-ID: <97b65a2294154dd469377a7a76ee738de7bf7aef.1718095377.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: SN1PEPF000397B4:EE_|PH7PR12MB7889:EE_ X-MS-Office365-Filtering-Correlation-Id: 85f3fad0-45b5-499d-53bd-08dc89f3eee1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|36860700004|82310400017; X-Microsoft-Antispam-Message-Info: O/THm7uoC8n3ANUyyXrUG9yp2GRC1vfWVEeu5EWDFMPI+SeX5bwnDD/RYeaDicfgtYwAbGatDA6cSy9r3r612ryN+l9R/5zvzkKfGo+GZjg02nemP5mMxTgxSvyNC55mqVl7jOljthA9n9xKU17lLSILpP7mbnuZ4egS+i4Wnindxl1+6WaH2EshEOJlaBcOskgCrzeU9dJxA7E2SfoEzeXxDLZmamYWMSpFaGm0Hsl5OWTVrwO1FC1edHoN/MOko5QKccGMoSIMpv61iuMsF7S1/w3zFHGbJIOd1tYROd0A+L80/qOuM/pRdf8AHxB+xwSxQrqtyO+yqjVoC83z0kd0NjiE8y3hfFsH/+jAG2B/VABWH36pjWpwG4lPfg79TL1nWmuV0gB0TEQGzXFe4G/CVlXgJj7IiSkCEniigoJPdwddqycpabEz5zvPPBQBL+vpe6HY6skgewBn8UEox5LtgXXB/YkU04hCoS0gh5HY7pCVLRJGoEMBZZyuspy2JjrSLiWXBeJnAmvgsmgQXNrdo/+leMPzyoeqLzk8nXMvzMilOzfKCJvG/Yj1ETB/KJz3jJMELny7O/MKg0RsbbFyxBc1WcDTZcIbE8FcYI8ezziEvu+1QuM6AaV0Af+8fiPYb/QS7up+tuyamYQh/GuS2XxP596en1c2q4oFV9bCjpJghxAWGyvIoIsyFR7InQ8DLcOYhOETP+nvA5UbqKTDa6tVHdtg7oKbQpOsIHqU5SFQaD3Un40NpC3rY1lIf5//+wxDaO0eiNFi58vm22X+k4RImRpRilsA3niLHALhiU+4AXcA0MDavLdq9p+gr5ENLJf3ag0ny7T/TPwFKCuExJL/59JTMIhLfCEHDLaHnpRn9POGBCMZVxO6WD41PS32+8Rj3jn8bWuMzETqd8eq9+TV/n68DszCN08MbXGWu1V5Ao65AZzBKBY7SKeor/c2gLpCOA95blztJhgLmrkoUs/igIhDwDSQxdAOlpqb5xkchSKuSYiav1l31B2bwbAe34yb5cUKrfq2l0dSpWbEUfEBkAHIJmT8M/5BeGSslaJ6kSuSoAnTvpis0bTRGcd5KWVXcAmOLe/b3Gj038SQp+CXSwb/kYLEZzEySRidiYW0q5X9lIQng8B2enIm+YSg91urhEpO6qqG006ILMIU8pSmRRNG8EdYUpIHzuIPVhY0L93ZXWiZlAP62ZlCywPy+lfnKLTjRZE4NfOmvsJFnOLICyb+CXyOc7Yl8agr1d7Sr7Xp+HCnkkiRejvDih3TEHHFrm8o+Hbw2WPAUsMsrjQKl2h+Zgx5WDZmULLyvsK7SYf0OUmZlACkuh8zAjoeoZvQYoqmn6heZZks9rM4aCj0hf+w5zLMIefcj3LILw0uDlht0iD45Z+XuzWFSgaCsJmjpSy+b4D3oIIoqw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(1800799015)(376005)(36860700004)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:53:15.6789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85f3fad0-45b5-499d-53bd-08dc89f3eee1 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: SN1PEPF000397B4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7889 Introduces an optimization to the AMD-Pstate driver by implementing a heterogeneous core topology for the initialization of the highest performance value while driver loading. There are two type cores designed including performance core and Efficiency Core. Each core type has different highest performance and frequency values configured by the platform. The `amd_pstate` driver needs to identify the type of core to correctly set an appropriate highest perf value. X86_FEATURE_HETERO_CORE_TOPOLOGY is used to identify whether the processor support heterogeneous core type by reading CPUID leaf Fn_0x80000026_EAX and bit 30. if the bit is set as one, then amd_pstate driver will check EBX 30:28 bits to get the core type. PDF p274 Link: https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/24593.pdf Signed-off-by: Perry Yuan --- arch/x86/include/asm/processor.h | 2 + arch/x86/kernel/cpu/amd.c | 19 +++++++++ drivers/cpufreq/amd-pstate.c | 67 ++++++++++++++++++++++++-------- 3 files changed, 72 insertions(+), 16 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index cb4f6c513c48..223aa58e2d5c 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -694,10 +694,12 @@ static inline u32 per_cpu_l2c_id(unsigned int cpu) extern u32 amd_get_highest_perf(void); extern void amd_clear_divider(void); extern void amd_check_microcode(void); +extern int amd_get_this_core_type(void); #else static inline u32 amd_get_highest_perf(void) { return 0; } static inline void amd_clear_divider(void) { } static inline void amd_check_microcode(void) { } +static inline int amd_get_this_core_type(void) { return -1; } #endif extern unsigned long arch_align_stack(unsigned long sp); diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 44df3f11e731..62a4ef21ef79 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1231,3 +1231,22 @@ void noinstr amd_clear_divider(void) :: "a" (0), "d" (0), "r" (1)); } EXPORT_SYMBOL_GPL(amd_clear_divider); + +#define X86_CPU_TYPE_ID_SHIFT 28 + +/** + * amd_get_this_core_type - Get the type of this heterogeneous CPU + * + * Returns the CPU type [31:28] (i.e., performance or efficient) of + * a CPU in the processor. + * If the processor has no core type support, returns -1. + */ + +int amd_get_this_core_type(void) +{ + if (!cpu_feature_enabled(X86_FEATURE_HETERO_CORE_TOPOLOGY)) + return -1; + + return cpuid_ebx(0x80000026) >> X86_CPU_TYPE_ID_SHIFT; +} +EXPORT_SYMBOL_GPL(amd_get_this_core_type); diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index cb59de71b6ee..fa486dfaa7e8 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -51,8 +51,9 @@ #define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 1000 -#define CPPC_HIGHEST_PERF_PERFORMANCE 196 -#define CPPC_HIGHEST_PERF_DEFAULT 166 +#define CPPC_HIGHEST_PERF_EFFICIENT 132 +#define CPPC_HIGHEST_PERF_PERFORMANCE 196 +#define CPPC_HIGHEST_PERF_DEFAULT 166 #define AMD_CPPC_EPP_PERFORMANCE 0x00 #define AMD_CPPC_EPP_BALANCE_PERFORMANCE 0x80 @@ -85,6 +86,14 @@ struct quirk_entry { u32 lowest_freq; }; +/* defined by CPUID_Fn80000026_EBX BIT [31:28] */ +enum amd_core_type { + CPU_CORE_TYPE_NO_HETERO_SUP = -1, + CPU_CORE_TYPE_PERFORMANCE = 0, + CPU_CORE_TYPE_EFFICIENCY = 1, + CPU_CORE_TYPE_UNDEFINED = 2, +}; + /* * TODO: We need more time to fine tune processors with shared memory solution * with community together. @@ -359,9 +368,27 @@ static inline int amd_pstate_enable(bool enable) return static_call(amd_pstate_enable)(enable); } +static void get_this_core_type(void *data) +{ + int *cpu_type = data; + + *cpu_type = amd_get_this_core_type(); +} + +static int amd_pstate_get_cpu_type(int cpu) +{ + int cpu_type = 0; + + smp_call_function_single(cpu, get_this_core_type, &cpu_type, 1); + + return cpu_type; +} + static u32 amd_pstate_highest_perf_set(struct amd_cpudata *cpudata) { struct cpuinfo_x86 *c = &cpu_data(0); + u32 highest_perf; + int core_type; /* * For AMD CPUs with Family ID 19H and Model ID range 0x70 to 0x7f, @@ -371,7 +398,26 @@ static u32 amd_pstate_highest_perf_set(struct amd_cpudata *cpudata) if (c->x86 == 0x19 && (c->x86_model >= 0x70 && c->x86_model <= 0x7f)) return CPPC_HIGHEST_PERF_PERFORMANCE; - return CPPC_HIGHEST_PERF_DEFAULT; + core_type = amd_pstate_get_cpu_type(cpudata->cpu); + pr_debug("core_type %d found\n", core_type); + + switch (core_type) { + case CPU_CORE_TYPE_NO_HETERO_SUP: + highest_perf = CPPC_HIGHEST_PERF_DEFAULT; + break; + case CPU_CORE_TYPE_PERFORMANCE: + highest_perf = CPPC_HIGHEST_PERF_PERFORMANCE; + break; + case CPU_CORE_TYPE_EFFICIENCY: + highest_perf = CPPC_HIGHEST_PERF_EFFICIENT; + break; + default: + highest_perf = CPPC_HIGHEST_PERF_DEFAULT; + WARN_ONCE(true, "WARNING: Undefined core type found"); + break; + } + + return highest_perf; } static int pstate_init_perf(struct amd_cpudata *cpudata) @@ -384,15 +430,7 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) if (ret) return ret; - /* For platforms that do not support the preferred core feature, the - * highest_pef may be configured with 166 or 255, to avoid max frequency - * calculated wrongly. we take the AMD_CPPC_HIGHEST_PERF(cap1) value as - * the default max perf. - */ - if (cpudata->hw_prefcore) - highest_perf = amd_pstate_highest_perf_set(cpudata); - else - highest_perf = AMD_CPPC_HIGHEST_PERF(cap1); + highest_perf = amd_pstate_highest_perf_set(cpudata); WRITE_ONCE(cpudata->highest_perf, highest_perf); WRITE_ONCE(cpudata->max_limit_perf, highest_perf); @@ -413,10 +451,7 @@ static int cppc_init_perf(struct amd_cpudata *cpudata) if (ret) return ret; - if (cpudata->hw_prefcore) - highest_perf = amd_pstate_highest_perf_set(cpudata); - else - highest_perf = cppc_perf.highest_perf; + highest_perf = amd_pstate_highest_perf_set(cpudata); WRITE_ONCE(cpudata->highest_perf, highest_perf); WRITE_ONCE(cpudata->max_limit_perf, highest_perf); From patchwork Tue Jun 11 08:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13693305 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2085.outbound.protection.outlook.com [40.107.244.85]) (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 B72D1176ABE; Tue, 11 Jun 2024 08:53:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718096001; cv=fail; b=K6GBNYkq3+pUh7pEkSbpR9foPXuOrC/GKywXqgHIdxAff5peNI50bYfzjbM+DM85l1f1TTJWzpuRXgIZpvB9L80zxC9LNaWKkdvRL9ap1zsoM9tEWzQV25EvqzIMs+esARiuPVwjWx3g78EsTkhA97WLUzjOUIJxp2Xu0JOUoQU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718096001; c=relaxed/simple; bh=5FiSM+uQeOZpz8v498h6TTQvnoVU4ruREKDIyzmEzCg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n66ILshhZkxVS2TSZGh61x0im4409wVM7hQRpeNFf0OT0ddJR+KNYzVUvYnAKuh7/7xEXljbLFUiiFw7I9box14/zVzAVNQ9sk4j6BPMoSOJv1T6/+Ju0atH0XkCwbSoi4TUXLGEpGPQnJrB78K5RZavs5dQ1PBrQiwdS05/hoc= 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=oblhHj9t; arc=fail smtp.client-ip=40.107.244.85 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="oblhHj9t" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aYWf/0BcmdA2R17Kx6NSk/qMZ9RYyD70TjJu+sY9mQb2TatiqSab3BoXk+eVc8iqqprQbOznh9PRHfMcKzM1agQmWRNTyuN/YM7kJRnRX+SzA5jgNfi/qAQSrT7kaiwTUFhKlr3+Y771M+UWQW96tNPYQb55jbjvZBN6wbvXY/vH978t52G72zIsNgkK3ySvuIBXL3Eh/6eJpbIO516b9THbmdeKbbudQtrnK/Zqq/XzBqw4kouhwbiF9qrHwCLG5FWfheWvnzUGaUZtjZLb7xxnqUrjpwUClw+dg61gmVqj33qRk65jytZSdSuJMGyxldGFE7Vv3jVqFLFj1W7Sgw== 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=sQyzJaOne+We6n1n2nOcSNThxpN75QCZB9oSmSOaKKg=; b=cRbfxRYdc+3D/vmQTO3y92174chcpOL2oRmaRUUmU14QDsLtqEMAR8vDRJuyXdfz6hOHO+Wb8UeFjQFnStouJQCpYjd8gmlrimvcjwxx9hgfoBDPHDREnzdzXwpht8+dYO2QftQOf6SSsdnak2RQGQfmuSNfA4dk1xtUdQgC75+s9M7CcEqgCDyzF7CKA2bCXllESyALULYb7hvgySbxk8e1K8xbpCnMo9oUaIKTUblgbx+N68Hm7F/4krWm/iuLBe1CoLo8bkG2/Ddx4WS37bhrtsRC682rWZ2qY7FARI4+Wk9TZwODGVgTfVUnZkzmQTbmjVwM/2PJL0OvUGqrXw== 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=sQyzJaOne+We6n1n2nOcSNThxpN75QCZB9oSmSOaKKg=; b=oblhHj9tCVBOyjFNPyNvFuiV+l1DhWVwY+2XMbUcYS72PdOKyYgf+6B2keFRi7KFThx1JU3UbE2W0Gbri0vW/Av7rJjcCeTBIbByHVqTHbCOk1cPjXuPydaczQQsAfMs1pN3lkXhxmln4PdWtnZmYcGi/ikFfhURT861ivCxjIs= Received: from SN7PR04CA0169.namprd04.prod.outlook.com (2603:10b6:806:125::24) by DM6PR12MB4105.namprd12.prod.outlook.com (2603:10b6:5:217::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Tue, 11 Jun 2024 08:53:17 +0000 Received: from SN1PEPF000397B0.namprd05.prod.outlook.com (2603:10b6:806:125:cafe::b7) by SN7PR04CA0169.outlook.office365.com (2603:10b6:806:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.17 via Frontend Transport; Tue, 11 Jun 2024 08:53:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF000397B0.mail.protection.outlook.com (10.167.248.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Tue, 11 Jun 2024 08:53:17 +0000 Received: from pyuan-Chachani-VN.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 11 Jun 2024 03:53:13 -0500 From: Perry Yuan To: , CC: , , , , , , , , , Subject: [PATCH v3 10/10] cpufreq: amd-pstate: automatically load pstate driver by default Date: Tue, 11 Jun 2024 16:52:26 +0800 Message-ID: <39b55abeb278d9ae1688c0b87cb7ec8a3e37932a.1718095377.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: SN1PEPF000397B0:EE_|DM6PR12MB4105:EE_ X-MS-Office365-Filtering-Correlation-Id: b6ebc321-1c81-4239-1339-08dc89f3effb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: pQmjp36itnK94Lcc42GJ5krlSqcBSqFq1y9KAR5FhMi4PxBqdDhvBTHHU+t525SzsqekraIbfZ6CrifPiUNE6+Rkcb49QW2mRuGisDVvEhqjNo8tsZ8XqjWEMfivLxYroPvkpIZeFE84YQEuw0x7D0x84FfoC4tUS9TKA5mTw9QhdkRmorFTSaM8oeYYuqFBXWjuGMFGbHQsaGwKPhn8U0Tn5lBga4rvyxcRTC0B7s6UHipfkYCVJUR3AhU1xW9B6MCraWugAG+W2DhyeB+jfmrHmWx65bQO5bcYMSEcyYjwRH1lhytQIoU2XwXH+WsFx0FgdXt7sL8BzbGcJKWDuABKxM4FYf9w3DlndcuJw6lkbDjfsfyeAHtj3i9VX6cmStLNHaBAlm8Jlmw6ZFJHs8lQfgdeoe7TsIDpopkS8qtaVVad4mc3vltSTYM/ejwofs+sfcdsYC5UXiqvgdym6SR1Wgmf3Z1muyQyAkJ8vIyPGUZmAa2mgenhVNigNHwaNnhIoP89HRXEGa4xxvR6Vf6A3CpMUjIB+Ami7ToxFtxd9v4ggLVTsxzWfjCHLqC/6xqf+OkkfXDucIOItzX78Px83gGk/bEGbXRRNgN7xoq+UO2sE/UBOH+o1mAivFQT0oJtjDCaZ0krJDhHVpJxTe09Rpu1IZZQpxddzHCZuSW/1YK8xRffii7fVIrgtTBhPWZDfRWfSjGO0974HU+yROfMYPb9TTY8Aqs0t8e27jRtRL9nuNSa3p0gyM0vg/GaX7oCn78HN1YL0WIVhx/RSfM6hbpEo0JYFqIS0gXZqj5NsFMSOG7qqkKx0ExX2qrqvE6yu9lHLlXD6SuOMZA/vgPFQW5PaPfk8zW2k0/2wrVhJhKoBUTI+h/t2Lvqq+jkdDVkiEMlyjg7NSFmbzVT2TPYplfsc2rGeR/oRS0KHWT3BrDFPOflBAS0dXBu7DBObplOpKvsrWbXyXkh4sYL+NzicK6o7ivAV+Ab6sk1ipbx4kxkOMfF0XkMq+nLNiNQpLA9hUwg/Y1Nxob2HMQqSWDDiT3JpG7Bo8Ce+5HK+0jeiu9w5/fUUlGEEKmiZi+Jle2O5wMO7AapcgFUzL01tGnZwJvBrCp5Mlw7FUeFDUgrIxu/eoANRrW6narOG1JNQxQQfygWY1q0LhPEsSb+Kg5GibPxaFRqnGPYXiS5UzHYWvNLxAgboDtmvTHkG8i4ZgVGjfPqr/PBnYh0J2SKjHbonqh1KI3rURnRTVm6+W2YK8BajzgK9OnBOIGgfeS920I41R4INO/RQb7gAud9bB0jy+qOv34kkXkUSGfYjQmGcFk307XV/rPFFdIpODmw4Trm/gZzY7HlP/pvJThHetvuoA0UyU+0QteOzWEpvHE= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(36860700004)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2024 08:53:17.5253 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6ebc321-1c81-4239-1339-08dc89f3effb 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: SN1PEPF000397B0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4105 If the `amd-pstate` driver is not loaded automatically by default, it is because the kernel command line parameter has not been added. To resolve this issue, it is necessary to call the `amd_pstate_set_driver()` function to enable the desired mode (passive/active/guided) before registering the driver instance. This ensures that the driver is loaded correctly without relying on the kernel command line parameter. Meanwhle, user can add driver mode in command line which will override the kernel config default option. [ 0.917789] usb usb6: Manufacturer: Linux 6.9.0-rc6-amd-pstate-new-fix-v1 xhci-hcd [ 0.982579] amd_pstate: failed to register with return -22 Reported-by: Andrei Amuraritei Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218705 Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index fa486dfaa7e8..6e5c398810bf 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1841,28 +1841,37 @@ static int __init amd_pstate_init(void) /* check if this machine need CPPC quirks */ dmi_check_system(amd_pstate_quirks_table); - switch (cppc_state) { - case AMD_PSTATE_UNDEFINED: + /* + * get driver mode for loading from command line choice or kernel config + * cppc_state will be AMD_PSTATE_UNDEFINED if no command line input + * command line choice will override the kconfig option + */ + if (cppc_state == AMD_PSTATE_UNDEFINED) { + pr_err("pyuan cppc_state == AMD_PSTATE_UNDEFINED \n"); /* Disable on the following configs by default: * 1. Undefined platforms * 2. Server platforms * 3. Shared memory designs */ if (amd_pstate_acpi_pm_profile_undefined() || - amd_pstate_acpi_pm_profile_server() || - !cpu_feature_enabled(X86_FEATURE_CPPC)) { + amd_pstate_acpi_pm_profile_server()) { pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; } - ret = amd_pstate_set_driver(CONFIG_X86_AMD_PSTATE_DEFAULT_MODE); - if (ret) - return ret; - break; + /* get driver mode from kernel config option [1:4] */ + cppc_state = CONFIG_X86_AMD_PSTATE_DEFAULT_MODE; + } + + switch (cppc_state) { case AMD_PSTATE_DISABLE: + pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; case AMD_PSTATE_PASSIVE: case AMD_PSTATE_ACTIVE: case AMD_PSTATE_GUIDED: + ret = amd_pstate_set_driver(cppc_state); + if (ret) + return ret; break; default: return -EINVAL; @@ -1883,7 +1892,7 @@ static int __init amd_pstate_init(void) /* enable amd pstate feature */ ret = amd_pstate_enable(true); if (ret) { - pr_err("failed to enable with return %d\n", ret); + pr_err("failed to enable driver mode(%d)\n", cppc_state); return ret; }