From patchwork Wed Feb 7 02:46:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 197707 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1961675dyb; Tue, 6 Feb 2024 18:47:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoKidYNJc5595klGhlRHYNduKCUdRoh6c146AfnciJUgnaO5dRJ2oznxyGSsqdgPpgqHyw X-Received: by 2002:a17:903:228e:b0:1d9:586d:5d81 with SMTP id b14-20020a170903228e00b001d9586d5d81mr3896937plh.47.1707274042952; Tue, 06 Feb 2024 18:47:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUvr1R9quO4RGTZbuM60swmAd8TrdE5jGY2HEw0og/Ij1ayAUM8GicigDTy39tDFRti3akZA1/Y0p7Bj7m4KZN6Z+Xsw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a17-20020a170902ecd100b001d8dd447a5dsi483021plh.453.2024.02.06.18.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:47:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55864-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=DS3OX2lo; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-55864-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55864-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B209E2825BC for ; Wed, 7 Feb 2024 02:47:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E238810A14; Wed, 7 Feb 2024 02:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="DS3OX2lo" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) (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 E8E13F9D6; Wed, 7 Feb 2024 02:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274010; cv=fail; b=B72YbUK6mlCQGfvrdHn2+U/R1pp4J16usKN1Y5sH5DdmzSUJImysdkHcfQjputv9qHtDfZ1gbVy1SoC9k0NsPXUvUqW9kjZ1ng3ITjZqQ1PPAaLYXOuaYUfEI54E3eTzsBbEhcTOBmadzKBdIfjVjgrtrtjJ/asGj0pbxtIk5mA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274010; c=relaxed/simple; bh=parJunbqZZM7FLADqKwaaiZMdZ97E7FxPQ3zim1LUl0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rfHdAXXmv0iDsHdQIWpH/T0ni/eZOz2dvONjJ32lXvGscY9yUDFQNGYJemWw24wB9HnSijtWyOKXs6g8hf2Gon/Gr8D4QGXIaOxKQK7Hb7MCNl6kaOXcMl/mi0lmMbE4VEeFsa3J6/IC0EkN7hTSJojQIammzvLG5MEE/PeWiuM= 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=DS3OX2lo; arc=fail smtp.client-ip=40.107.92.70 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=gStXT9MI8tzOMm7SHHenKd/xVuVutGIepo0LCPIGzPiew4+wwDgU1uJ457wm+koqszoUfGVjJYZ60grOXRQBDvNC2iCkOpwDIs7P3R5JV1eNezEp2yTbaq77OJ2zF+u6oldnzJSZy4ClC1IrF5WKBHawoT3oGzH5rpspx1/jWT3E7u+TzvGFfxP0Gvwez/IIRvlK9w6PsC9ZaatpabF5OG9yoUjPBFJfyc5+VcO7CMjVQstzpA2T+gWZqjuc0xDfU+1P8kW6JzULDRNpppvsdiW50v3T02SBXUUBHWjOLGgUMCVC6MK0vStx31ol/TvEWAd18FHXNXLplc9cvJHP5g== 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=K1QpCmGfGhowPUaMtKNBh5csgXHDS1etmh/Yo0jzAQY=; b=IL1uCqyknJ/HaoryPdnEuVdoUoBDQ4jg3HrfRoKRI1XVS6tAO/zTkulnf0mi/MQOCjn3pYHjQ5k0wOmXR8a0an/VRN0yGQnwzdEWoIgb2VpPZc71J0Z4Nn+hGlrls+n2J0uqBvrFsJ60HUfjOg0wxz+DNDTU9BsSRVejZt4hfY5GEDYfA1HW0cipVpE9uIgCzYNyVSMA1fW2Pxw+lGwtYbw3b35zf4JZKCoUs3KbPrQ3jH831j218VtBH06dRc2Adt3k+EJnUxqPR1zCDKpew6lTuM/nhW6sLlKDlXT999f7vH6HuTXy+1W6DR6qsLIfqtKHe9mTs2weRvWepIC4Vw== 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=K1QpCmGfGhowPUaMtKNBh5csgXHDS1etmh/Yo0jzAQY=; b=DS3OX2loiOSBzQG/90kMkx0H1L759baf+Ncg9XyVRQiPK5RXsRcatfUMxEuCKuFTJqH+nkfC2x1ypFfboRhst6LtQzAeTf6fvQpmTNe2v5tI75D22THX5n19BuRlYynanFMAes/gBsAT0EZM91SELtAtH1YrUdcBQqeCHIi9tPw= Received: from DM6PR06CA0067.namprd06.prod.outlook.com (2603:10b6:5:54::44) by CH2PR12MB4101.namprd12.prod.outlook.com (2603:10b6:610:a8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22; Wed, 7 Feb 2024 02:46:46 +0000 Received: from DS3PEPF000099E2.namprd04.prod.outlook.com (2603:10b6:5:54:cafe::cf) by DM6PR06CA0067.outlook.office365.com (2603:10b6:5:54::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Wed, 7 Feb 2024 02:46:46 +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 DS3PEPF000099E2.mail.protection.outlook.com (10.167.17.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:46: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.34; Tue, 6 Feb 2024 20:46:42 -0600 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 1/6] ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors Date: Wed, 7 Feb 2024 10:46:10 +0800 Message-ID: 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 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: DS3PEPF000099E2:EE_|CH2PR12MB4101:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b1d35db-6723-4416-a1d7-08dc2787067f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ap6SRI2sSTOEro9nA9fHPuRa7NvUp/93LZ9xlEhInrJoDD6LFHj747mQ43J+KwErC6nRiZbBWJPMD18IOu2DknZcJnjjfBI3j67zaeFOi4E63vMk310TsK6+vPVhZ7sa8gCHh4vt6H8Y92VVNvvYMhM14v8EL9/FbCc0PavANt4GEwHDJwyf0I556iAc1NBld8ffIpp+OzlaB/adAIYAssd2FmRSaeD88wtdctbLITYAahR6McOojIp/+YaeSlRZ2IuhbCZpcIghuW4/ek6jPpSd+a4dq04ujz3GmY8sVEneoRhmswChBn9/ZFAzBvPMOX5pxB9aJQ7y4nOcVUVSbTGMIgNdwyw3z0E1G2YbuM2XgX/BoDLr5bZGD875gPFje3VQZKsAmg/KmqxXVekpOH486nXH6+R18qqxGsleRmRYp8DRVfwRljDJpx1hCGj4dXZRzn/gobFZ0tn4pb4hbqTQo1iJvjC2OvYUQWQZ+rlSeLztWUhx9jNAvfTB3xhMxoiFWokoN2e9NUIud5PFqrgMg86iiDrHbFrQgDGXytBFlnY4HzEFzF+jIQNrIUYmtv2wJos8Y7wfr4usgSa9LQLM6t3env02PEF+JfWG2QT5cn2PonBqyJqt3GXyhOjs7yQzLswT5Q3fD+gojdWqTTMWpOx1PWYTjOC+gfUSAI/eKjrCFuUMBaeC9aCL/fff3KVID+wTgfWuhFHORjaom9LP8s26En80L/ZxEZH9VlHyLpa7YXZcGlWSPcaoduwwciAuGzknEiUPy08sEHGhBQ== 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)(4636009)(136003)(376002)(396003)(346002)(39860400002)(230922051799003)(230273577357003)(64100799003)(82310400011)(451199024)(1800799012)(186009)(36840700001)(46966006)(40470700004)(426003)(26005)(36860700001)(81166007)(44832011)(4326008)(2906002)(5660300002)(70586007)(6636002)(86362001)(316002)(54906003)(70206006)(8676002)(110136005)(6666004)(36756003)(966005)(7696005)(356005)(47076005)(8936002)(82740400003)(83380400001)(478600001)(336012)(41300700001)(40460700003)(40480700001)(2616005)(16526019)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:46:46.1926 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b1d35db-6723-4416-a1d7-08dc2787067f 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: DS3PEPF000099E2.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4101 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790206587146756079 X-GMAIL-MSGID: 1790206587146756079 As there are some AMD processors which only support CPPC V2 firmware and BIOS implementation, the amd_pstate driver will be failed to load when system booting with below kernel warning message: [ 0.477523] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled To make the amd_pstate driver can be loaded on those TR40 processors, it needs to match x86_model from 0x30 to 0x7F for family 17H. With the change, the system can load amd_pstate driver as expected. Reviewed-by: Mario Limonciello Reported-by: Gino Badouri Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218171 Fixes: fbd74d1689 ("ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory") Signed-off-by: Perry Yuan --- arch/x86/kernel/acpi/cppc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index 8d8752b44f11..ff8f25faca3d 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -20,7 +20,7 @@ bool cpc_supported_by_cpu(void) (boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f))) return true; else if (boot_cpu_data.x86 == 0x17 && - boot_cpu_data.x86_model >= 0x70 && boot_cpu_data.x86_model <= 0x7f) + boot_cpu_data.x86_model >= 0x30 && boot_cpu_data.x86_model <= 0x7f) return true; return boot_cpu_has(X86_FEATURE_CPPC); } From patchwork Wed Feb 7 02:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 197708 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1961778dyb; Tue, 6 Feb 2024 18:47:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDea6Onap4NUZYX3JnfYjDMFy/VkXHw4Qd5LkEpuctjDf42oLomxbzAbN5CR/yFuLLmRVK X-Received: by 2002:ac2:5508:0:b0:511:4cd7:7181 with SMTP id j8-20020ac25508000000b005114cd77181mr2862774lfk.62.1707274065359; Tue, 06 Feb 2024 18:47:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWp+aMqeAQ9UVDdlhGrpIT/dk/ehTbuGXWuiLmnAeUNAYHW5lVVag4JIpKAOUhAFnxPeC50GUnmZTTZuMR5QKzn50Bs3A== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lt22-20020a170906fa9600b00a3838011e4asi293744ejb.276.2024.02.06.18.47.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:47:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55866-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="UclWc/wo"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-55866-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55866-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C093A1F24926 for ; Wed, 7 Feb 2024 02:47:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32731134AC; Wed, 7 Feb 2024 02:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="UclWc/wo" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2053.outbound.protection.outlook.com [40.107.92.53]) (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 708951095C; Wed, 7 Feb 2024 02:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274015; cv=fail; b=c1Izr6mIHgXLZ7dowk5/VryCUcEjWRXJEVwDUdv3UZjY35oDqgUaM5A1WACVYpAfwurMfBKMWNLG6z7jv7LpMgYGklJxMA4S8vbG5mlk5vxHTTdfpqpjdcxXJHZrjg/PSeBKG0BjE7brEgJyoz62wfxpIa9gMafUnsnQJ8M6dZU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274015; c=relaxed/simple; bh=a7HUM9GDkpRgPggDObzXxL1tRHl/EW7CtZAkMKBnLBw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MaF70CW9EoDOMxwrDU/bBK9YtEhOr77eyQPIBh7yJdcTjx5LPPtLfibj7/B6cTYTcBNQIOnWSiNohVueMpHRbXjG/fWbsmLTQyn+p5Uxh6QuCqO0aK7CCHEYMMfh4Ug150UL+Mz74BmelGXsz/gG+8YxmeHXxKrGxF5ITFWWrI8= 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=UclWc/wo; arc=fail smtp.client-ip=40.107.92.53 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=JXo94/pzlNhpmDETTYmozzfWekLKqLY16Zeb2KnXp2g6Dy7s87OJoaZprSQrdzxoRoXEZKblVUPpYu/zZDfgz2+fZBIZU2bhFMn8uFTpO3GRqJCCTVEPyGkIfzVg2sJl+UhdMU6paOTV2T5fJbIJtyQ/OeLdEfYotDXA7RgkMHn0w90olcMWtvBo0akgzw6vE4JCCVxMR/3jB3v3RYhzPt+rbjrZcbolg3v1pZ4P3v8FvWfYU+BDMuRbnTQXpKGTPbaiaKt9NWzl96B0O1KsQD1QHIdtle0ZAM38IOqILEJJnl+cENaEoiQymi2GZJLuxM7xVWDEql/E7notHSBTLw== 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=wFgA1+hhdAvzSZ0OZkDcArmwSqv0z4KqbobNxKdpI6o=; b=VY0BadGAb6rts0wKVAN9CcwA3G/t9IgIse9J0V/MZTaXWwQkaiDMO6KthPKXlarY/Fca0Cc46SgI2XcAoBOf7ZYOocLtsOu5mkJLPGHV7fWh69fD/3pa3L4KfSEtrm2ztC6AiASCmV3o2YvFGUxGZmcmZ16lrPN9Ru+UjP2vaJpXjWwWwjIW3X2rOKw1cmc3F9PLsqd1LcwNXJheoFNUXAttH10MfTQl+xNcOV3QYgTKiUeddn/YOTQeJIL42NJikRBjf7pDftt8DEPfe9eh01APwXhaNOgNQuGp5Jm7agIKxk/j7GppnOGqs3UNQ9T6InWzxjy4wrsEPH8Iwdi24w== 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=wFgA1+hhdAvzSZ0OZkDcArmwSqv0z4KqbobNxKdpI6o=; b=UclWc/woiEHt4a6JiF2aSgQSKFLnhr1kjbJussxDnRltcB8FBx6byBs1dXBpHa0l+WJkalJPtI5LHR2Pay1mpkVObeFNlZPYYdTjlXl39HNZrY3k9I0ti+r2T8xddiYGizTmQorNScRail7gAlCPdbZQqGV41oB9K9HoKM0iG8Q= Received: from DM5PR07CA0050.namprd07.prod.outlook.com (2603:10b6:4:ad::15) by IA0PR12MB8086.namprd12.prod.outlook.com (2603:10b6:208:403::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.15; Wed, 7 Feb 2024 02:46:49 +0000 Received: from DS3PEPF000099DC.namprd04.prod.outlook.com (2603:10b6:4:ad:cafe::c9) by DM5PR07CA0050.outlook.office365.com (2603:10b6:4:ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Wed, 7 Feb 2024 02:46:49 +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 DS3PEPF000099DC.mail.protection.outlook.com (10.167.17.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:46: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.34; Tue, 6 Feb 2024 20:46:45 -0600 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 2/6] cpufreq:amd-pstate: fix the nominal freq value set Date: Wed, 7 Feb 2024 10:46:11 +0800 Message-ID: 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 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: DS3PEPF000099DC:EE_|IA0PR12MB8086:EE_ X-MS-Office365-Filtering-Correlation-Id: 848720d0-0ea9-4713-9d64-08dc27870894 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xuyBwKgj2MLK3sZnCDBSYlLnYKgJ5/+avG0QUpUsmJN84vPOo3/Z/RI1Bf4noMT1Tl2Wgp0F+Ib+SISanIxvdxGP0ARA9lFWd+PtoWyrm8bXjtkIn+yWTNOtI5D+uhdO5eCK6cLSv1N08QBKmOWM313NAf31thr9O9N9/WBRMCWceXr+EtF+XkDX6p2c/9AMjwBtGTGKXnhPFsdMIippyyG85jlZhBcdZjndDl1lUkqL/vm7Cu8EFPwaQMyuwWZqEQwt4W1zSY7r0CnkrkKgAywoXVOGyYSSnNDn5iNn3NK80kN+SOUdcl0Zy/TaMvZzkpSfm0Jt6HxMAy17Aka8y+XUsmot1qOTt55NPWhvUT5MDpbd3JvqdY95wahU03DTzNgJGNL2FfTwKELyjVPiwhOGeu2jcuKzDa3i8ySNqL8yLhxXznwecibUDuACi/Jz5HTm5FDvooZYbfcxwXyhNAd4rVPse2xWdW61h07C1/n7NaLlafuBiK0TJ/WWV/KWYGFeLbdr0+jocafFg/WmEirN9KGvNagBUcuzYtU2eeabhpkeAMg1N+3t4nyNir5hM1wj5U3iK58YSZ5qdDaFnWujzW+kwv1zx0D77R61m9mJuwISzY64CROMRXNWp8EK2pWQ5kxt40zivCTjyMibq4nplQip1m+7leIEy2PKqH8cYHz2xjysAfrwmYHvhLfXqnwCPSVYEwO4GBR77Y8TlZkiaiDfLsG5ucaR9IRTsNc3x80aNfT2IWHNawPnlqsxdnbFAWITgNr3Hqo7yecDLw== 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)(4636009)(396003)(346002)(376002)(136003)(39860400002)(230922051799003)(82310400011)(1800799012)(64100799003)(186009)(451199024)(40470700004)(36840700001)(46966006)(40480700001)(36756003)(40460700003)(6636002)(478600001)(83380400001)(336012)(81166007)(426003)(41300700001)(82740400003)(356005)(47076005)(26005)(16526019)(2616005)(5660300002)(4326008)(2906002)(36860700001)(44832011)(54906003)(7696005)(110136005)(70206006)(8936002)(6666004)(86362001)(70586007)(8676002)(316002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:46:49.5449 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 848720d0-0ea9-4713-9d64-08dc27870894 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: DS3PEPF000099DC.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8086 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790206610083700435 X-GMAIL-MSGID: 1790206610083700435 Address an untested error where the nominal_freq was returned in KHz instead of the correct MHz units, this oversight led to a wrong nominal_freq set and resued, it will cause the max frequency of core to be initialized with a wrong frequency value. Cc: stable@vger.kernel.org Fixes: ec437d71db7 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors") Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 08e112444c27..ac7faa98a450 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -640,8 +640,7 @@ static int amd_get_nominal_freq(struct amd_cpudata *cpudata) if (ret) return ret; - /* Switch to khz */ - return cppc_perf.nominal_freq * 1000; + return cppc_perf.nominal_freq; } static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata) From patchwork Wed Feb 7 02:46:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 197709 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1961936dyb; Tue, 6 Feb 2024 18:48:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSumU+GmASQHiLGxEPI2A4Hh/TpyQuYN+sUP3w5eTJHNv8XOcEgHkcFoUf9M0hZ7QxHQTe X-Received: by 2002:aa7:ce12:0:b0:560:1621:66ab with SMTP id d18-20020aa7ce12000000b00560162166abmr4868550edv.17.1707274093729; Tue, 06 Feb 2024 18:48:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV15HuDrRLE2lQI2mw1tS3uIQRY2Cd7eFuwwHvZQ7GvI9fTYfiUrLB6MBCu5ZBqMS+7z+njbLFEVXcKGmILFEGo2Niu4w== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u23-20020aa7d997000000b00560087f3e59si234219eds.177.2024.02.06.18.48.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:48:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55867-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=bDDw1EIx; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-55867-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55867-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 297F61F2575A for ; Wed, 7 Feb 2024 02:48:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF04A1B95B; Wed, 7 Feb 2024 02:47:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="bDDw1EIx" Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2057.outbound.protection.outlook.com [40.107.93.57]) (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 3E716125C7; Wed, 7 Feb 2024 02:46:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274019; cv=fail; b=Zy4vhjOHL23zqOFuvKQXFaX27frUO3Z5pWdPcisbjOjDorhy08IUycJ+VTQVqwfAk5BMh/tkPuUgbAKrp1sYdJRw3FNlNfu72poG51Ye+xbXGO8i3HZeio9RclcHG3E6sHkpc3ZgIo/1IEsUSri+5pq47//gqd2UXYO0jVE0Grw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274019; c=relaxed/simple; bh=i0/3Y1RcrmO1kxZ8mQEqBybxtj69hjageTPfY0V6nOk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UMDSPQfifydQE64O8KvPvWgUT1FcsfUPUmaQnUQ+fdfkxpMxlr7E/tza1FhfzHMb6rCwrTdZ1Q/qyeKRynP1M7kaYg9xErfb+stG/rngr0oZQ56HYtS6+/x2vEGL3nrCJMREr90LRXsewdl5I5UhNP+0LWh7uZJI9j6VJTcHaEk= 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=bDDw1EIx; arc=fail smtp.client-ip=40.107.93.57 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=K+0jGao7w8/GBj19umeJhBaBfkKsBFxZ5/KIjKzIe9GkOrkUBlrmtxMy3nnb7KuJFjCwk1HbW1reauyLAigCzyRzG9qZT/2wKM9oilvDOsGdcysZNeLl31CP7sgghbKh4/6e6+AljvYURDzjNDbCdrbxN+dws48DQvGJakawpelAEzVUuXqyFNDJ5QeV3i/SkbJUuZf9mNt0QlqLviE2Stkry4uMw9BBv4927QYXAfJmifT7naOf/2pDrye5swA1TdaTvNq0UQ07WTCAjgpnl3umLyUIFVOGwjMqsj4gFDdY9+2+3FMDoL0hp3ZUFNBoqaMpwD049TwodxisnRJ5Cw== 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=xJsNScROKFRLlT8Fo4CMnc5T+PlU3Oq4bkHlyx0RmNQ=; b=TJh7tVqYhEHVEbn+NqH0BOVqI2YLD7EMZEsU3+s5SQ4jXpRQOZ37jZD8e/OGRk58dft5GcJBmeJ43z48CREGtoVrsKHVDXMkvvKeuRxe41fjWeD45AmDP1qLN/8iast2Yn0QsqSvFzNOYoLOHmO5M5hTfFDIxB+Fk1TKbZfS9/QbLOW6/m1n1F6H8j0fxqKnqTtE4pGij/6FzZZVHcUUovAYwEUbXVU9yyWOb/gUYDiYTeEsG0ob0PgbiI9N4k1uv7WcK3mPH4pkHriuqU++V2mFOkcNJP0k3L0FvvNhP/vG7jxgw+CorDL5q9KyJ2nFw9sWGMYbcjEEyIsReB/qeg== 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=xJsNScROKFRLlT8Fo4CMnc5T+PlU3Oq4bkHlyx0RmNQ=; b=bDDw1EIxw9qA9pgVBNnribZpZrLXg6XdliRFkrpLkENr4JrwFhrMsWFdHwzepdW/zykIpeJDo4sBipL6ec6QGxUYlStyGR4Ii2HnBVBlzniRxpuLFFyLOENQ7dR+qryHpZQ5oqilRyZw7c7qH6DY+9c2awC41PEDPydZEy/gVTQ= Received: from CH0P220CA0007.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::15) by SJ0PR12MB7067.namprd12.prod.outlook.com (2603:10b6:a03:4ae::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.13; Wed, 7 Feb 2024 02:46:53 +0000 Received: from DS3PEPF000099DE.namprd04.prod.outlook.com (2603:10b6:610:ef:cafe::2d) by CH0P220CA0007.outlook.office365.com (2603:10b6:610:ef::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Wed, 7 Feb 2024 02:46:52 +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 DS3PEPF000099DE.mail.protection.outlook.com (10.167.17.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:46:52 +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.34; Tue, 6 Feb 2024 20:46:48 -0600 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 3/6] cpufreq:amd-pstate: initialize nominal_freq of each cpudata Date: Wed, 7 Feb 2024 10:46:12 +0800 Message-ID: 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 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: DS3PEPF000099DE:EE_|SJ0PR12MB7067:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ea48ecf-b828-4202-7e45-08dc27870a32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fxr/h04ChVU+0CgguyYHB3gXSCezG51NZIVasLgSHpNGoVikZj+bRF1Oymmci879jc/FhQ4I5CpLEHet8TJNI9EyF9suDUGm3wr3/prP3d+AzqijF0tw/DiQrzZuCZVs997VhS4lELeSeXTHgMtBXEaAsWTtlU2GzNcQJoUu0ug6fPp+k+ML2Z516uzAV+tawdbkSDGFbtxiNoHmxnHunvGc3uqy04DLbdBq+4DZa4fj4RrPM4TU8lW2O7M6eBjG9A/FHMon+hqTJYBRQtaHkwLZx644huqfHBGb7L27al1FxmD4OlGeWLR8f+LfrkNvexYhno9ErUqBdPFZVUA2NPtD4zZ/NeR0koOpTdnaD+Qpx7o/TQv7oNirmtILvajl6CTWNGgFJTyhWSXhYudw0D1lRAG4ZjO648g08gu6mujxsFlZieUz3r4iVUc0yWlxktVLxJS/o9kBCSNYlt0wygXA8bpTnmCf4iJR1mq48bMags1ynJ589ao7xjyy5NbbejPmhK8QSUemAilhcJF0nTcsOR2iDiHb5Dke5Tc489W+ByO7PjxhEVkb61MpO/EuPzUJ3uAh+hANXfbLdg9CgobACB7oWnEoQoVHq635noF/7+aEvNZTRp+FyeeHuse5vy09InmKKYEC0qbkNUZZjqwfxWU1t+gwHLftnfaeKBJ/EK7PCwhjQXoA7OpZXk90WqGdl9YQJEseINmcnvL1InPf8sCb3mDYD4zu9ddopQpVJIRG7bJb2a57lU8PcZeSsw5fUGCWnjEoWJjoKPs7IA== 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)(4636009)(346002)(39860400002)(396003)(136003)(376002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(82310400011)(36840700001)(46966006)(40470700004)(5660300002)(478600001)(8936002)(36756003)(70206006)(6666004)(316002)(2616005)(426003)(86362001)(70586007)(47076005)(110136005)(4326008)(6636002)(54906003)(336012)(26005)(36860700001)(41300700001)(8676002)(81166007)(16526019)(82740400003)(44832011)(7696005)(83380400001)(356005)(2906002)(40480700001)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:46:52.3667 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ea48ecf-b828-4202-7e45-08dc27870a32 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: DS3PEPF000099DE.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7067 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790206640356286828 X-GMAIL-MSGID: 1790206640356286828 Optimizes the process of retrieving the nominal frequency by utilizing 'cpudata->nominal_freq' instead of repeatedly accessing the cppc_acpi interface. To enhance efficiency and reduce the CPU load, shifted to using 'cpudata->nominal_freq'. It allows for the nominal frequency to be accessed directly from the cached data in 'cpudata' of each CPU. It will also slightly reduce the frequency change latency while using pstate driver passive mode. Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan --- 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 ac7faa98a450..ea8681ea3bad 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -619,7 +619,7 @@ static int amd_get_max_freq(struct amd_cpudata *cpudata) if (ret) return ret; - nominal_freq = cppc_perf.nominal_freq; + nominal_freq = READ_ONCE(cpudata->nominal_freq); nominal_perf = READ_ONCE(cpudata->nominal_perf); max_perf = READ_ONCE(cpudata->highest_perf); @@ -654,7 +654,7 @@ static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata) if (ret) return ret; - nominal_freq = cppc_perf.nominal_freq; + nominal_freq = READ_ONCE(cpudata->nominal_freq); nominal_perf = READ_ONCE(cpudata->nominal_perf); lowest_nonlinear_perf = cppc_perf.lowest_nonlinear_perf; @@ -848,13 +848,14 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) goto free_cpudata1; min_freq = amd_get_min_freq(cpudata); - max_freq = amd_get_max_freq(cpudata); nominal_freq = amd_get_nominal_freq(cpudata); + cpudata->nominal_freq = nominal_freq; + max_freq = amd_get_max_freq(cpudata); lowest_nonlinear_freq = amd_get_lowest_nonlinear_freq(cpudata); - if (min_freq < 0 || max_freq < 0 || min_freq > max_freq) { - dev_err(dev, "min_freq(%d) or max_freq(%d) value is incorrect\n", - min_freq, max_freq); + if (min_freq < 0 || max_freq < 0 || min_freq > max_freq || nominal_freq == 0) { + dev_err(dev, "min_freq(%d) or max_freq(%d) or nominal_freq(%d) is incorrect\n", + min_freq, max_freq, nominal_freq); ret = -EINVAL; goto free_cpudata1; } @@ -893,7 +894,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) cpudata->min_freq = min_freq; cpudata->max_limit_freq = max_freq; cpudata->min_limit_freq = min_freq; - cpudata->nominal_freq = nominal_freq; cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq; policy->driver_data = cpudata; @@ -1310,12 +1310,13 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) goto free_cpudata1; min_freq = amd_get_min_freq(cpudata); - max_freq = amd_get_max_freq(cpudata); nominal_freq = amd_get_nominal_freq(cpudata); + cpudata->nominal_freq = nominal_freq; + max_freq = amd_get_max_freq(cpudata); lowest_nonlinear_freq = amd_get_lowest_nonlinear_freq(cpudata); - if (min_freq < 0 || max_freq < 0 || min_freq > max_freq) { - dev_err(dev, "min_freq(%d) or max_freq(%d) value is incorrect\n", - min_freq, max_freq); + if (min_freq < 0 || max_freq < 0 || min_freq > max_freq || nominal_freq == 0) { + dev_err(dev, "min_freq(%d) or max_freq(%d) or nominal_freq(%d) is incorrect\n", + min_freq, max_freq, nominal_freq); ret = -EINVAL; goto free_cpudata1; } @@ -1328,7 +1329,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) /* Initial processor data capability frequencies */ cpudata->max_freq = max_freq; cpudata->min_freq = min_freq; - cpudata->nominal_freq = nominal_freq; cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq; policy->driver_data = cpudata; From patchwork Wed Feb 7 02:46:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 197714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1971908dyb; Tue, 6 Feb 2024 19:15:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGu8hT6Icx1eRepJQcjKCElYvZW6RRlax+iC5caD0OB8nBHm5HnZkwvPCwcVB/JHx/1ZSlt X-Received: by 2002:a05:6a21:2d07:b0:19b:81be:34e4 with SMTP id tw7-20020a056a212d0700b0019b81be34e4mr3859226pzb.50.1707275717402; Tue, 06 Feb 2024 19:15:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUe4KJjvhsYzKTqVwsnyG3M+XdBXSPINlduUKAksHhw1/XlB0lmSeUU1Js4IpwB3ol9wALfAKyjU4FmqYyL78I9rcioVw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t3-20020a170902d20300b001d8d6ff3f0esi501329ply.274.2024.02.06.19.15.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 19:15:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55868-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="Jds92u9/"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-55868-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55868-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0BE06B2987C for ; Wed, 7 Feb 2024 02:48:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35F8C125C7; Wed, 7 Feb 2024 02:47:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Jds92u9/" Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2067.outbound.protection.outlook.com [40.107.95.67]) (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 D395E13FF8; Wed, 7 Feb 2024 02:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274020; cv=fail; b=iR6tSUngYwchgZYQIo6kD6/nOvEvPAp2G5/beBCYEnm+jOU2xmJHWLWwzCwD8tK7RFT3ZPptrYKXSkiR4STHsNsE/w/Lr5qJ1sz3Kb2SczlG9SLxN80pN772EmBW6cpyRNX6EymX2Hq+4ajI3Vq4/Vig5DGnfJCg8712JvaN2nY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274020; c=relaxed/simple; bh=bWnyWjWQFuMjC204Y8elk5xFuwTMRESzd8hyhx49RVs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WW+QucE5aVi7yaT5k8PeFfGOpoOWVjJyxmXIcuzjaMDbPcGQinsDFaMRgPH0f6pg6sCS6G+DDSh2YmkfPjYF34C8NkTV4CkqSsRT4WIF7tKeQFdLxOroY+AL+W8OOtZuZixu3MvaQBuq2qVMMdEwR1NMdS5kpAe0m+Y7cFSvQbw= 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=Jds92u9/; arc=fail smtp.client-ip=40.107.95.67 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=fJ2/OTDUnO/bXCLgjoubWuQSCbCbGA3Z+To9QzQlNvbTIdTy163x21DzGKGW5Gylv5vdT190yl7yajIH5AetPnAwwSUvMxaHKm+uuekNlHaLHCqrk8KASb2f1dVVU+CrRbMJN0YKPzyqoY8l4hG/ui0z3wc8iAq7dPJyC1mMW/LMYW8FZ5c3txDks8yXKaolYZLguW0YOps8gVdv7jT891HpVgzL573rrIIQ4nWJTTRFsCNK6lhUmb40amGOio6B2Ii+VDA1zAo0RC0vr/MOsshjR+Ri+IV1Nsq1Er6arKZPQdZRNu3TkN5RjNxwtBaWeHS0s0k5/HRxpuxWY7UfIQ== 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=vdJ95iUPa8vjYVWMej24FSv5Oggyfd92h8+N+k2OMLY=; b=T7kXv3UILSz6CzmQLsdDvvvMjCg8+NM0E/FGvxxC5NTILvQJdLjg2DkDT08XOh0DDU8Sj1pr28ob6eBP9sCR/EeqxpsXKq5+d20lPO6vUJh3fNgpq5tf5Y0gSAda0PuVexhFsKeWQ1xBvDGMHUYMiP6Te/iem+J8DvW10Q3CZOkwbQHy2U3CX13UiJuHwAZWucar62WDW6o0Ew82eNyNz417rQDw4GM2LNgVRVM+5XIQ8r3rIwOh/yO/BenbOBDbOWcs4FPx8gvEoFFDCO/o1vR4uHJi65LOVaQK6ucV65uZtG8zf6SeKpy77dIm7jUIs3VUtzSftEYu9U4TAiJHcg== 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=vdJ95iUPa8vjYVWMej24FSv5Oggyfd92h8+N+k2OMLY=; b=Jds92u9/7BGw+TLbZVtWqifzug+cNKnOr1myn1TV4LSFLfsfBFmFU2tGrVqgHUnpXOzPtkP5xdikERHgCrSseKMFZniIpgooLLV3hCorIfdoSuVkUrboHY5OLVz3XIoTx7aRTHMo4IUc0CPgRq2E3Kozle2u1FSin8Q+bMsmQMo= Received: from DM5PR07CA0074.namprd07.prod.outlook.com (2603:10b6:4:ad::39) by SA3PR12MB9131.namprd12.prod.outlook.com (2603:10b6:806:395::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.17; Wed, 7 Feb 2024 02:46:55 +0000 Received: from DS3PEPF000099DC.namprd04.prod.outlook.com (2603:10b6:4:ad:cafe::25) by DM5PR07CA0074.outlook.office365.com (2603:10b6:4:ad::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.37 via Frontend Transport; Wed, 7 Feb 2024 02:46:55 +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 DS3PEPF000099DC.mail.protection.outlook.com (10.167.17.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:46:55 +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.34; Tue, 6 Feb 2024 20:46:51 -0600 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 4/6] cpufreq:amd-pstate: get pstate transition delay and latency value from ACPI tables Date: Wed, 7 Feb 2024 10:46:13 +0800 Message-ID: <4e21b25ed21e3718cade07d3f72eef1a96cd7135.1707273526.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 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: DS3PEPF000099DC:EE_|SA3PR12MB9131:EE_ X-MS-Office365-Filtering-Correlation-Id: 09a5c113-f485-4409-22bc-08dc27870c28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U/yDE3xECPWiYNnSwKrNBxDihGmIo33sAQLjVAXfgvq4kHL4Yrjk/NPljmrhaMI55fkgjDkpM7hNHP5kWfhSGzDhIEQMn04+DZMTtpfMDuXikxz/HuuRfhz+w1ZUL9trlapLuTAvzxJYl9UvUZenTDPPxyzRWzSg2ZSOaMoBsnSKI9jUChXeejMMz0dUogDN4E0MECA8erZd3/3j6+itK5oL7a6MugCC0PYM+mrxHspYmW6WClCXHmO1LuaupRR1G2/CQnwzp4SL4222PXhtnEPZ5UnsCaZRMM7wYhs1Ahy3wg+LE824uK6ECK0N2tDZkbJTbMNst+w8BWX8I+LRSrvlz1N2wJJvi3v/KewpT9bvrENIhK7YWbB3XC9gGIgISu1XyXTgel16rid92gU/zXfIL6/TIxscrpYGYDizUBfkstQ7Tg4M6XmCuowb8XVRIF38BqW9wUj6Wkm1dTj3Abt9p9sqYID00QtodI2hl9luoebCKab1TZQR1wr3WecljOUMTaxeWKG7MZ46GYkqpsQJtFyFtGx7IFEd48wYmBZuZZwZNX5OiXtjmS2hXpWF4kGcyLC1HKLo3L8j69L79Bb2J1+drNRpDD2hGhm0WjWCJiWTxzqfUXakGAiVgLaHZOBDViOIrUIdTZyvA9Gfw4HlZJKNC1zXjg1quiRooo3f1xqcN/TZVrYJL5OoH/h2JotocFoNku8jZFWU/lHBzu6UP4PPKH2eFEv/CiEZh1gzx40ysXsA51qLDyRXn2BWF+sEBxg56MFD7wA8irFOSA== 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)(4636009)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(1800799012)(451199024)(186009)(82310400011)(64100799003)(46966006)(40470700004)(36840700001)(86362001)(54906003)(26005)(16526019)(47076005)(83380400001)(426003)(2616005)(478600001)(36860700001)(82740400003)(81166007)(356005)(5660300002)(6666004)(336012)(6636002)(110136005)(4326008)(44832011)(8936002)(70586007)(2906002)(316002)(8676002)(70206006)(7696005)(36756003)(40460700003)(40480700001)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:46:55.6074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09a5c113-f485-4409-22bc-08dc27870c28 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: DS3PEPF000099DC.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9131 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790208342747794185 X-GMAIL-MSGID: 1790208342747794185 make pstate driver initially retrieve the P-state transition delay and latency values from the BIOS ACPI tables which has more reasonable delay and latency values according to the platform design and requirements. Previously there values were hardcoded at specific value which may have conflicted with platform and it might not reflect the most accurate or optimized setting for the processor. [054h 0084 8] Preserve Mask : FFFFFFFF00000000 [05Ch 0092 8] Write Mask : 0000000000000001 [064h 0100 4] Command Latency : 00000FA0 [068h 0104 4] Maximum Access Rate : 0000EA60 [06Ch 0108 2] Minimum Turnaround Time : 0000 Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index ea8681ea3bad..77effc3caf6c 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -820,6 +820,36 @@ static void amd_pstate_update_limits(unsigned int cpu) mutex_unlock(&amd_pstate_driver_lock); } +/** + * Get pstate transition delay time from ACPI tables that firmware set + * instead of using hardcode value directly. + */ +static u32 amd_pstate_get_transition_delay_us(unsigned int cpu) +{ + u32 transition_delay_ns; + + transition_delay_ns = cppc_get_transition_latency(cpu); + if (transition_delay_ns == CPUFREQ_ETERNAL) + return AMD_PSTATE_TRANSITION_DELAY; + + return transition_delay_ns / NSEC_PER_USEC; +} + +/** + * Get pstate transition latency value from ACPI tables that firmware set + * instead of using hardcode value directly. + */ +static u32 amd_pstate_get_transition_latency(unsigned int cpu) +{ + u32 transition_latency; + + transition_latency = cppc_get_transition_latency(cpu); + if (transition_latency == CPUFREQ_ETERNAL) + return AMD_PSTATE_TRANSITION_LATENCY; + + return transition_latency; +} + static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret; @@ -860,8 +890,8 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) goto free_cpudata1; } - policy->cpuinfo.transition_latency = AMD_PSTATE_TRANSITION_LATENCY; - policy->transition_delay_us = AMD_PSTATE_TRANSITION_DELAY; + policy->cpuinfo.transition_latency = amd_pstate_get_transition_latency(policy->cpu); + policy->transition_delay_us = amd_pstate_get_transition_delay_us(policy->cpu); policy->min = min_freq; policy->max = max_freq; From patchwork Wed Feb 7 02:46:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 197715 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1972063dyb; Tue, 6 Feb 2024 19:15:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyfuqij25UyQWcZBKYuLavwUm09T0d29fh52Rwqr1zlJnvtuf12Vcf7/37EYTSpP0KQYOQ X-Received: by 2002:aa7:88cf:0:b0:6e0:3d69:75ca with SMTP id k15-20020aa788cf000000b006e03d6975camr1914590pff.21.1707275745716; Tue, 06 Feb 2024 19:15:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXizvf19rOm6W71ytlJk+AtwDdvHmyrD7evv7q3/EGneSel22TUuW36XBduBx/VeclKs1aSl0E2jdMilLsGwd1WzELBKg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id r15-20020a632b0f000000b005dc12ad9959si448406pgr.144.2024.02.06.19.15.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 19:15:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=M+bvz+ep; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-55869-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55869-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 15D5DB2A90B for ; Wed, 7 Feb 2024 02:48:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB619F9FE; Wed, 7 Feb 2024 02:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="M+bvz+ep" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2084.outbound.protection.outlook.com [40.107.244.84]) (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 F3BD11CD22; Wed, 7 Feb 2024 02:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274039; cv=fail; b=SWgChxA+ypDLcJQ9Y4emF+A3e7uzYhG0DUFEUOpeWumsf24c5lFWy6bZWGbn0WxTVosFpsK/o8B20AyjK3StcoJJBowXbImDToAkbhKc9Lc38s+3LZBFyUVLmpPd+O2mZL5AW1Yr2GxGp2GpQPanRbYC5rBH53ZZu0BYpusP/iI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274039; c=relaxed/simple; bh=/faDvRJteyXqZPRAcoZKXoQ2KPMAH3/GzFGupp3EFhk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cZeD4goV8d2y1hi1PlE974dAxXqfebhmanj0iOwlEJFKr8vyHValrAUhuLVEQOcNY4tpOPqwKe9DZB9fu+yNM3wptpTTM2pFXQqq9h6E8MLIfGAGwpllyJC09sDp9LO5ZJSns2G9i8ziUc++E/U9Tfp5gCu2ByfYluHR3c06/Ro= 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=M+bvz+ep; arc=fail smtp.client-ip=40.107.244.84 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=Jd7/0Sm8JSXfUBvCovPttIBFBDA3x7qERmoAXbMUXyg7v84G0GRlCBX08bjM7WZr2G52m/68fAEpgsnqYOnyB910yRXGgntPaItBeEBWHZGbtQoyJhWt+fe+WRDv/fJM549WLMEqPGVh3ocxknrMXSx1bq4paNEM2ZpucHYljp2iP88wBZnQqOjp7RTUii+vbe/hEDvSE8bBjk41hOB6Gc/6QIeEC/kGte6Y6z5xZAMN8VAwDcpHs5s5/gclIbAO+aD+mVeIautIZah7Xr6gsrDYPLFK/w9FUS1tP3MaVzR03I9h6lyLtiZ3Kw7BAP4PCjVS7vv9sIZJGZpFR+mG8w== 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=Gy9SNyIn/2SjYTda9oDK5zWZekhmoOyMuf9jAWZS5R8=; b=RzeonIjzXUuB7IKo2MjfE8bq9dZVt9PhXZwfYNdPk6cQm2Yh4i/NfvzIe5FSpzWeVax8EFZS/hgEnUtTJnaXkyC83NKBBhqBCzC3D3onqKodE7HIxuBRELb4mfdLIJaNDRNyhTRgmXzqd3dD5TIKvyxwItb3XEOpoxZ2oaMNTTeZXxJUoEkG0xPqGfp+xhj7Hy/gjtfehLVuBeybFOgNkPv5/SdMsFYuEyV9NPVDEQoCHeBS8y29PjQxF39rAdADWLoSp4kFiBNta5s2teMpraH9z7LEL+ZMqZ6+n1P84tandQpiYaMQivV/XxAjYk0vi+MxfJAUS/mzVIC231JPew== 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=Gy9SNyIn/2SjYTda9oDK5zWZekhmoOyMuf9jAWZS5R8=; b=M+bvz+epJS9nlisX/LmfhdHQQBMKmHMnVYDMkQxuz81TadTw5O1qCO4RJkSpKjcKjVJyl/3DTsISx7mdk/Z6zBuTUV9MjuJg0CR/95iunzBWbDVFqUmU2w3xJ6SDeCdG+0EWK8KTu7pMwZ2UOXBNME4OX4wmHNsc2RE2kM7Fbg8= Received: from DS7PR07CA0009.namprd07.prod.outlook.com (2603:10b6:5:3af::9) by CH3PR12MB7642.namprd12.prod.outlook.com (2603:10b6:610:14a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.15; Wed, 7 Feb 2024 02:47:15 +0000 Received: from DS3PEPF000099DD.namprd04.prod.outlook.com (2603:10b6:5:3af:cafe::23) by DS7PR07CA0009.outlook.office365.com (2603:10b6:5:3af::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Wed, 7 Feb 2024 02:47: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 DS3PEPF000099DD.mail.protection.outlook.com (10.167.17.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:47: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.34; Tue, 6 Feb 2024 20:46:54 -0600 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 5/6] cppc_acpi: print error message if CPPC is unsupported Date: Wed, 7 Feb 2024 10:46:14 +0800 Message-ID: <2343f6c652bbcfad9cb462b5fd05fdb49e833e1f.1707273526.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 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: DS3PEPF000099DD:EE_|CH3PR12MB7642:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d129227-649c-46ad-6351-08dc278717f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +5lAthID1do5EgjC7lIJ44UwBqqRrZeIJ/ofUzJrEiOOHjgU3PSGvPKL52xCLBtI1bjR+wpVx+PIwsMl3luEuRZGHAMyJfQ9UFAuNZPR+fQAGKePbDHfKMGi4XrtwFIzL2ikM6k6l/dObGAZCzfVizn3wDo1RpPXr/fFrwLN8fBVUlLpsYMLGUNQ6owHcecsZRDf8LhRY69J74hxeLeiwmcB8tzW8H4J4LanG9tZq2uAHjOKqBHY/Q+R3ymU1YT5GJFHj4dZc0j8QCVXwQSoyjL5LreeNF+5bPIQ1AfPPMsR2BblaEkUJXlsT9c6M6gBUUZhFcdSSbft9R8Qz4kyy2NZSl036xmlOVINnGcAd7UjiJhKc20HaveHdnQ5A/5TQx6QatDNzmstOgOEULhD8riZnEjD63lFQkpDpTO8J97sdr3qT1NM+hM5cqKY36H2290S1aEycNESusYjmU1WZr0zDSX/L6n8jqPf3UDm0udLmZ1SGn6V6JICjh1RgvqYnL5LPSNxe8VKyF/E2fqCgJJsTfQWQael5vYWO4lArQUSCbm/6jKOA1fs8Az6+u9cd6t+Y4aCKj+UTQfIzq6d1sVsdmRxhuVBSVmS/6Hb+4T9n/eKpoybYK3fGI7As50NjUmE0rgs4zSil7e0q+/X9oj63THIpZsdCPJmfd/ZWlxu4bDOtoLpozspktNOvNid802EoqfZxnmwvOaBTMOr5yTlSlKLrgXA9UYEgwQtvWc3JQOax9YBcviaXtp9dR1IKqklUC2DVmDRE3+PTpTTIw== 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)(4636009)(376002)(136003)(346002)(396003)(39860400002)(230922051799003)(82310400011)(186009)(64100799003)(451199024)(1800799012)(36840700001)(40470700004)(46966006)(36756003)(40460700003)(40480700001)(41300700001)(86362001)(478600001)(81166007)(44832011)(336012)(2906002)(2616005)(356005)(83380400001)(47076005)(82740400003)(26005)(16526019)(6636002)(36860700001)(5660300002)(70206006)(7696005)(54906003)(426003)(15650500001)(110136005)(70586007)(8676002)(6666004)(316002)(8936002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:47:15.4074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d129227-649c-46ad-6351-08dc278717f5 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: DS3PEPF000099DD.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7642 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790208372157886264 X-GMAIL-MSGID: 1790208372157886264 to be more clear what is wrong with CPPC when pstate driver failed to load which has dependency on the CPPC capabilities. Add one more debug message to notify user if CPPC is not supported by the CPU, then it will be easy to find out what need to fix for pstate driver loading issue. [ 0.477523] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled Above message is not clear enough to verify whether CPPC is not supported. Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan --- drivers/acpi/cppc_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index a50e70abdf19..e23a84f4a50a 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -679,8 +679,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) if (!osc_sb_cppc2_support_acked) { pr_debug("CPPC v2 _OSC not acked\n"); - if (!cpc_supported_by_cpu()) + if (!cpc_supported_by_cpu()) { + pr_debug("CPPC is not supported by the CPU\n"); return -ENODEV; + } } /* Parse the ACPI _CPC table for this CPU. */ From patchwork Wed Feb 7 02:46:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 197710 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1962158dyb; Tue, 6 Feb 2024 18:48:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBPQ8hy5PpxmFx6KsLQFhMAdF56+oqkhgZGPhMy+gq7lOJPBgaANM/qyJ1P5rWC/70XXKZ X-Received: by 2002:a50:cddc:0:b0:55f:4d6a:c0ee with SMTP id h28-20020a50cddc000000b0055f4d6ac0eemr12075667edj.7.1707274135587; Tue, 06 Feb 2024 18:48:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqaM15J3GVHNP9b0oAdWMb/Tc+8mfhiSgaOVjmAPn2o9tgOlrx+ic8phk0Rxc5Oe/8VGiM9cBrq4UF4zfmkYM40D5e/A== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o24-20020a509b18000000b0055ee6dd668dsi239287edi.552.2024.02.06.18.48.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 18:48:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55870-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=X+ZUbVvo; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-55870-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55870-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0A7F61F2580B for ; Wed, 7 Feb 2024 02:48:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C0FA1CD31; Wed, 7 Feb 2024 02:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="X+ZUbVvo" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2074.outbound.protection.outlook.com [40.107.220.74]) (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 1CD6A10798; Wed, 7 Feb 2024 02:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274043; cv=fail; b=kK16pzzFM3cSrWL9BTJVxr8L3PvCWMFeOL7zlKziKCW8F9Vmp+hgR+puu/UhwHdkJjoHyg1115MnMiU+sbtVGYbCMQfpM/Ak29gHywZWNl0e4WSs4H+K4d2RJmjwGcG6E2QaAcQlIWsTx8QSnh2ptETUrsY1bustSsTZxHbZ10w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707274043; c=relaxed/simple; bh=vVLH9Y4avtMqsLpbArkJNPGM2pGlxgMd8pmaoIg1fvA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U1+nel/35XDYCd5Sy6Bff9nvbLXMY2Vxi0L5/WCDHyfsbJMYFKsoRTA/iOngPaDc5HotNCktM/9EuQXAYtptBHyNtY1bXexDiyzNnbm4MZvsrjNmFnhAw0B1fCDMq8/ym8Yh6f0SuCheimJ24C16H8GJuFVM0zD47lMwLAv23A8= 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=X+ZUbVvo; arc=fail smtp.client-ip=40.107.220.74 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=n0xI5ki0DCoBOiUJXn6fjeVBoqt2IJfIT9rJW8/K8Bbh1fWaGarpK6wWFS+YdwkoDAbPhIgk5pJ7Z/EI7gtCgCYLPIt56IAd4HIjuH1euwYCrGhm36kzDM+7SWfban8dNQTZV+YUmfzf8Ph4b2cad5AsoZyGGn3MIOKL4AN9m86DZOEtnMwp+p3OrJjtAsYFsVuU4KknyrwBQAzvKnJ619wUX6YSS4gykrb7UlAB3elEHL15Fa19gqNDd0RxHMGBzZZcGc9boNbyNIdbR0Wcp5pycFMDbQEE4qZQtZx54RYiDO3LGU+fHldBjWl4Ht0Sp4fcE0UQC8+fq7GWXyUjLQ== 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=/3wv2RIN1TAIAbuNVlpm5LnwJYzqinFJq8BTtbH0cP0=; b=DMagc/bWV5RfgizDNnJSAB507s557tq6ouLa9dlgDHzeVOcJLGZk4BR5bgx/cQm6vG0qXyJ6y+M8P2SOb/n3odjSg4IKPKdDypR1PuJc8vSN8UbsO8v4iQycarogkxt2tcmucG0yZlKv4NUPOgq5XV5epk7kLUSmmfKGMQXrzR3ADzW9J3GGA8tVi8rRqPegDvuc5nHE/ABvLW/ISc8acMll+pSFt4UPmCCocJhBR7DuXliARWd0V7Sc0QGUiF9/v/QjIQKvmuo5U6jQG909/Gbz7CIp7n6FK1ElpHWoTqmBxFTolbikmDwm9A55EWCYdiI3IKlzWQjlzAu/nlp9EA== 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=/3wv2RIN1TAIAbuNVlpm5LnwJYzqinFJq8BTtbH0cP0=; b=X+ZUbVvo7wtqmf61jzrba5jClfwQqgz8kWpUSkF30ooZiNXXO4rd84mpUUuivcpkv6uwLBqyrafLFTAd/b5HVG0bBi1qNXwduQ++VabiXfIXW/b/ib8WBxBihEUoWdX9/0pphYoeBBNdBJkvQEEpsO87KYlNO/Llmr+xLdGQN50= Received: from DS7PR07CA0024.namprd07.prod.outlook.com (2603:10b6:5:3af::6) by LV2PR12MB5822.namprd12.prod.outlook.com (2603:10b6:408:179::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Wed, 7 Feb 2024 02:47:20 +0000 Received: from DS3PEPF000099DD.namprd04.prod.outlook.com (2603:10b6:5:3af:cafe::cc) by DS7PR07CA0024.outlook.office365.com (2603:10b6:5:3af::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Wed, 7 Feb 2024 02:47:19 +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 DS3PEPF000099DD.mail.protection.outlook.com (10.167.17.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:47:19 +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.34; Tue, 6 Feb 2024 20:47:14 -0600 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v5 6/6] cpufreq:amd-pstate: add quirk for the pstate CPPC capabilities missing Date: Wed, 7 Feb 2024 10:46:15 +0800 Message-ID: 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 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: DS3PEPF000099DD:EE_|LV2PR12MB5822:EE_ X-MS-Office365-Filtering-Correlation-Id: 627705a4-749d-43b0-6a81-08dc27871a87 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: niTCSLM0UbMFOhkurTIO1HsG13qaLziPkVOjZao1P2X1bKQAAQ8zWZqBQWrFuSHRZWEwCL4r+oSX82DFW1wA/xwxCt/J0eCD3Lfzp7uInBnbcuPQ8pFu5jbye7xu7tR5w7WIXjmf79ZR8nVwKZDsUesboiUWoO0qPW01kHISOEkPq3jLm3wvUmXAb0zBG4+OpDvrjoEBcXEtQm0Bhe64iRZbnMyYBNug37aD2dqDEttqQXYQU2YcasqwXWtWP1WxkBcW3w8THh6Ajkg46U1cLjhri36E36rMvetz/F5Ey6Nje5iuf3sdyJ1DfO17IyfyohQ/Bva+lxmrzrdE1KTC08aSyu5dsdbPDY1RbpPBb4LfCfLGm6on7oi79Frb+uukOeuHC1S47ooNlL0D2Mofei5w8QGBzvHkPD126lH19as/qpNWoezxnePv1lr2Hd0UqcVu2YMhWu5DL+uHoFrAOzZKDAUQcU3cvFhMWLbgbeDu+oabV7TIpacasusU+Fj+AyWSc4weBGoyDNgpnPRDOXLLCXmglloTlTBXkpXjOGLMHTccFC35JRDlTOWRunUyTuuKCO43tYNrMtSHHdJ3xsANL4bhU3WA8+0zhSmo2dKWavCxHxvPFQjlwH1gIrlfHOhvQzuHY5ZK3/KTf+q+2HZ8ITR4gvKAKh+C8jpoz9MhdSL3yCF4UQ/yZ4pNHHnyXZqLdaqaYIS/c0utuaxx6P4Eimg+St5NDKTnt8Er0OvUDetQspokXaqkbDQoU4PwZoZaA6KBJU3BRF2IH2iJQA== 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)(4636009)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(186009)(82310400011)(64100799003)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(40480700001)(40460700003)(41300700001)(83380400001)(82740400003)(86362001)(16526019)(36756003)(70206006)(356005)(26005)(81166007)(2616005)(5660300002)(2906002)(47076005)(6636002)(336012)(54906003)(478600001)(426003)(36860700001)(4326008)(8676002)(70586007)(7696005)(316002)(44832011)(8936002)(110136005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:47:19.7355 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 627705a4-749d-43b0-6a81-08dc27871a87 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: DS3PEPF000099DD.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5822 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790206684301448806 X-GMAIL-MSGID: 1790206684301448806 Add quirks table to get CPPC capabilities issue fixed by providing correct perf or frequency values while driver loading. If CPPC capabilities are not defined in the ACPI tables or wrongly defined by platform firmware, it needs to use quick to get those issues fixed with correct workaround values to make pstate driver can be loaded even though there are CPPC capabilities errors. The workaround will match the broken BIOS which lack of CPPC capabilities nominal_freq and lowest_freq definition in the ACPI table. $ cat /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq 0 $ cat /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq 0 Signed-off-by: Perry Yuan Reviewed-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 57 ++++++++++++++++++++++++++++++++++-- include/linux/amd-pstate.h | 6 ++++ 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 77effc3caf6c..ff4727c22dce 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -67,6 +67,7 @@ static struct cpufreq_driver amd_pstate_epp_driver; static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; static bool amd_pstate_prefcore = true; +static struct quirk_entry *quirks; /* * AMD Energy Preference Performance (EPP) @@ -111,6 +112,41 @@ static unsigned int epp_values[] = { typedef int (*cppc_mode_transition_fn)(int); +static struct quirk_entry quirk_amd_7k62 = { + .nominal_freq = 2600, + .lowest_freq = 550, +}; + +static int __init dmi_matched_7k62_bios_bug(const struct dmi_system_id *dmi) +{ + /** + * match the broken bios for family 17h processor support CPPC V2 + * broken BIOS lack of nominal_freq and lowest_freq capabilities + * definition in ACPI tables + */ + if (boot_cpu_has(X86_FEATURE_ZEN2)) { + quirks = dmi->driver_data; + pr_info("Overriding nominal and lowest frequencies for %s\n", dmi->ident); + return 1; + } + + return 0; +} + +static const struct dmi_system_id amd_pstate_quirks_table[] __initconst = { + { + .callback = dmi_matched_7k62_bios_bug, + .ident = "AMD EPYC 7K62", + .matches = { + DMI_MATCH(DMI_BIOS_VERSION, "5.14"), + DMI_MATCH(DMI_BIOS_RELEASE, "12/12/2019"), + }, + .driver_data = &quirk_amd_7k62, + }, + {} +}; +MODULE_DEVICE_TABLE(dmi, amd_pstate_quirks_table); + static inline int get_mode_idx_from_str(const char *str, size_t size) { int i; @@ -600,13 +636,19 @@ static void amd_pstate_adjust_perf(unsigned int cpu, static int amd_get_min_freq(struct amd_cpudata *cpudata) { struct cppc_perf_caps cppc_perf; + u32 lowest_freq; int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf); if (ret) return ret; + if (quirks && quirks->lowest_freq) + lowest_freq = quirks->lowest_freq; + else + lowest_freq = cppc_perf.lowest_freq; + /* Switch to khz */ - return cppc_perf.lowest_freq * 1000; + return lowest_freq * 1000; } static int amd_get_max_freq(struct amd_cpudata *cpudata) @@ -635,12 +677,18 @@ static int amd_get_max_freq(struct amd_cpudata *cpudata) static int amd_get_nominal_freq(struct amd_cpudata *cpudata) { struct cppc_perf_caps cppc_perf; + u32 nominal_freq; int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf); if (ret) return ret; - return cppc_perf.nominal_freq; + if (quirks && quirks->nominal_freq) + nominal_freq = quirks->nominal_freq; + else + nominal_freq = cppc_perf.nominal_freq; + + return nominal_freq; } static int amd_get_lowest_nonlinear_freq(struct amd_cpudata *cpudata) @@ -1672,6 +1720,11 @@ static int __init amd_pstate_init(void) if (cpufreq_get_current_driver()) return -EEXIST; + quirks = NULL; + + /* check if this machine need CPPC quirks */ + dmi_check_system(amd_pstate_quirks_table); + switch (cppc_state) { case AMD_PSTATE_UNDEFINED: /* Disable on the following configs by default: diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index d21838835abd..7b2cbb892fd9 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -124,4 +124,10 @@ static const char * const amd_pstate_mode_string[] = { [AMD_PSTATE_GUIDED] = "guided", NULL, }; + +struct quirk_entry { + u32 nominal_freq; + u32 lowest_freq; +}; + #endif /* _LINUX_AMD_PSTATE_H */