Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp208650lqp; Tue, 11 Jun 2024 01:54:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXt5bggPn+Idz0/BmFu4xuRNvj3MWOV/TqTubUk10SGKBD4YUER5HL0CGj2dYVNa8/OJLOadqNj8n0UxCxdjWki0ApQRs1Ub+EWR/xZog== X-Google-Smtp-Source: AGHT+IFkKYkqHqZYEs2uSC5KFjqHBwM7JTc6I6AcaXrBbZCuqo9W9uvc68pRXV7ifiU6++dLZBs1 X-Received: by 2002:a05:620a:1a22:b0:795:4cdf:6481 with SMTP id af79cd13be357-7954cdf6611mr1264832185a.35.1718096043025; Tue, 11 Jun 2024 01:54:03 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7977e0eb12dsi341123485a.98.2024.06.11.01.54.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 01:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dAIiuVGy; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-209518-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 343BF1C23C85 for ; Tue, 11 Jun 2024 08:53:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17191176FCE; Tue, 11 Jun 2024 08:53:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="dAIiuVGy" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?p7qHh5u2VnLveiIFQN9NOHHSRIJSq5ztZ/4Nu0K5SqBzBwG9DSJjnDE8y7J+?= =?us-ascii?Q?NrqjkzunLtNfMvlwaRWyWIfVF41ru2POkJfcmC0jwjiJ/x7ByT9rz6F1SdEk?= =?us-asc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O2gnYQGEUvL+W+LYA?= =?us-ascii?Q?yn/HMgJbrIgVE0CSy1gHn8vgSPP3P7O51hjIW2QgToXd3IarM3J0AJyya2qS?= =?us-ascii?Q?3Y8+OmUQJ6ykFXbYBH3OkZn6ugETOrUVbR+RYxfVflQahJ7n2l7npwlKZKit?= =?us-ascii?Q?tSku4tdWGDdQsx9EV0N2f/ix0+uLAXPuZ8PIc329QQd4v7WXz8OZmkMLE5n2?= =?us-ascii?Q?vZimoNjT2fH/vyC3eZkF30hJd0B2HS7iEqNhQWUacwkUG1wTDvYZy97qMDec?= =?us-ascii?Q?aeQrd6JH2Mu0ZvKfMGxUqcxJ5V5J+0zPL1kbrdauF5vh08gCbMVj5ab7glQB?= =?us-ascii?Q?q3vNwn/N12xFBbS2DzHuw+oZiP39DbDOC+M3gQUCOLUAVdPJ499SGqWBf4lh?= =?us-ascii?Q?T859gyg=3D?= 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 --- 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; -- 2.34.1