From patchwork Tue Jul 2 17:15:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 809252 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E4CB1BE248; Tue, 2 Jul 2024 17:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719940551; cv=fail; b=TiOzzm6RgZKmmnX1/Tiv1M5appvrAIo6AC8TVYZ/Oa3XjZnpPOnskge26mtIs1t8SmSjzkZ62g/QkxJ5DyECD2uQ56iJwMG7G258GPoXrXXlkjLADrYUJaXm7Xm9AO6VRBYnr0mD9A2uM445if1ZHyUJ6PyVv50zpj9SGNyfybs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719940551; c=relaxed/simple; bh=yDSdeIXaHEWI0p+SVSp2OwVPdQbLc/kOng8lp3YQhiU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=cvdo+2qaAH9XEjrHDghf4+KOQbwFHpOCUQAgfLVeCAjZAmoESQlSxM1CDqJNOAEylRTGWC5GGIKyHU2sNsmUmJzHb96Xcocpe5bmqp2TLsSDw3kTbz4RMMQXPSmupBcKVd/NpBzxRvSxpdWRC/xns3Tkl/f4P2ZzkQIn0QhaWQw= 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=LP/7BBDn; arc=fail smtp.client-ip=40.107.243.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="LP/7BBDn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nxQ75zzA/Yi0scF2eYwJG7ERYGvegTvpjMxXbvbXBB9hJmX4ISjskycx1zYLQXkTVblj9PdjWlZ/YXxJRqSUgkbDqTPWJxU66ClG+gmmi1kvH+lzRLOYOkSZR+H6ZIMT2k4Tgrp19jzKL2Qx81CaFZ4+Ep/3TMXF4Hl5sn+jdT+IS/4Tod9xexMK/6duslut6vc4kOwlbahSslWIf5gu6GLU0+XL7k/PZUpyLvV9N4yzomqbjZroTykttCNDJCqF3cMzENuPlEqKKIZVrKHgAU1yLetay29o3ahgsTCQJkQkMha8AHT2TssUA1QoyVYrxbMYx3T+2kmHVlewdvm9lg== 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=efGjyeGz+CX9Gb5D6Ag6M6ahh59pFv68S0tThCAlAJo=; b=BHE+v/vLxVTkHRCBcoO15VS5lsZhvK2yIIRFyEps0O0GMEGEmaqysD1xg/ra2hXzaxkps3XqfNoObd8bYF/R0DzrqGmcb9VcFrfBWtDI0vVIdvzAyHRA24zmvsdd50YSG5F0QckSCpLdiPkmgV7WaVBhsJN+8Br4FXTwZdnyLTU3cdL0SBPddb203PIBm401ovGrbDtGbFJ+Og851cvlA1mL3r2YjtE+0yQKhY+NRs1jVlMtgLYA0+f5DBhQGaQDnQVWYnvXDavLU9VYwk6nKBjKlGF4hj/YWDcvRKUcuLCYF55XQBosO+TTZboQad3rh5lXjLxtlesz6lGCUS2J1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=efGjyeGz+CX9Gb5D6Ag6M6ahh59pFv68S0tThCAlAJo=; b=LP/7BBDnht2jpy7S8kewEV+coHdlvQs4CLtW+gOlom5SqV3sJHGCNug+5WWPJ8kqSsHKROxUd15SLBpHQe9GMvFhAQd/MM4aX+1dsYg+p4eWDSX6AIm6ONGbqSrXhJRm45YYiEsg7vBQ2X7jgHuM33Jp39saHO3YpfQPvZh9s9w= Received: from BN9PR03CA0275.namprd03.prod.outlook.com (2603:10b6:408:f5::10) by IA1PR12MB7709.namprd12.prod.outlook.com (2603:10b6:208:423::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Tue, 2 Jul 2024 17:15:41 +0000 Received: from BN1PEPF00004689.namprd05.prod.outlook.com (2603:10b6:408:f5:cafe::c9) by BN9PR03CA0275.outlook.office365.com (2603:10b6:408:f5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.23 via Frontend Transport; Tue, 2 Jul 2024 17:15:41 +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 BN1PEPF00004689.mail.protection.outlook.com (10.167.243.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7741.18 via Frontend Transport; Tue, 2 Jul 2024 17:15:41 +0000 Received: from AUS-HP-PV-STX4.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, 2 Jul 2024 12:15:40 -0500 From: Mario Limonciello To: "Gautham R . Shenoy" CC: Meng Li , Perry Yuan , "open list:AMD PSTATE DRIVER" , open list , Dhananjay Ugwekar , Mario Limonciello Subject: [PATCH 1/2] cpufreq/amd-pstate-ut: Don't check for highest perf matching on prefcore Date: Tue, 2 Jul 2024 12:15:14 -0500 Message-ID: <20240702171515.6780-1-mario.limonciello@amd.com> X-Mailer: git-send-email 2.45.2 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: BN1PEPF00004689:EE_|IA1PR12MB7709:EE_ X-MS-Office365-Filtering-Correlation-Id: ed11b728-fce5-44e5-4f95-08dc9aba99d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: NdnVK+6ip4lKT3CXE2oqVO/5EWaRfW2eYtTenbFdlAw7lNE0YwX0p8h8Rt9Uy1ZO/qkWZuUEdt1AUBKTiITOmnM9XhffhKvq5LIUbutJ0HIagQeFbJcRXkp3UFlUP5VmQbZE+Z8uProrag8M41UFH+fl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/XQC62OPLU19d6QCssGtxbq5wH4FPe2L+wL8/TeDBJS+fNROc4j2Z1NOdZCJCcNXqs9Q7VwazVaINDq+jfJDPGE2+JwM7lKC0InY6psUN/pZ7e9xFQMGzWCxsU7t6EWfNAuRpDY7CbBaxQFj3k2D6GlQf5GpJRFNRN3Jr5RDJEBTcKeVklNem3/wXH0xCNByW+aopOp1prt2hA63XiFl9ftFnacDDme4rPapzeAP6pRQ+F2dcfgxm8 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 17:15:41.4762 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed11b728-fce5-44e5-4f95-08dc9aba99d7 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: BN1PEPF00004689.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7709 If a system is using preferred cores the highest perf will be inconsistent as it can change from system events. Skip the checks for it. Fixes: e571a5e2068e ("cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically") Signed-off-by: Mario Limonciello Reviewed-by: Gautham R. Shenoy --- drivers/cpufreq/amd-pstate-ut.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index 66b73c308ce6..b7318669485e 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -160,14 +160,17 @@ static void amd_pstate_ut_check_perf(u32 index) lowest_perf = AMD_CPPC_LOWEST_PERF(cap1); } - if ((highest_perf != READ_ONCE(cpudata->highest_perf)) || - (nominal_perf != READ_ONCE(cpudata->nominal_perf)) || + if (highest_perf != READ_ONCE(cpudata->highest_perf) && !cpudata->hw_prefcore) { + pr_err("%s cpu%d highest=%d %d highest perf doesn't match\n", + __func__, cpu, highest_perf, cpudata->highest_perf); + goto skip_test; + } + if ((nominal_perf != READ_ONCE(cpudata->nominal_perf)) || (lowest_nonlinear_perf != READ_ONCE(cpudata->lowest_nonlinear_perf)) || (lowest_perf != READ_ONCE(cpudata->lowest_perf))) { amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL; - pr_err("%s cpu%d highest=%d %d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n", - __func__, cpu, highest_perf, cpudata->highest_perf, - nominal_perf, cpudata->nominal_perf, + pr_err("%s cpu%d nominal=%d %d lowest_nonlinear=%d %d lowest=%d %d, they should be equal!\n", + __func__, cpu, nominal_perf, cpudata->nominal_perf, lowest_nonlinear_perf, cpudata->lowest_nonlinear_perf, lowest_perf, cpudata->lowest_perf); goto skip_test; From patchwork Tue Jul 2 17:15:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 809687 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2041.outbound.protection.outlook.com [40.107.220.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E4D539847; Tue, 2 Jul 2024 17:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719940549; cv=fail; b=XV/TROSUGEXt6Khc9OvDQ2ALxffm8CFhHvIUTFBAtaguoknMP9G6SXe6FO0d9YnecFgZzZN2PsCxsx4n9X092zyf3NN50PDVxNvZhh3LdcTrSp5KjbpuW1QSxYM/KqpK6wUUdWkjJC7wa7+34WdbvYUTHsDzvqrI29Yr+0Y87Mo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719940549; c=relaxed/simple; bh=JSyctome7Q/ER7pvpY2HcB90c0i2zzjkO2W50rVd5sc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G+FKgsVxL4iL1l199X2XeeN5FCf+8N0y7Hix7uZlfIyRzGuBy4Ihj3wwTQFEUwyxqFaiS7ce/LV6WlWoSHCHNJVZyvlhfN1/3n8Yy1Xoa7661xriWGsw0P+g8nG2uAAQSQW65aa+1c+3zUShOGXz8hBhhRxSbBjpjdOmZdSP9r4= 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=QyIKz9c/; arc=fail smtp.client-ip=40.107.220.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="QyIKz9c/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1YY6OHYusumjr3IjoXuqvcv7wgUT/gD8h47neGSosVWHfd+tiZ9o+YoaHkZI5l9K8galXxgFcScTIJhsXUs5zpfwiFCu2j/11X/sISebBqCnEEz2NIMMB8v/S4y/JZRgrE4GyywqTBM+ZABVlbOT9kCZZ0g/QLIe9H+QjGVCIPbznUABAvJItnjvVzmiQrA2wVnkugIOE6fwmxzxnTtK48NnbIS5l+SAaW1Pypfdb07Zw2Lky2eiTzoLfUrNxYNlG+mD8W7upSTKIbCX/zUMoI4khh3y67LuFdaLYXAkI27B8vKEv1fEtqxSC30Y7lPgJohRubQkgMJmhn8zwZa1g== 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=akuk/IbNKF9jahPe0O5sO1uw4AsFWK+Z23BCbQlcMtk=; b=kK897d3UcVvuI1zJLIF+k63QkCC33HpVHx27FdbPjYc3snLsYdALU/Y2LW9h1NEVKNTFiHaqzYHcr4+q/XrK03l+Lt6bEQ0FAu1aUM7BvnykS9b6r0NaRRMvfiWwxD7HqYqCP5sXccb70GLCHEXPEy3k9EFdVVY3sMeohn9Mu1SvtEn/KMqHD3a7G7MCs+cgCvri+/1flROeMfGVIAzp7DZsSuH+QCkSLMlLo05lZBe8kiOXIy9soZoB8tJJ/7OgZYe5Nho4ZlaKOgxreFlfpiurHnze785hAE07MXBkRNZls5UGOguBFPE3K+Kf4BgWeTSSIqFWaE7Og7/mqisXkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=akuk/IbNKF9jahPe0O5sO1uw4AsFWK+Z23BCbQlcMtk=; b=QyIKz9c/OHAUMkoB42x6AzocdnW5xee1C9YP5UUKZvYUcssh+KZsn8/XDnJfAnXn7rCN+Zyc1ElGrr4ddR3zRJG8VVhGBQn1Ugq2kjWbrxkchx9iMFaNhGvHH3Kl4PG5OA3mJrOz4bul3ejy5PNv4VSWiKr+/M0ywrGFJthIAto= Received: from BN8PR15CA0055.namprd15.prod.outlook.com (2603:10b6:408:80::32) by CH3PR12MB9251.namprd12.prod.outlook.com (2603:10b6:610:1bd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Tue, 2 Jul 2024 17:15:44 +0000 Received: from BN1PEPF0000468E.namprd05.prod.outlook.com (2603:10b6:408:80:cafe::c4) by BN8PR15CA0055.outlook.office365.com (2603:10b6:408:80::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.33 via Frontend Transport; Tue, 2 Jul 2024 17:15:42 +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 BN1PEPF0000468E.mail.protection.outlook.com (10.167.243.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7741.18 via Frontend Transport; Tue, 2 Jul 2024 17:15:42 +0000 Received: from AUS-HP-PV-STX4.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, 2 Jul 2024 12:15:41 -0500 From: Mario Limonciello To: "Gautham R . Shenoy" CC: Meng Li , Perry Yuan , "open list:AMD PSTATE DRIVER" , open list , Dhananjay Ugwekar , Mario Limonciello Subject: [PATCH 2/2] cpufreq/amd-pstate-ut: Don't fail boost test case if CPB isn't supported Date: Tue, 2 Jul 2024 12:15:15 -0500 Message-ID: <20240702171515.6780-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240702171515.6780-1-mario.limonciello@amd.com> References: <20240702171515.6780-1-mario.limonciello@amd.com> 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: BN1PEPF0000468E:EE_|CH3PR12MB9251:EE_ X-MS-Office365-Filtering-Correlation-Id: 07c66a99-b6fc-4b0a-6b1c-08dc9aba9a6c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: Co23TOb0hXur0xCfurz9C5C1Ln1OXYG7v8MxVzru4yQrYJRHX4ENKEp1LkwX/GrBb0KEWruiiX1IJye+j8Q6HRvwt9L6iLzAiroMVfu8KFWAow2mYutpkEFAz140WcC6qJ/OAa7VyyfNeMamxTmuDqJIXNNBqC/FBPnrsidJa92eihUcYSHIpWQKD61F04fFK5homZEsN5CL/SbS9A8JEOzcZ4hDH0y6eR4OChuXyH/OgsWk/HjL9AEBHqOiwA5Dozb0f5cBb5rIc2M+L6YS5LELaYdQVY4hHoyhay/mZRzL4PJQowJEoyOk9qTi6PnCfNhwvNzm4CZP87FoxZpB/XEpv8YgBwmI89Myej5pRUFOrEej9gzAteWmsiT91nMpCCUJHIbaSvLSD0waQhiC8TXa8dV1j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.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 17:15:42.4377 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07c66a99-b6fc-4b0a-6b1c-08dc9aba9a6c 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: BN1PEPF0000468E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9251 cpudata->boost_supported will only be configured when a CPU actually supports core performance boost. Add an extra guard into the check to ensure it only runs when CPB is present. Fixes: 14eb1c96e3a3 ("cpufreq: amd-pstate: Add test module for amd-pstate driver") Signed-off-by: Mario Limonciello --- drivers/cpufreq/amd-pstate-ut.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index b7318669485e..b011c729fcba 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -232,21 +232,21 @@ static void amd_pstate_ut_check_freq(u32 index) goto skip_test; } - if (cpudata->boost_supported) { - if ((policy->max == cpudata->max_freq) || - (policy->max == nominal_freq_khz)) - amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS; - else { + if (cpu_feature_enabled(X86_FEATURE_CPB)) { + if (!cpudata->boost_supported) { + amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL; + pr_err("%s cpu%d must support boost!\n", __func__, cpu); + goto skip_test; + } + if ((policy->max != cpudata->max_freq) && + (policy->max != nominal_freq_khz)) { amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL; pr_err("%s cpu%d policy_max=%d should be equal cpu_max=%d or cpu_nominal=%d !\n", __func__, cpu, policy->max, cpudata->max_freq, nominal_freq_khz); goto skip_test; } - } else { - amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_FAIL; - pr_err("%s cpu%d must support boost!\n", __func__, cpu); - goto skip_test; + amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS; } cpufreq_cpu_put(policy); }