From patchwork Thu Nov 7 07:27:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865934 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2041.outbound.protection.outlook.com [40.107.96.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 60B0C1957E2 for ; Thu, 7 Nov 2024 07:27:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964457; cv=fail; b=CUdQK9uc/x8CUyq6GdGsxPhjTa7NXDm8mLFoynVpiQ/SvGq4G1oTNmosScoDeJQk021ildJDh6mIAslPqlLuaK5UOuqlLIyJCZTKUubUgrlKBBOMC4Kp8XjPAgcJPhQiTCVT496IymHc2tPJ4JNLCTSfuwfNRIUKjPebdxRv368= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964457; c=relaxed/simple; bh=gRhBZ54O1RNpQRgM4NrC/4WrGDI9PPU6px2QeJ3DK8E=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MQnhRo2XeyxWVCouUWAhtyNLKq/KRisAPmQVKE0fMhKF5Z9l2rm7VHi3sFeC9fPZDOkoLxQoDy77OMR7AjgAKKvagTsfOtxaO8SncqPtzA3snwMi8N6wSUROkSEN5xpVRFBUZcF4ab/YSXHLMdapsKG7XtqfwdqWxqeLUt0KR80= 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=r1T/dfZz; arc=fail smtp.client-ip=40.107.96.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="r1T/dfZz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wW7stDpvqYxvxBktSaEjHO0gxUzCHvOcVB/Ixg/k/FFsVyhS+tqdWfRDP0UcPIvz55zEJd4B4jxxRtoa3jbbdWyrwDhuoxVsSEoBQ7fJJttOHrepbu/hPj960EQKKQIqlcdcVYk+VBMrRKkTQxPSxNGlXi9FIdYEWV+y+SyDtpn23rDCgxiMO+0J0AX+5dy+k+TNC9Z7AcLMNRl9LcHLZD1mO3ISpVD5g4VVnmLJpcLAFSSOKbROTzGXgxf5f6R1GsEQm/F5L/elKxN0QbvCTInTDS0Tfkgw4A4wfDhvn1ctdBq4ONFE6oyW/zUl5/9wPR/h+oVHwp/S5nJQTIFyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=+mSo4eapio26u44FeAWTTTcv7ZCbPaDLoFa54TUKevs=; b=WNVqRJVD4/4c9hXfFDuptzIvlqdKaX6avP421T7Kw5wNgAXMKvdgHWiBedlBKvnJTH9Sa+0Fx4QZUTGw7ezfA2X6Dh/ZBF3Jf5l+aaDPmrWqdiWCMUaOKDuVONKQcSspNfCIVbR7Ek/UBjbGOhhaprxHEM80ecUS1Sg2tHjzS2Xb+aWEK0W+4ja3EtHyvkjrsaNNkwvX7SNdzTo0x+EChkF6asgie1SpwVG2kBEbiA6+00BhC+epp2md6KLzg5N3l+Sh4LRpwGdbonBI6bbbR3H3uaZH9DI2C2Hku6AD9rVyLtKINTJUY3rHf5FUmmlRoAL90YZlF7BGUGUMdcU0DQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=+mSo4eapio26u44FeAWTTTcv7ZCbPaDLoFa54TUKevs=; b=r1T/dfZziIsnUI1lK6JN4y+MEcCaVFeCi0CXTSj4lpRR6MXdSoltiK4K17nJMg58TW0X6Q7s3h67eQ06zQ7EZUz4qDvALMXl52Id8pS0IRsnrCZAUFCv1179SfuCGIolUM1jf/yVpy/h17GGUYNq2tcRusRGasSbX2ASWeO6aSo= Received: from PH0PR07CA0030.namprd07.prod.outlook.com (2603:10b6:510:5::35) by PH8PR12MB6772.namprd12.prod.outlook.com (2603:10b6:510:1c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 07:27:33 +0000 Received: from SN1PEPF00036F3D.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::29) by PH0PR07CA0030.outlook.office365.com (2603:10b6:510:5::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 07:27:32 +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 SN1PEPF00036F3D.mail.protection.outlook.com (10.167.248.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:32 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:30 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 01/11] platform/x86/amd/pmc: Move STB block into amd_pmc_s2d_init() Date: Thu, 7 Nov 2024 12:57:04 +0530 Message-ID: <20241107072714.943423-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3D:EE_|PH8PR12MB6772:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c2f8568-965f-4bdc-5c2c-08dcfefda502 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: MBVSLLqukcWnFZSbSH34QqrnnAFMAiHPFNcRyTZeRuD1TJqjLrcq8FoU8l1RtQB53RsRh9+rTy7lsbVrN1VEKRAxagopKYrCiYmCB8vIimtcuRpSuyEjj5J4NrDO33ajSxyReUEALpOiGq7gr4hQ7izl09dRrdLroPcSeY03U48vTUj7N/xIOpc18g2h9N145dELhLiF7F4qZDRL0BliiaIUyfzphVCNez7QrDTbbVQtGkMr1oESHOfd5HY2c3VTVWHRB4uWfECMQTIwtC+fyJBN/7U/Lms+WZ5Ylt0IpTvaxC0GKHM0Um/rFz5UC5SyC3SWNMjStZVb3iUjHhb+B2lbGJc+ka23gqUOvqArTYuFJmjTB7d4mgLMSHBnSYxrCyiLL/0usGtPL2iBrLz7PcylogNtzpb9i2YFXS+dbk7kqOBKOl/RkwHbZ/MQBWDx9zuAC6aOLUH8lzJGSKd7dopzYpG74b5UP/7gsH0HqEcjpfL7B1xj9ZaJvXDaB/+nlXNiJPc5dHDOyTKWtg6gyWZWO5LgOZd/cEZtIHjR6oYMSL/OQEkY+6m5Pode+9mbR3WRXmqFkWWOzNjbkQFPIDADDbSIXgqJxuO3v3pWJYkYiI6m/w23D/mmOyWYSBVm3p/Sc2K5+4dJ8wnAW+TmmyrXpFQMVviCue603mwvaAYoAvQhzEFNHF4uvi/1rJyEkYASwmwXvxu4pZWCm3VlOzrcD9yyNVyFZOCNhC+229AqO9WVD/ZhO5c+8nB/OkY9tY71oMFbXO4/IfmxtxyNHhOVfIs+/Pzf7/zu8bV/WJC2fPz8rL2vO9DOah7fCx8qAdsvdibgVdchToi/SZqDLL+f32Mlyxjbl9S8s6hmx9hFRSXmnBJAd5Z7570bQ7dS0d0IQLMm+TN1YI5tkgbjx//HKdt1WEHGxxQk8+/BSYb2HddpJRntIVL43AjzeKpToGYf5Nl+6kyqB95JChCFUdDU51d3i588NdZxjNPLnm9zKM8oGwvcPRh32Qjuld8t19AbJd3UzLazFz+qTFssA/V5M4mcGsZ1rglbpYu+OQQaCd2+4po6H1tjLDNI117tOx+yKM0DqruEKVZgJPOsnrWmkMzCWFc2ruaiiXpBcYmRVQ0Dsan+ZBSc6v4XjAD8C4W2JzyQL9hxybsqTs9oymgbTQBZDnW/1t/f+htwgeNH12v8BvVJetpL5DY5CNXlb/MscA5BeH8pwWvoOvh95ZeZDUK/0EuF3e5XCdKCeHROZb6o7SEiUrEuVXYZvXd1qP7l+Ag2V98B5ktyVAwceYvl1u3w8YisT3mMYUwPBee2W712WNnz+kJoSDpHSOp+gseSlFsOYii39MHX0hVONTDrxMPbbrItJXPRPcvwZSdzTyXeUqtjOusnB/lcFGuItboelOfULU7lsvAejKRP/A== 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)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:32.7562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c2f8568-965f-4bdc-5c2c-08dcfefda502 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: SN1PEPF00036F3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6772 Transfer the support for STB-related file operations to the amd_pmc_s2d_init() function, thereby consolidating the STB and S2D (Spill to DRAM) functionality in one location. For older platforms that supported S2D, exit immediately after creating debugfs. These platforms may not support the PMFW messages available on newer platforms. This adjustment is necessary due to the relocation of debugfs creation into amd_pmc_s2d_init(). Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/pmc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index bbb8edb62e00..54ceb2f9bf56 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -648,15 +648,6 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev) &s0ix_stats_fops); debugfs_create_file("amd_pmc_idlemask", 0644, dev->dbgfs_dir, dev, &amd_pmc_idlemask_fops); - /* Enable STB only when the module_param is set */ - if (enable_stb) { - if (amd_pmc_is_stb_supported(dev)) - debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops_v2); - else - debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops); - } } static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) @@ -982,6 +973,15 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev) u32 size = 0; int ret; + if (amd_pmc_is_stb_supported(dev)) { + debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, + &amd_pmc_stb_debugfs_fops_v2); + } else { + debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, + &amd_pmc_stb_debugfs_fops); + return 0; + } + /* Spill to DRAM feature uses separate SMU message port */ dev->msg_port = 1; From patchwork Thu Nov 7 07:27:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865935 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) (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 26DD6196D9D for ; Thu, 7 Nov 2024 07:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964458; cv=fail; b=clFYGD10WwK+OD3RTuTc3F9uQmzGVpcNHcZt+PM8A9pSaKFwOwvuYM6fLXRElVoH5iw+0tT7JkE/4xDSy3pXDAyNJPhSOfIYzvjQiUaWMy62XSeB1MR3wz13TCLNqLbEZ+Mm7ZUKceR4LNgj1wq6Kj74KPh+hF/qmviTGv2mpx8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964458; c=relaxed/simple; bh=rD7vMsmapalbnGPg1jrxRVMKgIYEllVfd9AM/PPlEus=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bJRiWG31UwvS7zsh3HhE2WuXPbm49Eg0PRy/wfdCAnsrkB2wWZcbzzYXAs1LUlFjnHVT90iNn7I1741TZQbDN0wH0CjglmK16ApxeiDy+RAWfyEEbr9cQ130Y1O3m+8AcM39J6J5HPPOmZs1HR3XRNmL9aaHJ3XF0LUFJymMRNM= 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=GJTTHgOY; arc=fail smtp.client-ip=40.107.244.49 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="GJTTHgOY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rl3xiAqTN3zWrhz3K3n+4qnTKhN8XW4nD9KsnU0dZzCejtKUBhtKYo9L6SuBti7KXUqQKeLLJLZtS/I/OYTefH3uL6CmT9UYKtsaQ119ZDYGimOkHzzgoeeDlhxmN6cB3H7U5+RIXG+nuiFGI/Cecuy7VxCvQgLsQwBCkmS1Rt8CpIahAj/UF+yKD/OygWshF1nzdr1aD7ZcdkyQ3VK3+sozlX6sCDsPKoQ05IdZkbksW4ajL4iXrc9pFnERhCLN7WxqjD9XqlSYqCQydEPkIkCWFu7b3d7yYmcj1XKUFDuQgwLdMsi5W9XtSaxWa48K05Hm3Kfn15nhXeSDc2uLlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=B/Q20RiwkHVURWSriocR/wr6qlqdTsfOYuelVrrP0F4=; b=EmAYucohMLbrV8niuZN38OQyl9oaXJr1fOLIKKYruG1QDaX0/p+E4ygzelFdoKzH87U8aDjCEkTRtOTvf+W5kdopoBwIyKCFDN4d7qEzkHUVW6UDdNylAkC8MdVQB+xfZ/mz4OyU+vk4aKgKOEPGq3AXbKjiG4aQWh3WvAEFs/vvYlV+jRUglRff/2/VwVHLff6GRc++Oq7OaMiVpC/DEz7p5ophwl0oEz1jqkbXGx0ZCK2LUEAf6CfUNVdNlNOPWfXnYAOcRpEZVjamIum+Vjq1+pd0LoSq+Bv372Eetama87yP1vNurB1vIXui+fjObfO2f7XoHMNp5EACzdjPeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=B/Q20RiwkHVURWSriocR/wr6qlqdTsfOYuelVrrP0F4=; b=GJTTHgOYieQsqJNXqwC5U1iS3kSCGrkSSsqePkpWhieyrbHeGSc3872LB28LI19R6n1R+fDDgc3oB09fJd2jrdLVlefaVqQQUqOgQysiO6+g6SBDzYaEBAr9kYaE33zga0gnkYr+S+MMfpDJn1aItFEPAdcNorBIqmeZAN/+E/s= Received: from SN6PR16CA0037.namprd16.prod.outlook.com (2603:10b6:805:ca::14) by CH2PR12MB9519.namprd12.prod.outlook.com (2603:10b6:610:27c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 07:27:35 +0000 Received: from SN1PEPF00036F43.namprd05.prod.outlook.com (2603:10b6:805:ca:cafe::40) by SN6PR16CA0037.outlook.office365.com (2603:10b6:805:ca::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Thu, 7 Nov 2024 07:27:34 +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 SN1PEPF00036F43.mail.protection.outlook.com (10.167.248.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:34 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:32 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v4 02/11] platform/x86/amd/pmc: Invoke amd_pmc_s2d_init() Post Debugfs Registration Date: Thu, 7 Nov 2024 12:57:05 +0530 Message-ID: <20241107072714.943423-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F43:EE_|CH2PR12MB9519:EE_ X-MS-Office365-Filtering-Correlation-Id: 66cc48d4-2552-4f65-9645-08dcfefda632 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: l7X2SrTRhQmfAl2OXbXilLfTDOmWy+GZSQD28mqTbhhqEl1MEnUoJpic0ySDQ2P8Qswuwp+dMTl3SiMMGJg5ZC55XneH6YI6XNyZoaPlCVResZwdlkYK5AFXrd6WRKvJufCukrLBbBkpgien7yrDRYHYjjREKbChjWaYxVJH1GcWXwvIbYWL8NrHa7DCV85okpshfx9yb5TydnYfqcmPVeKVhdamP33/wOqH9kvjfCMoT0epWVBcZRP+3CX/cBGY5M85pvda+8n1HpGMvbO0L2j+B9QTKUysZ9XDR/11CXCPjWyvWZmcuWMilNhHJ1CPZP9KIjiAMX1xrk5l6I5EDS+rFIASLgpYwwD+u9G3+B3iHhWW8um86SJ0NuHRrLAQx4jje/nBiux6nLwdxqZdu1kTl1tL2KyfY2DyDFvN8bjPxbUbVuwDcvMQpIC2AEqBVXXDB3yBNayNAa1hw0oDIzoTFiOrouhoilXyyWrN1ToRzodwrB1ZThulERIPFGcjWC78e7fMC6GHcAkJZXXAdUDiKvSilKQOdLj2RiFFyROpUsC0hlhMtqrxy97j8yUaQEvV3kPrOEOeN8ovQzOze1lxK0OKaT4gfCIrnJV9rkcBkA7iD41GcJjEE1nrwWkWvP7Ta7azA+WYCjnkI4ygr3L9viGcdVHDuvvENNUo50g+SwqX5MXVvVZ6yncjWJL9quC0YcbLkmxJWlN5NHejwJMTh+nLfvWCMIiEehzQjXy7BzvbfeaxavJoj7h7IzxPH7ND5ztp6CpW/et9LetiUqIS/VDaQ4/2BEZ6N32tBrLDTlGFeOrYQpN9YiddA2J96dte+6W8d3r9kFi/S72u7vChi12pKzbeCspRFo8knxfF/JHsdiV5TE5PBxoKrSxMw/7wH3W+51ZIuqF3Gr4ylz5vsGG/Jf4NiPx8Z0csEkwwa/Snlnc6Z+ShEeiMQen12numl3sx40zCVplJK9rQDAWrqGhJ7+q5JUS8glQ846Iqg68pdcQKD9EvIqlw/E4JWfrz3TmxSyBhRStMTrKV7Y1kf6FWNO/av/Va9dImTRH4R4MykevYbPpcO6fUGBFRHiRX+UGGuJyVWtXlAd5d4Yzu5Za8r09A+EizLyTIPIxaa+x9qbupFhynILstZzEXBP8PM28MpwX1mwDC2bpaOqQZe4pjDO3M8oUDvx1LaEiFm3pRZJOy9lMWit1i8VD3JfsD60ms807SJdVf1DOSOC9JbSwyC8WxdUQr9x2xF6NFd3bMwduVluhKUsjk+n0wtXLHiAtD650QeLlqS8AGKoUrxjl0IVutbNkUkFPCumn3T1m6U04J5QiY9yZ7bb2Y59i4lMUo1mCNImOlkWaPeEo9mtaQzLeQLHFw712W8UdQHUAMPe8fKIZQlLnKGcp3yLk225p/dBYN88b7r/Yjgw== 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)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:34.7500 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66cc48d4-2552-4f65-9645-08dcfefda632 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: SN1PEPF00036F43.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB9519 Relocate the call to amd_pmc_s2d_init() to occur after the creation of the "amd_pmc" debugfs directory. This ensures that the driver's root debugfs directory is established beforehand. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/pmc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 54ceb2f9bf56..c89560f29607 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -1095,12 +1095,6 @@ static int amd_pmc_probe(struct platform_device *pdev) /* Get num of IP blocks within the SoC */ amd_pmc_get_ip_info(dev); - if (enable_stb && amd_pmc_is_stb_supported(dev)) { - err = amd_pmc_s2d_init(dev); - if (err) - goto err_pci_dev_put; - } - platform_set_drvdata(pdev, dev); if (IS_ENABLED(CONFIG_SUSPEND)) { err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); @@ -1111,6 +1105,12 @@ static int amd_pmc_probe(struct platform_device *pdev) } amd_pmc_dbgfs_register(dev); + if (enable_stb && amd_pmc_is_stb_supported(dev)) { + err = amd_pmc_s2d_init(dev); + if (err) + goto err_pci_dev_put; + } + if (IS_ENABLED(CONFIG_AMD_MP2_STB)) amd_mp2_stb_init(dev); pm_report_max_hw_sleep(U64_MAX); From patchwork Thu Nov 7 07:27:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865936 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2052.outbound.protection.outlook.com [40.107.100.52]) (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 6A706196D9D for ; Thu, 7 Nov 2024 07:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964462; cv=fail; b=i6mIZBT/9pgNR1SJPFNZotzgWxwrzKW+STv0DtulA5Bv3Ws/CO3turE/bgXGdgjOPDKPI71WSa10BfTYOr+s4dHAE28X8wgzbSGvbPqX6dQIAeITQP1Et5xzGJ1x+fDLQyDcUZeWVEaDHrj4P310tIklMhKcoGaSG31CWsttV90= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964462; c=relaxed/simple; bh=TFPxlAjTBYh7DGCXZiN2fsqx1BOS4dmEnKhJL4zMLKw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g4yOaVuqQMxhr282BDKmG+dqqgKe6uxt1rnP7yiOny7ZX6cYQ4gxgiBf1gpF/CFjXvyq55UiRnTc70wX6mc6UikxdfWeG8BpQ8dNIDQwf0AdlXAoFIxXGCf2uisWtRSthepyjy8JU7ZCpXmBMzs28Y9/UC7b3VHk6SSkG49u8KA= 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=fko0oc4g; arc=fail smtp.client-ip=40.107.100.52 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="fko0oc4g" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UUDRoN2o+zz88/xfS8BwE5BNUW3Mi4uuojeCPBGe7S2BLXLCd3etMvirrgQ2f+pvETAyirS1/1eNBHbkv4r8CD9fxspyCil9EjlW5oFUAbHKcu5cmwlpBdwujb2pJ25Xuyzy+3/IUytOee+HOdxC3Knuu1jYPIb8lL88I9yo5ckWphtju2AaUkJXroEnVejddxtz4dFxNTy/ZNGHjxZHLcW+cbOTOrn3KanqF4TZKGDu7mE9ezJF26G4IGH5MSdRJXNWMEEkCKs45dBHLCW5+4yIDU3uWgGmWhpKEtVZTXevpGYvaqP6NInKSa32K2wuHXVk0oOeF96PLZFjonPzUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=pbOhr9kKC1AGDIW3MkDsLHXeNzD2TtxWgzvhzQA3whc=; b=VU+ru4ZwtJajViJhyEESaf+SEVlCvIqQMXqdHu6SzNEgIhGSHlSv0A/zabrOnpR+inv8BPhkBndFuo8uObsg30fvtFu6vVkMc2B4+ijXtpHZx0mLK1B0vCX5MFpMpov4kj2Ct3OrI79SuB6YPU494Y5pkFUogmBKpX7SQ38YO/NUxiV4CM6HMRwb35Hd9Dy8mNS/kNVYwSVG+DOzN4V6KyxG2prnYerqP65049usa7m6n5xjds1/XI9XrXLq+EiTQeJU3K645m2f+oG64K6tc2ekaS2C8NkuZ/DwqLefls5rc/G/4I1t7CjRkAdCf1yrvmLfzl+y4kxA8Dph7bYdLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=pbOhr9kKC1AGDIW3MkDsLHXeNzD2TtxWgzvhzQA3whc=; b=fko0oc4gPwv5PqjeFeEk7kBJcQqGDuan2pRSQs1wggZscVsDdmjtk2MuJ4+F2WiLGOCOwO87bMoPINomf7JbGsk8g2iHcgC1UqjF9LNAwQ+4k7Eu/D8oJlRfY3fot6cF42LWuslxN86+Bmu63wEVCz46BO7CryZOhWLzxprXEoY= Received: from SN6PR16CA0040.namprd16.prod.outlook.com (2603:10b6:805:ca::17) by PH7PR12MB7283.namprd12.prod.outlook.com (2603:10b6:510:20a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.33; Thu, 7 Nov 2024 07:27:37 +0000 Received: from SN1PEPF00036F43.namprd05.prod.outlook.com (2603:10b6:805:ca:cafe::3) by SN6PR16CA0040.outlook.office365.com (2603:10b6:805:ca::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Thu, 7 Nov 2024 07:27:37 +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 SN1PEPF00036F43.mail.protection.outlook.com (10.167.248.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:37 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:34 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v4 03/11] platform/x86/amd/pmc: Move STB functionality to a new file for better code organization Date: Thu, 7 Nov 2024 12:57:06 +0530 Message-ID: <20241107072714.943423-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F43:EE_|PH7PR12MB7283:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e107815-6939-4efd-bf08-08dcfefda7c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: fbUx0s5CXXnz17XlGFi7WsHVriiq4sfLw3ZNZ65FA1cS/3ZU2WWOCv7uvdt8sTOBlp+HpVvrRAF0C6KdirnFm/oAfy7RVpFXUYkakPF81ZGbOnDQjhhPkAeZxMV4rtZFKrmgyqzk0W4uXGsiHBFea36nAHn+WjeQucqx0pdewnRd6Jj6Nr1pVwO3d0Xfm/7RE+cvbYer7rT27Jp7sgewMJZPwYayW9PFn++mKwo0MNh5ICXQ/POzYgDeuN9ytqeFOdiOzrMWowWv3XoO14hV1jXDo9uma8zrTgGTL1r5TzTfjU1UMEPz0K7t4LdugCTqDjBFVoS+ngC1ZQbxRIpnVnXzDfo500KQtnXnRGkaPeVxDLZ/OhxvjdZQC8N3LBOSQnyXWc3fdeJB5nUNLNB9tyD/4ynsKyYqkVjgnj1hfU9xVmOTV60Hvf34nQLev93aF8msf7HyG42+pe+fj/kzShf12221TYB9C8TFiM/pHBpat3F+rcD+mzB78BLULIEEvFtJqRiC0KN4wgcdUaMRAKj7hQHxPXd/oZ3R+vQzjW52T+8AbYEfFxq2UCfKJWoyZVm7hq6kgdA/oHY5+EXAIH3YX8WeBoI7SQR21D16LfLdVbTtZXjVQlQ0XdYdrBEaceWtXa5NZ/Bt7JOt6dUAtp36rVjQrGoi7ADAhrtReJKMln+SMZXtKBBEumSgZ9eM4zhY+gZRtJ31KzdDX8u4biOEDJlT+SPWRlJFBoaGCaXM015vWcynDgozxpTUDL2dflmQBZnTMV85+27G+eQJKzQDPwNfvzbROv0kzLN3UCTuA49WDLfsN0l4P/7AHf2XZ1ghuEzeMxHrrt6jnaPxvRYQgVoBNmdTMqiVPemsnMbItqYwWDCnonrPh7ZLY7xVf3sqECkd3hiJxxDNMfNSCzv2909KGweEzBNnlITeGk0HrMP1YW4GOUz8UNa/lbsghTwTYgjfHV9sTKEggWfvV/FPKtfgWLHxVS/0g3TNSSGHvGKrstw6dwOKjeebLzFsyuWYywikDWIn3N4Pcv5YB0UuGcm92YLdHW8hQ8qszlkddhyUeaqK1GX2y3yzA7MeKP/cER0Ld1QJabFiRvD62zr20Lih35SpPfSdFum57zl7iaEyp7VP7Rx2cjEIlNtojNZ5ZWeuZaFibJtSFobeBqh0gOAH97zbkQsFlzMJBbV6zK5qztBj97Xcgul+KoWnCxdbWdwJ3hL+k7zydVMy5Pd47oLhflrke8LGiEsZ/JnhfdMcoUhDft8X6MF4lek8+T4UpNyJ/jAtOvFQ1MCAhdbbjwtrn7Y8aimXMGTQQPlqdrz0M9RRzDZwDqjkkGtykzHwWjUP6xTDSOOEN0acuhn2qONw8rytnQVqEkIFn/5cgoVC+W4NWWnr9b6AgItRiC5pap2sEIvtVpEkdosw+Q== 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)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:37.3438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e107815-6939-4efd-bf08-08dcfefda7c0 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: SN1PEPF00036F43.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7283 As the SoC evolves with each generation, the dynamics between the PMC and STB layers within the PMC driver are becoming increasingly complex, making it challenging to manage both in a single file and maintain code readability. Additionally, during silicon bringup, the PMC functionality is often enabled first, with STB functionality added later. This can lead to missed updates in the driver, potentially causing issues. To address these challenges, it's beneficial to move all STB-related changes to a separate file. This approach will better accommodate newer SoCs, provide improved flexibility for desktop variants, and facilitate the collection of additional debug information through STB mechanisms. Also the additional checks for entering s2d_init have been moved from the PMC probe to amd_pmc_s2d_init(). This adjustment makes more sense following the transfer of code to the separate mp1_stb.c file. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/Makefile | 2 +- drivers/platform/x86/amd/pmc/mp1_stb.c | 296 +++++++++++++++++++++++++ drivers/platform/x86/amd/pmc/pmc.c | 283 +---------------------- drivers/platform/x86/amd/pmc/pmc.h | 5 + 4 files changed, 306 insertions(+), 280 deletions(-) create mode 100644 drivers/platform/x86/amd/pmc/mp1_stb.c diff --git a/drivers/platform/x86/amd/pmc/Makefile b/drivers/platform/x86/amd/pmc/Makefile index f1d9ab19d24c..255d94ddf999 100644 --- a/drivers/platform/x86/amd/pmc/Makefile +++ b/drivers/platform/x86/amd/pmc/Makefile @@ -4,6 +4,6 @@ # AMD Power Management Controller Driver # -amd-pmc-objs := pmc.o pmc-quirks.o +amd-pmc-objs := pmc.o pmc-quirks.o mp1_stb.o obj-$(CONFIG_AMD_PMC) += amd-pmc.o amd-pmc-$(CONFIG_AMD_MP2_STB) += mp2_stb.o diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c new file mode 100644 index 000000000000..29e0241190e4 --- /dev/null +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -0,0 +1,296 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * AMD MP1 Smart Trace Buffer (STB) Layer + * + * Copyright (c) 2024, Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Authors: Shyam Sundar S K + * Sanket Goswami + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include + +#include "pmc.h" + +/* STB Spill to DRAM Parameters */ +#define S2D_TELEMETRY_DRAMBYTES_MAX 0x1000000 +#define S2D_TELEMETRY_BYTES_MAX 0x100000U +#define S2D_RSVD_RAM_SPACE 0x100000 + +/* STB Registers */ +#define AMD_PMC_STB_PMI_0 0x03E30600 +#define AMD_PMC_STB_DUMMY_PC 0xC6000007 + +/* STB Spill to DRAM Message Definition */ +#define STB_FORCE_FLUSH_DATA 0xCF +#define FIFO_SIZE 4096 + +static bool enable_stb; +module_param(enable_stb, bool, 0644); +MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); + +static bool dump_custom_stb; +module_param(dump_custom_stb, bool, 0644); +MODULE_PARM_DESC(dump_custom_stb, "Enable to dump full STB buffer"); + +enum s2d_arg { + S2D_TELEMETRY_SIZE = 0x01, + S2D_PHYS_ADDR_LOW, + S2D_PHYS_ADDR_HIGH, + S2D_NUM_SAMPLES, + S2D_DRAM_SIZE, +}; + +struct amd_pmc_stb_v2_data { + size_t size; + u8 data[] __counted_by(size); +}; + +int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) +{ + int err; + + err = amd_smn_write(0, AMD_PMC_STB_PMI_0, data); + if (err) { + dev_err(dev->dev, "failed to write data in stb: 0x%X\n", AMD_PMC_STB_PMI_0); + return pcibios_err_to_errno(err); + } + + return 0; +} + +int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) +{ + int i, err; + + for (i = 0; i < FIFO_SIZE; i++) { + err = amd_smn_read(0, AMD_PMC_STB_PMI_0, buf++); + if (err) { + dev_err(dev->dev, "error reading data from stb: 0x%X\n", AMD_PMC_STB_PMI_0); + return pcibios_err_to_errno(err); + } + } + + return 0; +} + +static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) +{ + struct amd_pmc_dev *dev = filp->f_inode->i_private; + u32 size = FIFO_SIZE * sizeof(u32); + u32 *buf; + int rc; + + buf = kzalloc(size, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + rc = amd_pmc_read_stb(dev, buf); + if (rc) { + kfree(buf); + return rc; + } + + filp->private_data = buf; + return rc; +} + +static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, + loff_t *pos) +{ + if (!filp->private_data) + return -EINVAL; + + return simple_read_from_buffer(buf, size, pos, filp->private_data, + FIFO_SIZE * sizeof(u32)); +} + +static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp) +{ + kfree(filp->private_data); + return 0; +} + +static const struct file_operations amd_pmc_stb_debugfs_fops = { + .owner = THIS_MODULE, + .open = amd_pmc_stb_debugfs_open, + .read = amd_pmc_stb_debugfs_read, + .release = amd_pmc_stb_debugfs_release, +}; + +/* Enhanced STB Firmware Reporting Mechanism */ +static int amd_pmc_stb_handle_efr(struct file *filp) +{ + struct amd_pmc_dev *dev = filp->f_inode->i_private; + struct amd_pmc_stb_v2_data *stb_data_arr; + u32 fsize; + + fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; + stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); + if (!stb_data_arr) + return -ENOMEM; + + stb_data_arr->size = fsize; + memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); + filp->private_data = stb_data_arr; + + return 0; +} + +static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) +{ + struct amd_pmc_dev *dev = filp->f_inode->i_private; + u32 fsize, num_samples, val, stb_rdptr_offset = 0; + struct amd_pmc_stb_v2_data *stb_data_arr; + int ret; + + /* Write dummy postcode while reading the STB buffer */ + ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC); + if (ret) + dev_err(dev->dev, "error writing to STB: %d\n", ret); + + /* Spill to DRAM num_samples uses separate SMU message port */ + dev->msg_port = 1; + + ret = amd_pmc_send_cmd(dev, 0, &val, STB_FORCE_FLUSH_DATA, 1); + if (ret) + dev_dbg_once(dev->dev, "S2D force flush not supported: %d\n", ret); + + /* + * We have a custom stb size and the PMFW is supposed to give + * the enhanced dram size. Note that we land here only for the + * platforms that support enhanced dram size reporting. + */ + if (dump_custom_stb) + return amd_pmc_stb_handle_efr(filp); + + /* Get the num_samples to calculate the last push location */ + ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); + /* Clear msg_port for other SMU operation */ + dev->msg_port = 0; + if (ret) { + dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); + return ret; + } + + fsize = min(num_samples, S2D_TELEMETRY_BYTES_MAX); + stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); + if (!stb_data_arr) + return -ENOMEM; + + stb_data_arr->size = fsize; + + /* + * Start capturing data from the last push location. + * This is for general cases, where the stb limits + * are meant for standard usage. + */ + if (num_samples > S2D_TELEMETRY_BYTES_MAX) { + /* First read oldest data starting 1 behind last write till end of ringbuffer */ + stb_rdptr_offset = num_samples % S2D_TELEMETRY_BYTES_MAX; + fsize = S2D_TELEMETRY_BYTES_MAX - stb_rdptr_offset; + + memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr + stb_rdptr_offset, fsize); + /* Second copy the newer samples from offset 0 - last write */ + memcpy_fromio(stb_data_arr->data + fsize, dev->stb_virt_addr, stb_rdptr_offset); + } else { + memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); + } + + filp->private_data = stb_data_arr; + + return 0; +} + +static ssize_t amd_pmc_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, + loff_t *pos) +{ + struct amd_pmc_stb_v2_data *data = filp->private_data; + + return simple_read_from_buffer(buf, size, pos, data->data, data->size); +} + +static int amd_pmc_stb_debugfs_release_v2(struct inode *inode, struct file *filp) +{ + kfree(filp->private_data); + return 0; +} + +static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { + .owner = THIS_MODULE, + .open = amd_pmc_stb_debugfs_open_v2, + .read = amd_pmc_stb_debugfs_read_v2, + .release = amd_pmc_stb_debugfs_release_v2, +}; + +static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) +{ + switch (dev->cpu_id) { + case AMD_CPU_ID_YC: + case AMD_CPU_ID_CB: + dev->s2d_msg_id = 0xBE; + return true; + case AMD_CPU_ID_PS: + dev->s2d_msg_id = 0x85; + return true; + case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: + case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: + dev->s2d_msg_id = 0xDE; + return true; + default: + return false; + } +} + +int amd_pmc_s2d_init(struct amd_pmc_dev *dev) +{ + u32 phys_addr_low, phys_addr_hi; + u64 stb_phys_addr; + u32 size = 0; + int ret; + + if (!enable_stb) + return 0; + + if (amd_pmc_is_stb_supported(dev)) { + debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, + &amd_pmc_stb_debugfs_fops_v2); + } else { + debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, + &amd_pmc_stb_debugfs_fops); + return 0; + } + + /* Spill to DRAM feature uses separate SMU message port */ + dev->msg_port = 1; + + amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); + if (size != S2D_TELEMETRY_BYTES_MAX) + return -EIO; + + /* Get DRAM size */ + ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); + if (ret || !dev->dram_size) + dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; + + /* Get STB DRAM address */ + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); + + stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); + + /* Clear msg_port for other SMU operation */ + dev->msg_port = 0; + + dev->stb_virt_addr = devm_ioremap(dev->dev, stb_phys_addr, dev->dram_size); + if (!dev->stb_virt_addr) + return -ENOMEM; + + return 0; +} diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index c89560f29607..6ebb9123ba00 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -40,25 +40,15 @@ #define AMD_PMC_SCRATCH_REG_1AH 0xF14 /* STB Registers */ -#define AMD_PMC_STB_PMI_0 0x03E30600 #define AMD_PMC_STB_S2IDLE_PREPARE 0xC6000001 #define AMD_PMC_STB_S2IDLE_RESTORE 0xC6000002 #define AMD_PMC_STB_S2IDLE_CHECK 0xC6000003 -#define AMD_PMC_STB_DUMMY_PC 0xC6000007 /* STB S2D(Spill to DRAM) has different message port offset */ #define AMD_S2D_REGISTER_MESSAGE 0xA20 #define AMD_S2D_REGISTER_RESPONSE 0xA80 #define AMD_S2D_REGISTER_ARGUMENT 0xA88 -/* STB Spill to DRAM Parameters */ -#define S2D_TELEMETRY_BYTES_MAX 0x100000U -#define S2D_RSVD_RAM_SPACE 0x100000 -#define S2D_TELEMETRY_DRAMBYTES_MAX 0x1000000 - -/* STB Spill to DRAM Message Definition */ -#define STB_FORCE_FLUSH_DATA 0xCF - /* Base address of SMU for mapping physical address to virtual address */ #define AMD_PMC_MAPPING_SIZE 0x01000 #define AMD_PMC_BASE_ADDR_OFFSET 0x10000 @@ -97,7 +87,6 @@ #define DELAY_MIN_US 2000 #define DELAY_MAX_US 3000 -#define FIFO_SIZE 4096 enum amd_pmc_def { MSG_TEST = 0x01, @@ -105,19 +94,6 @@ enum amd_pmc_def { MSG_OS_HINT_RN, }; -enum s2d_arg { - S2D_TELEMETRY_SIZE = 0x01, - S2D_PHYS_ADDR_LOW, - S2D_PHYS_ADDR_HIGH, - S2D_NUM_SAMPLES, - S2D_DRAM_SIZE, -}; - -struct amd_pmc_stb_v2_data { - size_t size; - u8 data[] __counted_by(size); -}; - struct amd_pmc_bit_map { const char *name; u32 bit_mask; @@ -149,22 +125,11 @@ static const struct amd_pmc_bit_map soc15_ip_blk[] = { {} }; -static bool enable_stb; -module_param(enable_stb, bool, 0644); -MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); - static bool disable_workarounds; module_param(disable_workarounds, bool, 0644); MODULE_PARM_DESC(disable_workarounds, "Disable workarounds for platform bugs"); -static bool dump_custom_stb; -module_param(dump_custom_stb, bool, 0644); -MODULE_PARM_DESC(dump_custom_stb, "Enable to dump full STB buffer"); - static struct amd_pmc_dev pmc; -static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); -static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf); -static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); static inline u32 amd_pmc_reg_read(struct amd_pmc_dev *dev, int reg_offset) { @@ -193,155 +158,6 @@ struct smu_metrics { u64 timecondition_notmet_totaltime[32]; } __packed; -static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) -{ - struct amd_pmc_dev *dev = filp->f_inode->i_private; - u32 size = FIFO_SIZE * sizeof(u32); - u32 *buf; - int rc; - - buf = kzalloc(size, GFP_KERNEL); - if (!buf) - return -ENOMEM; - - rc = amd_pmc_read_stb(dev, buf); - if (rc) { - kfree(buf); - return rc; - } - - filp->private_data = buf; - return rc; -} - -static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, - loff_t *pos) -{ - if (!filp->private_data) - return -EINVAL; - - return simple_read_from_buffer(buf, size, pos, filp->private_data, - FIFO_SIZE * sizeof(u32)); -} - -static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp) -{ - kfree(filp->private_data); - return 0; -} - -static const struct file_operations amd_pmc_stb_debugfs_fops = { - .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open, - .read = amd_pmc_stb_debugfs_read, - .release = amd_pmc_stb_debugfs_release, -}; - -/* Enhanced STB Firmware Reporting Mechanism */ -static int amd_pmc_stb_handle_efr(struct file *filp) -{ - struct amd_pmc_dev *dev = filp->f_inode->i_private; - struct amd_pmc_stb_v2_data *stb_data_arr; - u32 fsize; - - fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; - stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); - if (!stb_data_arr) - return -ENOMEM; - - stb_data_arr->size = fsize; - memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); - filp->private_data = stb_data_arr; - - return 0; -} - -static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) -{ - struct amd_pmc_dev *dev = filp->f_inode->i_private; - u32 fsize, num_samples, val, stb_rdptr_offset = 0; - struct amd_pmc_stb_v2_data *stb_data_arr; - int ret; - - /* Write dummy postcode while reading the STB buffer */ - ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC); - if (ret) - dev_err(dev->dev, "error writing to STB: %d\n", ret); - - /* Spill to DRAM num_samples uses separate SMU message port */ - dev->msg_port = 1; - - ret = amd_pmc_send_cmd(dev, 0, &val, STB_FORCE_FLUSH_DATA, 1); - if (ret) - dev_dbg_once(dev->dev, "S2D force flush not supported: %d\n", ret); - - /* - * We have a custom stb size and the PMFW is supposed to give - * the enhanced dram size. Note that we land here only for the - * platforms that support enhanced dram size reporting. - */ - if (dump_custom_stb) - return amd_pmc_stb_handle_efr(filp); - - /* Get the num_samples to calculate the last push location */ - ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); - /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; - if (ret) { - dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); - return ret; - } - - fsize = min(num_samples, S2D_TELEMETRY_BYTES_MAX); - stb_data_arr = kmalloc(struct_size(stb_data_arr, data, fsize), GFP_KERNEL); - if (!stb_data_arr) - return -ENOMEM; - - stb_data_arr->size = fsize; - - /* - * Start capturing data from the last push location. - * This is for general cases, where the stb limits - * are meant for standard usage. - */ - if (num_samples > S2D_TELEMETRY_BYTES_MAX) { - /* First read oldest data starting 1 behind last write till end of ringbuffer */ - stb_rdptr_offset = num_samples % S2D_TELEMETRY_BYTES_MAX; - fsize = S2D_TELEMETRY_BYTES_MAX - stb_rdptr_offset; - - memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr + stb_rdptr_offset, fsize); - /* Second copy the newer samples from offset 0 - last write */ - memcpy_fromio(stb_data_arr->data + fsize, dev->stb_virt_addr, stb_rdptr_offset); - } else { - memcpy_fromio(stb_data_arr->data, dev->stb_virt_addr, fsize); - } - - filp->private_data = stb_data_arr; - - return 0; -} - -static ssize_t amd_pmc_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, - loff_t *pos) -{ - struct amd_pmc_stb_v2_data *data = filp->private_data; - - return simple_read_from_buffer(buf, size, pos, data->data, data->size); -} - -static int amd_pmc_stb_debugfs_release_v2(struct inode *inode, struct file *filp) -{ - kfree(filp->private_data); - return 0; -} - -static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { - .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open_v2, - .read = amd_pmc_stb_debugfs_read_v2, - .release = amd_pmc_stb_debugfs_release_v2, -}; - static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) { switch (dev->cpu_id) { @@ -350,18 +166,15 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) case AMD_CPU_ID_YC: case AMD_CPU_ID_CB: dev->num_ips = 12; - dev->s2d_msg_id = 0xBE; dev->smu_msg = 0x538; break; case AMD_CPU_ID_PS: dev->num_ips = 21; - dev->s2d_msg_id = 0x85; dev->smu_msg = 0x538; break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: dev->num_ips = 22; - dev->s2d_msg_id = 0xDE; dev->smu_msg = 0x938; break; } @@ -625,20 +438,6 @@ static void amd_pmc_dbgfs_unregister(struct amd_pmc_dev *dev) debugfs_remove_recursive(dev->dbgfs_dir); } -static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) -{ - switch (dev->cpu_id) { - case AMD_CPU_ID_YC: - case AMD_CPU_ID_CB: - case AMD_CPU_ID_PS: - case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: - case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - return true; - default: - return false; - } -} - static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev) { dev->dbgfs_dir = debugfs_create_dir("amd_pmc", NULL); @@ -674,7 +473,7 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) dev_dbg(dev->dev, "AMD_%s_REGISTER_MESSAGE:%x\n", dev->msg_port ? "S2D" : "PMC", value); } -static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret) +int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret) { int rc; u32 val, message, argument, response; @@ -966,78 +765,6 @@ static const struct pci_device_id pmc_pci_ids[] = { { } }; -static int amd_pmc_s2d_init(struct amd_pmc_dev *dev) -{ - u32 phys_addr_low, phys_addr_hi; - u64 stb_phys_addr; - u32 size = 0; - int ret; - - if (amd_pmc_is_stb_supported(dev)) { - debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops_v2); - } else { - debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops); - return 0; - } - - /* Spill to DRAM feature uses separate SMU message port */ - dev->msg_port = 1; - - amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); - if (size != S2D_TELEMETRY_BYTES_MAX) - return -EIO; - - /* Get DRAM size */ - ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); - if (ret || !dev->dram_size) - dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; - - /* Get STB DRAM address */ - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); - - stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); - - /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; - - dev->stb_virt_addr = devm_ioremap(dev->dev, stb_phys_addr, dev->dram_size); - if (!dev->stb_virt_addr) - return -ENOMEM; - - return 0; -} - -static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) -{ - int err; - - err = amd_smn_write(0, AMD_PMC_STB_PMI_0, data); - if (err) { - dev_err(dev->dev, "failed to write data in stb: 0x%X\n", AMD_PMC_STB_PMI_0); - return pcibios_err_to_errno(err); - } - - return 0; -} - -static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) -{ - int i, err; - - for (i = 0; i < FIFO_SIZE; i++) { - err = amd_smn_read(0, AMD_PMC_STB_PMI_0, buf++); - if (err) { - dev_err(dev->dev, "error reading data from stb: 0x%X\n", AMD_PMC_STB_PMI_0); - return pcibios_err_to_errno(err); - } - } - - return 0; -} - static int amd_pmc_probe(struct platform_device *pdev) { struct amd_pmc_dev *dev = &pmc; @@ -1105,11 +832,9 @@ static int amd_pmc_probe(struct platform_device *pdev) } amd_pmc_dbgfs_register(dev); - if (enable_stb && amd_pmc_is_stb_supported(dev)) { - err = amd_pmc_s2d_init(dev); - if (err) - goto err_pci_dev_put; - } + err = amd_pmc_s2d_init(dev); + if (err) + goto err_pci_dev_put; if (IS_ENABLED(CONFIG_AMD_MP2_STB)) amd_mp2_stb_init(dev); diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index f1166d15c856..8f939ab32510 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -70,4 +70,9 @@ void amd_mp2_stb_deinit(struct amd_pmc_dev *dev); #define PCI_DEVICE_ID_AMD_1AH_M60H_ROOT 0x1122 #define PCI_DEVICE_ID_AMD_MP2_STB 0x172c +int amd_pmc_s2d_init(struct amd_pmc_dev *dev); +int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf); +int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); +int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); + #endif /* PMC_H */ From patchwork Thu Nov 7 07:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865938 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) (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 B8782196D9D for ; Thu, 7 Nov 2024 07:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964466; cv=fail; b=QjMtQZO3ryUSErM8odeUD57vONaafcepEbjOiUBgE0rh0x98b9Z6PGvZHKlyIoY3D7p8bZvd5B+xPrznBvZwsKHCQWvVL7max2eyJzvMAY0SNyOrd35j7pTeGGP+gM2Yi+HgVBpug6xR6yJipgTYvrR7dspY6j7Edw5vhALkXqY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964466; c=relaxed/simple; bh=5mLaW8LB+pSaQ6oeo/KkCfZpRjKmIIKWuN4UOVmQHsk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cR2+pN+Y8hxM3FL5CAEfYFE7qv+rdn4fhR5XdMQnke6fwLKtZmBSEoygGYVNxPH4aLo+46kbxpb63wkMls45zzgb+vKJLmublNgKZ68DIOkIVYxm9rXki3ykNcHkIphmgYms0HPMNwLU9uuhforohiZn0Ky8le+NadbV5bcin1g= 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=38nwqva9; arc=fail smtp.client-ip=40.107.243.86 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="38nwqva9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zE89i5vqi+PwFbhsmR3O73yWJ9vPmV3k1H7pKU4XUAVylP5hR+lZCJDuDXycvOO3zjITBkFf/nBtZv8Wivk3x+DfjEvIVaguIN8/ZFEh591BVCUpXByZ85MwRfZT03cp92RqF1iJS69sfDWvsW24C0W9kvusXKD9LAIkcJEViFRgtOXKJFrS69IHC3iQm8LZjys27pKVvx8YiCNAc+pZNok6mzyLX8ktqctDCgzJCo7Vq3yYh19EChV1iY3aPqMYvvsacYhZNqco+ObGy+QAOYeBWtBpKzuEJpp+Gr8svSKMjce1ixe3W/7WCLfOqYlNJDVYCk0lW/spBWZehzTwJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jzYZZp2PuY7Q/QQBTiphlUU1N0aAtLylUqALyE7O8Io=; b=QgTDuyiwnG0toWWAX4HsuXmmToiI/RehUJ/6P7IsryrnH1tfR0mFDWcEcnlcgFuJtddI/4UUGx8735lkfIWFMmQafqN8CqRlmiJzfLfUg4blu+5WJRpSpMqgeYOpap6SwScR5C/01E7cSliuEZwH7BoFdTMmToGXA/5fgrcZ+8RvZJywjWqjEXKl9IfEuBUNB/YoAxinEEuWvKHHbst41Q3NimCOe9QBqdyZWjTz8Y5y8uw2JpNKU9TAygaNrqK5YkdkGHPiGarWijEty9XSPwAHeBo8JjdNjGxoSCQgkuo6/M2S23YPRNRD22KBzxoVdHYeTdOUm9b5MJZi3jxflg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=jzYZZp2PuY7Q/QQBTiphlUU1N0aAtLylUqALyE7O8Io=; b=38nwqva9En2d4ovSr/zF+bHqF3noZ8MU+9c9QTmgiEoltL6pLcGVzPzsYlaEpRI+0ENbMkA+HY4JaPAtwsV4KF1KLtKJ3W2t7dFcQNXopah4mPOUNlfpMZOMBnmy75yb4AXCFZLYTJBk4nPKWsY7uaygxjVmnSoL3YJMPgWMd3c= Received: from PH0PR07CA0023.namprd07.prod.outlook.com (2603:10b6:510:5::28) by PH7PR12MB9074.namprd12.prod.outlook.com (2603:10b6:510:2f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 07:27:39 +0000 Received: from SN1PEPF00036F3D.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::9) by PH0PR07CA0023.outlook.office365.com (2603:10b6:510:5::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 07:27:39 +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 SN1PEPF00036F3D.mail.protection.outlook.com (10.167.248.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:39 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:37 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 04/11] platform/x86/amd/pmc: Update function names to align with new STB file Date: Thu, 7 Nov 2024 12:57:07 +0530 Message-ID: <20241107072714.943423-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3D:EE_|PH7PR12MB9074:EE_ X-MS-Office365-Filtering-Correlation-Id: 051cd0bd-5a71-4ade-e247-08dcfefda8f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: HkvJN88Bm9TPqMlAw4gFQ0SOz2ga8AtF0yOWOtObq5BncvcqHslW9Y5OoTloWs+v7t5rSivamb+VGjCL6kJGwF1lW5vmZhzXOxFezxnq8lP2EVCRY7monc9mq0LkcY6iaFh/89BA9N6ejTctXaNOku+F24tBTFRWmPo/hE4nPBM9BjAf2H6fzFvK6Yti8zFGwZZLuFhkMKH8ojMmXyhKVAuLZLCO1VnZ5gCwZHW3kYvCadxdS3dPJSo0x41RGaDxiJbpyddt73Drfys3Bdhxz/iIRbmqyKZYb+TzIhD0qNMSU+df0PPAlzXp1xYIv15GZuQaHyZhjfcH/YtiJp+u981bRFciXcetPWQgfXWXDj/W5QKJQsmJe37VAULbFqfdnjcyiMAvMBPsfAvRLfNhmFxW26bK09iMGga+SAfnWfL2jWJuKmlG9eLI7atpocKBkKKwIYg7jkTRgsxQthkWNV9TrOfSa+lWm7tnuAddHbmDNOlo+LZMmEcV5YxsZmZyMfgmeP+9h7F95amnQ8bSQfTjJ41BWAL0sDPQw38sdM06TYKYeKth4U8wr5FWJNz0C3bfaG6KWuSIqw0h7GEvnWmAT2lUiC6QAEUmo/BktzdFC4BJ4oKb1pMDIPVWow5JfBLDdDUljLEi8gUo2G/RsCoHb+ruAjtIZmSAlqsE9fbuK0l2f/125TrwK8YQwE2wtJoA6C1rzFtAlidagsgxMVgCZUa0Q4oq0EsvvK/YE89xllOXVQ2ESmm/z5vVTsk/MpZKJehI/jhDo8jdab6ImdJ44bZyjWMKPcooGaBhlzngj3vIerdtQkMxOAg915lqqnKgicqCielzB7OygURl5wPFUz69IstsQNVkNlVdgaq3+zruwk1aRAxDBDNraLNHfbkZrcCWQ2t8QBKcYQk+kiaiJ9xPTh9qkSqX9j6Z3NMAB8mFxz1pqG7WnnNXg7SAKOysDDQF7gVYIg/M3XeZKTkas5TgC5gvb7RQiCHDsqClrsCx5l3ZFWeVy6s9ESJlfadWif1Nqn5R2ygf+Z6g+a5vGz07iKrp0vku4vb4id9Kw44DR/sr7pjfvfI+3VaVgpKT9jihEbWoLJGPudDzJJCrBkHmWqyoa3e7VnXmoKSFkUbBAahtJxZpQw33+1sRpCsxX3D0+xQNVVQJMhgPlLxZK4/nN/08RtKrvkTVFEhHis+PrGxPuAPv380ds6dtV6wwvHg3qxfTaV3UCr9NHDhGs6iIS5Yh+WFPyLWz0GfUBTMrHbZX7HH5AysT3WuY1RD7/+qmMu6V0R9UkHdxsLGrbvZ6hJg2K5KOisa/U8gxW7Z/aX7knZtdMinpJ9HHxDPCLya6xUiTAZNzu4b7gqbi1ZM26N1FSb9y8LwHUllUjw/Sf7MY5OihzHJIGD2XeJla8V0D6sXdybtmhd4mtg== 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)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:39.3657 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 051cd0bd-5a71-4ade-e247-08dcfefda8f2 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: SN1PEPF00036F3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9074 With STB now in a separate file, update the function names to match the correct naming schema by removing the _pmc_ prefix where needed. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 71 +++++++++++++------------- drivers/platform/x86/amd/pmc/pmc.c | 8 +-- drivers/platform/x86/amd/pmc/pmc.h | 6 +-- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 29e0241190e4..5c03ac92558f 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -24,7 +24,7 @@ #define S2D_RSVD_RAM_SPACE 0x100000 /* STB Registers */ -#define AMD_PMC_STB_PMI_0 0x03E30600 +#define AMD_STB_PMI_0 0x03E30600 #define AMD_PMC_STB_DUMMY_PC 0xC6000007 /* STB Spill to DRAM Message Definition */ @@ -47,32 +47,32 @@ enum s2d_arg { S2D_DRAM_SIZE, }; -struct amd_pmc_stb_v2_data { +struct amd_stb_v2_data { size_t size; u8 data[] __counted_by(size); }; -int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) +int amd_stb_write(struct amd_pmc_dev *dev, u32 data) { int err; - err = amd_smn_write(0, AMD_PMC_STB_PMI_0, data); + err = amd_smn_write(0, AMD_STB_PMI_0, data); if (err) { - dev_err(dev->dev, "failed to write data in stb: 0x%X\n", AMD_PMC_STB_PMI_0); + dev_err(dev->dev, "failed to write data in stb: 0x%X\n", AMD_STB_PMI_0); return pcibios_err_to_errno(err); } return 0; } -int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) +int amd_stb_read(struct amd_pmc_dev *dev, u32 *buf) { int i, err; for (i = 0; i < FIFO_SIZE; i++) { - err = amd_smn_read(0, AMD_PMC_STB_PMI_0, buf++); + err = amd_smn_read(0, AMD_STB_PMI_0, buf++); if (err) { - dev_err(dev->dev, "error reading data from stb: 0x%X\n", AMD_PMC_STB_PMI_0); + dev_err(dev->dev, "error reading data from stb: 0x%X\n", AMD_STB_PMI_0); return pcibios_err_to_errno(err); } } @@ -80,7 +80,7 @@ int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) return 0; } -static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_open(struct inode *inode, struct file *filp) { struct amd_pmc_dev *dev = filp->f_inode->i_private; u32 size = FIFO_SIZE * sizeof(u32); @@ -91,7 +91,7 @@ static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) if (!buf) return -ENOMEM; - rc = amd_pmc_read_stb(dev, buf); + rc = amd_stb_read(dev, buf); if (rc) { kfree(buf); return rc; @@ -101,8 +101,7 @@ static int amd_pmc_stb_debugfs_open(struct inode *inode, struct file *filp) return rc; } -static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, - loff_t *pos) +static ssize_t amd_stb_debugfs_read(struct file *filp, char __user *buf, size_t size, loff_t *pos) { if (!filp->private_data) return -EINVAL; @@ -111,24 +110,24 @@ static ssize_t amd_pmc_stb_debugfs_read(struct file *filp, char __user *buf, siz FIFO_SIZE * sizeof(u32)); } -static int amd_pmc_stb_debugfs_release(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_release(struct inode *inode, struct file *filp) { kfree(filp->private_data); return 0; } -static const struct file_operations amd_pmc_stb_debugfs_fops = { +static const struct file_operations amd_stb_debugfs_fops = { .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open, - .read = amd_pmc_stb_debugfs_read, - .release = amd_pmc_stb_debugfs_release, + .open = amd_stb_debugfs_open, + .read = amd_stb_debugfs_read, + .release = amd_stb_debugfs_release, }; /* Enhanced STB Firmware Reporting Mechanism */ -static int amd_pmc_stb_handle_efr(struct file *filp) +static int amd_stb_handle_efr(struct file *filp) { struct amd_pmc_dev *dev = filp->f_inode->i_private; - struct amd_pmc_stb_v2_data *stb_data_arr; + struct amd_stb_v2_data *stb_data_arr; u32 fsize; fsize = dev->dram_size - S2D_RSVD_RAM_SPACE; @@ -143,15 +142,15 @@ static int amd_pmc_stb_handle_efr(struct file *filp) return 0; } -static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) { struct amd_pmc_dev *dev = filp->f_inode->i_private; u32 fsize, num_samples, val, stb_rdptr_offset = 0; - struct amd_pmc_stb_v2_data *stb_data_arr; + struct amd_stb_v2_data *stb_data_arr; int ret; /* Write dummy postcode while reading the STB buffer */ - ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC); + ret = amd_stb_write(dev, AMD_PMC_STB_DUMMY_PC); if (ret) dev_err(dev->dev, "error writing to STB: %d\n", ret); @@ -168,7 +167,7 @@ static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) * platforms that support enhanced dram size reporting. */ if (dump_custom_stb) - return amd_pmc_stb_handle_efr(filp); + return amd_stb_handle_efr(filp); /* Get the num_samples to calculate the last push location */ ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); @@ -208,28 +207,28 @@ static int amd_pmc_stb_debugfs_open_v2(struct inode *inode, struct file *filp) return 0; } -static ssize_t amd_pmc_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, - loff_t *pos) +static ssize_t amd_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size, + loff_t *pos) { - struct amd_pmc_stb_v2_data *data = filp->private_data; + struct amd_stb_v2_data *data = filp->private_data; return simple_read_from_buffer(buf, size, pos, data->data, data->size); } -static int amd_pmc_stb_debugfs_release_v2(struct inode *inode, struct file *filp) +static int amd_stb_debugfs_release_v2(struct inode *inode, struct file *filp) { kfree(filp->private_data); return 0; } -static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { +static const struct file_operations amd_stb_debugfs_fops_v2 = { .owner = THIS_MODULE, - .open = amd_pmc_stb_debugfs_open_v2, - .read = amd_pmc_stb_debugfs_read_v2, - .release = amd_pmc_stb_debugfs_release_v2, + .open = amd_stb_debugfs_open_v2, + .read = amd_stb_debugfs_read_v2, + .release = amd_stb_debugfs_release_v2, }; -static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) +static bool amd_is_stb_supported(struct amd_pmc_dev *dev) { switch (dev->cpu_id) { case AMD_CPU_ID_YC: @@ -248,7 +247,7 @@ static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev) } } -int amd_pmc_s2d_init(struct amd_pmc_dev *dev) +int amd_stb_s2d_init(struct amd_pmc_dev *dev) { u32 phys_addr_low, phys_addr_hi; u64 stb_phys_addr; @@ -258,12 +257,12 @@ int amd_pmc_s2d_init(struct amd_pmc_dev *dev) if (!enable_stb) return 0; - if (amd_pmc_is_stb_supported(dev)) { + if (amd_is_stb_supported(dev)) { debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops_v2); + &amd_stb_debugfs_fops_v2); } else { debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, - &amd_pmc_stb_debugfs_fops); + &amd_stb_debugfs_fops); return 0; } diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 6ebb9123ba00..7726a05091a5 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -671,7 +671,7 @@ static void amd_pmc_s2idle_prepare(void) return; } - rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_PREPARE); + rc = amd_stb_write(pdev, AMD_PMC_STB_S2IDLE_PREPARE); if (rc) dev_err(pdev->dev, "error writing to STB: %d\n", rc); } @@ -690,7 +690,7 @@ static void amd_pmc_s2idle_check(void) /* Dump the IdleMask before we add to the STB */ amd_pmc_idlemask_read(pdev, pdev->dev, NULL); - rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_CHECK); + rc = amd_stb_write(pdev, AMD_PMC_STB_S2IDLE_CHECK); if (rc) dev_err(pdev->dev, "error writing to STB: %d\n", rc); } @@ -717,7 +717,7 @@ static void amd_pmc_s2idle_restore(void) /* Let SMU know that we are looking for stats */ amd_pmc_dump_data(pdev); - rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_S2IDLE_RESTORE); + rc = amd_stb_write(pdev, AMD_PMC_STB_S2IDLE_RESTORE); if (rc) dev_err(pdev->dev, "error writing to STB: %d\n", rc); @@ -832,7 +832,7 @@ static int amd_pmc_probe(struct platform_device *pdev) } amd_pmc_dbgfs_register(dev); - err = amd_pmc_s2d_init(dev); + err = amd_stb_s2d_init(dev); if (err) goto err_pci_dev_put; diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index 8f939ab32510..188284feca72 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -70,9 +70,9 @@ void amd_mp2_stb_deinit(struct amd_pmc_dev *dev); #define PCI_DEVICE_ID_AMD_1AH_M60H_ROOT 0x1122 #define PCI_DEVICE_ID_AMD_MP2_STB 0x172c -int amd_pmc_s2d_init(struct amd_pmc_dev *dev); -int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf); -int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data); +int amd_stb_s2d_init(struct amd_pmc_dev *dev); +int amd_stb_read(struct amd_pmc_dev *dev, u32 *buf); +int amd_stb_write(struct amd_pmc_dev *dev, u32 data); int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret); #endif /* PMC_H */ From patchwork Thu Nov 7 07:27:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865937 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2080.outbound.protection.outlook.com [40.107.237.80]) (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 874CB196C9B for ; Thu, 7 Nov 2024 07:27:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964466; cv=fail; b=CVLPEnmgtteB6SgNuYPWBVb/ube+p59ohPx/zuxWvd+iLL/k8TsWo9Hh73lrhjJAsO9pJrLSXSwmMLaYcHE9C8v2MrV/x/NwEK1ty2fe1SCwCmJX4vDGcWdQuqX/uoyKiJBd1QsqrAFbTbZ5O8VjXNPANaSPrWvC+dLaEyk5ClM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964466; c=relaxed/simple; bh=lIoiA8Gqu/0R44C2VkwRQZXaowbCC9K78mM3/pFnAGU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hWpOia6RyNvTmQvT0P4BUEqkyf/SJiEuOq32EWa5SL9L7quBg8927Ed7GeJ9ArQVnwdERqvjFRlgUrhoVGSwvE1h/4k0h7jFgDS6bKq1l1viB/428kVOlODBQSU2TRtiB+39V89KrqnO8aJYUbEg7Ql9zKKDf/XroaBqLV1e7DM= 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=MO7AXe4V; arc=fail smtp.client-ip=40.107.237.80 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="MO7AXe4V" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wpXPRIhntTIEBWSbOHZxSuEXE7vA7b8C3riFJ/0OO3yoVS/VyktWHtqhPBDPQQ1UsOolDRYMdhalJMF1oPC2T4YEvs5fNeC1C7bB6l+jpvGqf+oWBCzIUlkXP/GTfjFLgxUz7CI/6uPAwWYbDUhWyloOnQ2y98QgmET0u3rZaTXJsHKc3uO6GZSuap6cwwLMDPWj9MwvhgGVmQNiDNCRTrjDnh1BPRJyVdL6zJKpO6v0gAOjcYyqki3GodLjjWNXnPfE8x530VqF2oamDATf43mzs6xbhZYV6FaWQ1aIfYB2AqMfzTAC6ehPJ60m1cQJ6zuS2AJEvCZcUjtmrp7zkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7PHngG2WGHi/K+Wl4eRA6aTmQyjThF/Cy7wKLZS16QE=; b=Io4pbScpXpfNQepbPOYY5BCzkLWwL8DlaLyzcO+oXjCLJCkiOJdasG/n+HK5h215FU2mAWtKJ8/mq6JFCQG1h3rNj/2FdvMmLHM7Xm3nxWHq2K7hs3OL/RnSeKaYlESt5i39BDv1QabYBYUq9a6GDFJ09C9n0CBXn2AAoMukKge0qd9oGYZqPeIMVWy7rAzJ2wa5whpxPSqTvGQBqGYrP76fdEAheBZGghonWvmItUue4CWYuidCoqaPeB6F4AwR7HqMNZgWh2zCZOqdDNNaRK36oiQZ8JA4t5ib+dh6HyZZdp39H09To3z0ikoMBa4UwhfydPvOUz08DWSISaoRjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=7PHngG2WGHi/K+Wl4eRA6aTmQyjThF/Cy7wKLZS16QE=; b=MO7AXe4VF8x0/NBOvw2JzfRmIt5T4ln1ZQuK4qvlXdRk2OuBRQBpgUmxwU3h/62oNuo3xVbygwOkdviAIuFm3+aMVH7VeMXyRLFrQOrienswQE8phQYw7Rwc4PMrz824c3g4BAtuZU6gXvpB0XPbWA0Fd5sPdgZm5G0N4RhjiSw= Received: from PH0PR07CA0025.namprd07.prod.outlook.com (2603:10b6:510:5::30) by PH8PR12MB6938.namprd12.prod.outlook.com (2603:10b6:510:1bd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Thu, 7 Nov 2024 07:27:41 +0000 Received: from SN1PEPF00036F3D.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::93) by PH0PR07CA0025.outlook.office365.com (2603:10b6:510:5::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Thu, 7 Nov 2024 07:27: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 SN1PEPF00036F3D.mail.protection.outlook.com (10.167.248.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:41 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:39 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 05/11] platform/x86/amd/pmc: Define enum for S2D/PMC msg_port and add helper function Date: Thu, 7 Nov 2024 12:57:08 +0530 Message-ID: <20241107072714.943423-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3D:EE_|PH8PR12MB6938:EE_ X-MS-Office365-Filtering-Correlation-Id: 942793a7-4786-4c8b-adf5-08dcfefdaa21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: 8dHwQZ5qYOB6nfS31PnpSh7yjC9wpZvMckjkZvHPoVrJP7Jmy3hY2NW1gHxbJecKm53Z+p4SXXD6fGE7yvrnXf9Xw0XgX2QvdxfILwsoq9rC0F3xMjKUEgQ9YEWDRGsc23v3YUKK8KUAg6a1E73Gs+Hjd//ro/OkqoTUk6q617hj1Tj6sSLOMbLxRrOdKN/7hyz4uJPvZprTolYscR1twNW9C8FJtT9P2KHthCFpFo1AOfcXQV7I+hOiZW+ibSLRLIuX/a+Dr7jfFMGvSQzsypt9iQLyIB9DHBjVS2FpwDBmjgOo5FFoboKLqp/rLqIBaZoQ1EAlkPEK+VXQ+gFllwPP34TyuZHD+EYEBr0KI3zAr/FVQf4CXiKZgv3Sy5/vSzUJDp7sb3amq/IayuVqDNJZp9Ve3GR2QLAkAgESg4AYbE5VT906pA9+dBG+Zf6vXRkCq6ewfUwz4uHWOcuDLIkDJXD89j8jstV9C8vqX6oFd2kKbsEkIpbl4cQMxs9grckZkaaMSidMb+9b3SPktWkZ1mp8GDN9zlKgHBQc+09zEGgep1alWFtNssHAFvrcTG2aJGOdRAaIyokNexFopnDGeUR3e5HGJy+PA+fuyp9myD/m2Kx9ZA4nUY2/+iOGj8TbtLMkAFQnP2BgK9/ug7HIOYsobW7RLBm4bJj5C6Gn63hCHR1RfKvM8LT+HYoR6/JrQDbByNjtRnE1bDYqqnZ05ac9abcvoWjtGDNKc5hgt31LEXIRrFfxeoapVlXtL0LaOlw8xbQuly6kZNBjujvpapfOBAspvH3V7hNjo9NNdbkiQuzrC4vHLO5G/eWJuLyHajqhvrNonSZF4NDaHXGf6SXiJ+OJBh/HXdLU15odNHoMBlq83K/Gk8c1Ndpolcbb2YUl63iEi7CWCg4hYNnF+8fOT4VfxLJCh5QHLWPM60/lUf1Hap+OsJ4Gh+1oT6KMe0SfarBl/riNGxRJ1pqiPu3qS+VXNuxL0vFSZhdNrENX4FCaNxYL+6z2HUej/dZa84Wc1iBIs6Gf1gO7El0OsZWnbnQe0C6gP3wmGM96z2FffbuEefPl00/LRGHQUvCmOFSV4BtYgvJz20GzUL05tL9tgYdnSX6zifo0I6LJyCn0od80E64BGFyx1P+xIFV9xcpX34OSiXqkdsfsZ3/Rr18C8jNLkk9lwcesS7bBGS9GbZzb8c2y3IKySRUDuSpHt2ErcFsjiRTwg7yfTb0RqxSgdQCu4rZTF37oM7Qw6ZpoXQD2ZAegn4FUUcoKe91BD6G49JNPu6LyKXK2k4VXYyvN1HS0xU5pxS07F85bxsN9T0+GAVZBOisvSI1dI9JbJFOuwFVLXqOljTk2nZlNcOvjWKvQmn7OS96UD9LSU6z+dIya/sKvFyfkin4PrKdpQLlTJRHVKeuTjPXsCA== 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)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:41.3501 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 942793a7-4786-4c8b-adf5-08dcfefdaa21 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: SN1PEPF00036F3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6938 To distinguish between the PMC message port and the S2D (Spill to DRAM) message port, replace the use of 0 and 1 with an enum. To avoid printing the S2D or PMC port multiple times in debug print, add new routine to retrieve the message port information, which can be used to print the right msg_port getting used. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 8 ++++---- drivers/platform/x86/amd/pmc/pmc.c | 15 ++++++++++----- drivers/platform/x86/amd/pmc/pmc.h | 5 +++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 5c03ac92558f..9ee629db9af9 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -155,7 +155,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) dev_err(dev->dev, "error writing to STB: %d\n", ret); /* Spill to DRAM num_samples uses separate SMU message port */ - dev->msg_port = 1; + dev->msg_port = MSG_PORT_S2D; ret = amd_pmc_send_cmd(dev, 0, &val, STB_FORCE_FLUSH_DATA, 1); if (ret) @@ -172,7 +172,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) /* Get the num_samples to calculate the last push location */ ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; + dev->msg_port = MSG_PORT_PMC; if (ret) { dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); return ret; @@ -267,7 +267,7 @@ int amd_stb_s2d_init(struct amd_pmc_dev *dev) } /* Spill to DRAM feature uses separate SMU message port */ - dev->msg_port = 1; + dev->msg_port = MSG_PORT_S2D; amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); if (size != S2D_TELEMETRY_BYTES_MAX) @@ -285,7 +285,7 @@ int amd_stb_s2d_init(struct amd_pmc_dev *dev) stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); /* Clear msg_port for other SMU operation */ - dev->msg_port = 0; + dev->msg_port = MSG_PORT_PMC; dev->stb_virt_addr = devm_ioremap(dev->dev, stb_phys_addr, dev->dram_size); if (!dev->stb_virt_addr) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 7726a05091a5..ce0050699a5a 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -449,11 +449,16 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev) &amd_pmc_idlemask_fops); } +static char *amd_pmc_print_msg_port(struct amd_pmc_dev *dev) +{ + return dev->msg_port ? "S2D" : "PMC"; +} + static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) { u32 value, message, argument, response; - if (dev->msg_port) { + if (dev->msg_port == MSG_PORT_S2D) { message = AMD_S2D_REGISTER_MESSAGE; argument = AMD_S2D_REGISTER_ARGUMENT; response = AMD_S2D_REGISTER_RESPONSE; @@ -464,13 +469,13 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) } value = amd_pmc_reg_read(dev, response); - dev_dbg(dev->dev, "AMD_%s_REGISTER_RESPONSE:%x\n", dev->msg_port ? "S2D" : "PMC", value); + dev_dbg(dev->dev, "AMD_%s_REGISTER_RESPONSE:%x\n", amd_pmc_print_msg_port(dev), value); value = amd_pmc_reg_read(dev, argument); - dev_dbg(dev->dev, "AMD_%s_REGISTER_ARGUMENT:%x\n", dev->msg_port ? "S2D" : "PMC", value); + dev_dbg(dev->dev, "AMD_%s_REGISTER_ARGUMENT:%x\n", amd_pmc_print_msg_port(dev), value); value = amd_pmc_reg_read(dev, message); - dev_dbg(dev->dev, "AMD_%s_REGISTER_MESSAGE:%x\n", dev->msg_port ? "S2D" : "PMC", value); + dev_dbg(dev->dev, "AMD_%s_REGISTER_MESSAGE:%x\n", amd_pmc_print_msg_port(dev), value); } int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool ret) @@ -480,7 +485,7 @@ int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool r mutex_lock(&dev->lock); - if (dev->msg_port) { + if (dev->msg_port == MSG_PORT_S2D) { message = AMD_S2D_REGISTER_MESSAGE; argument = AMD_S2D_REGISTER_ARGUMENT; response = AMD_S2D_REGISTER_RESPONSE; diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index 188284feca72..8252d3a52849 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -14,6 +14,11 @@ #include #include +enum s2d_msg_port { + MSG_PORT_PMC, + MSG_PORT_S2D, +}; + struct amd_mp2_dev { void __iomem *mmio; void __iomem *vslbase; From patchwork Thu Nov 7 07:27:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865939 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2040.outbound.protection.outlook.com [40.107.244.40]) (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 6E049196D9D for ; Thu, 7 Nov 2024 07:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964470; cv=fail; b=Zt/qyBHnInogsJj1uF1O3uIyApf4VkrxhJleS/AHAVgBGd8ozbkO2v/2DvSdWg91ln8IwInN29L0Fok8Y/NpPRtMhGjMlHHNzQhQOfYotGL4BgnkXvgWoI+qZcI/VM26MvkZ7PaDtFc4g1Dqamjvvee1YVf5IWBY5z0ttUD8IAE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964470; c=relaxed/simple; bh=+SV20//5/2FSCa70rdlb2J0x8rJU1agb1DWSUbjafkk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IU6MN5YX0JG9IXkRSLS8ZQWQx4zf8xkaPvcr3iur9ew2PVemkmVvTr+7M7L/P+skwf9Bhrpyo36BoFfVCDxAukKZ6xqiJSeInEvTaiPb9tqGzYeCsQKNmvSmqfOWK+CaJj/EuvdssDes/BE42pCZbP3GH+JCRmO1tmuXIoVYoaw= 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=fdA8bz8n; arc=fail smtp.client-ip=40.107.244.40 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="fdA8bz8n" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p3vNTiYj3lCmbIufz7IhaAkdr22tlkLO48B01Xwv+F4y3oG/0CAmynRjvnAe8XLR1exK40nZgx9Egq8bHuuHAOEHTlSOOhOJK7Zo7CvfHE9Exn24XY5WheLdZx7QNNbfKcmjKZmsJLX2v8cuNmPWhI8u76grGnyNNNk+wuc1IipCZE/+sTJZ6jnwWD1OmbyNFbQMOcYJkYqbBQS6KenJojx0vIYjo5bskMjs1j4gKP1470nfMzb2+czJpKXdjaOYDNXyfvmtzRL874oiaXF9XEKh230/WE1a4ARGCMS6xBO/xf30agkJvnzeZXKaDSBT1/G44e9IZQNKeFNTPV9H3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5Nfs1iPRop5rBgboI5kCaKWCFGYohKwWE73GHr/0E1c=; b=ByX5TPhFbWBRkM+WfGticP3d2+69dboiVYrHP7oGWQlO9UTysslgS3N0cC403eAnAadnA0h6fUDA+w2oyKZ5nsFEwcYK58ksxKQtsWowfEOUbYoodXZdgB2QrZGng9EkYTES9KjIbuct1FIBx74qHes5f+MRFQOdQal/dPpJmkovOXBFNjswld/hYuFq1ybBvzAIgHbvAKn51tmhgucje/iqva5yTWdwODUQ372hQUPUtYe6Mf/+PlReV229u9HKepDam3xzwsWto3MhStZr8w/WtieSu1NwOm5SY8lzlMKNfLTyZlF/dSQLEA3RxOf9Glm802fZ7uZb17Q6Qc+Z8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=5Nfs1iPRop5rBgboI5kCaKWCFGYohKwWE73GHr/0E1c=; b=fdA8bz8nZq7fMiNurimDgG1HBe64kkezlZZDybYsxIWZYDT16zi2uKlatOlLI+Ujtcz+OVmzuP4ZzOyayRxdA7ddQIZxXhiBg99Z15kXW10uahtOZIsOoqLAmMhQYn7If7ajRbEoIlDLzaC3mv9kFGwXrfFdM6u1EyDrNNhAWoM= Received: from PH0PR07CA0009.namprd07.prod.outlook.com (2603:10b6:510:5::14) by SN7PR12MB6932.namprd12.prod.outlook.com (2603:10b6:806:260::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 07:27:44 +0000 Received: from SN1PEPF00036F41.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::c5) by PH0PR07CA0009.outlook.office365.com (2603:10b6:510:5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Thu, 7 Nov 2024 07:27:44 +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 SN1PEPF00036F41.mail.protection.outlook.com (10.167.248.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:43 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:41 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 06/11] platform/x86/amd/pmc: Isolate STB code changes to a new file Date: Thu, 7 Nov 2024 12:57:09 +0530 Message-ID: <20241107072714.943423-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F41:EE_|SN7PR12MB6932:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bd7fcc3-12a9-468c-8212-08dcfefdab90 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: C+3Wuf2TaRCUiCFkv27NG4i54nz3rdhHysIem4X2s+iPz54UJqcTeKFWuLjwZ8LFWfzO6YC6/LeZnDyr1DpSWb3/mWW5pjeucquJS44sfGLlIcuouazJrV0qtHhDCCni150EzSNXFi/hXixhcRHS0xLOFBWIvJ1TF6Cll8yTuRkEnzq0XB84kAMPFmAyEXf89Fs6+2TXEfjn517/99SxYzyT7VYm0Tv9pB0tgrZZ6i58ryxQLsSsMvNCxPAn6+aWhDxoOwDRN0s8+6o+Y4gczL0bkBvRnwh02xk15B5lx4S+ENFDkN4Org23YeMWohOD+UAK0ch3C6vbAiV0jX4WD6vWOrYooJQOxIh3A0+l07v+mFE3a1QnDwIJF4XJzZmk5tn7lwWjAPN+M+ItjWCjo0Hq88H43JpU5DGtwNeIygJXWZfKFcTKplZo5c4GJYbhYM80mFi8M70OUJBVzT0BhH2cSk4hyOXgrPKQQXJ1sCqfb3mkr24I8Koz87X2eoe7kg5feP3uxl6kngzr+1pg7qUmQ1glNkm7rK0I0CFlOxGGydPX87ZP2XJTlDV951gtBgnzU2iSgZNtqEmANe/P1Hs2ifV4w98Kxh/wTQlBxiyWF96Tz/42fIvn7sFNXEy/iLDMh6F4a2jWGvL1UJDmroBYlQ60vw2i0iePo2IRSPzZtKTlzOj0RaHmmu2khWzhnQiluoGgn6bvTn1GZt/6yXH9LqkRnzBOFS+gwK7C+RuIyluSnyHITnoYF3KWOkxNS8/ub54uCIv5BrDvBAVsxQGHr5CLY/nf1QqW0H1nBUV238pMNxV2lxhKWLQ6hhggIrYlWunAl2ebW4g7Dmyp/2CcSQQiUwjT0tNHWWLSW3OnOCLnP77oibihX3uzFPXXzDb2bznpWIQQGHNRNoH9UrpVhI/K4YHLuOr7a7VVwLu6xLtXCywenyhcw93wu+cCnPntSxk2TEd1yphM1Zp1yFNZaVXWIWfEf0Ddc4jF4VHZkBI8MRP9kM3m6FXQAa8wpMuiJJXySSqFqFwNswM5rDMfnKgH/HnhbA8yZ74SGxgS4MvofEth/RPAvmBnDsQg1uq5GybcjM2xTL0nM7Ub1XkJYGNa6ioTcURLTQgnKbD56mptsS+2+C8bscoaRbF/VUdPd9G6Q/5mjiHYA/YJ/Fh3WyVtlihKCCwQhSt4NpKNRaF/Seymvc+QcRZzjut7j8++XMUJTn0T+wcZ5czQh/z7K6oo/CmK3Crn6uH6CQ51aCjJr7ZQyNkQkNq2IUkdIOFkSu4lYfQ8opeOA3jyN7fOnOzafgx8xSA/toN5X/hLoi38OXOoacsNNwCCT/Xj3bVn93s2KF3/dwD7/b6svBGo33dVe2ASVRjwnLCrV3nXPPUPfa1ZYbAEPcHlHxWdR0ehwoL21Wht3EAYC+1PIw== 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)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:43.7541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bd7fcc3-12a9-468c-8212-08dcfefdab90 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: SN1PEPF00036F41.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6932 Since S2D (Spill to DRAM) uses different message port offsets compared to PMC message offsets for communication with PMFW, relocate the S2D macros from pmc.c to a new file, mp1_stb.c, for better code organization. Following this change, it is logical to introduce a new structure, "struct stb_arg," to pass the message, argument, and response offset details to PMFW via the amd_pmc_send_cmd() call. Additionally, move the s2d_msg_id member from amd_pmc_dev into the new structure. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 33 +++++++++++++++++--------- drivers/platform/x86/amd/pmc/pmc.c | 17 +++++-------- drivers/platform/x86/amd/pmc/pmc.h | 9 ++++++- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 9ee629db9af9..6a54dd3e7f4c 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -31,6 +31,11 @@ #define STB_FORCE_FLUSH_DATA 0xCF #define FIFO_SIZE 4096 +/* STB S2D(Spill to DRAM) has different message port offset */ +#define AMD_S2D_REGISTER_MESSAGE 0xA20 +#define AMD_S2D_REGISTER_RESPONSE 0xA80 +#define AMD_S2D_REGISTER_ARGUMENT 0xA88 + static bool enable_stb; module_param(enable_stb, bool, 0644); MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); @@ -170,7 +175,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) return amd_stb_handle_efr(filp); /* Get the num_samples to calculate the last push location */ - ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->s2d_msg_id, true); + ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->stb_arg.s2d_msg_id, true); /* Clear msg_port for other SMU operation */ dev->msg_port = MSG_PORT_PMC; if (ret) { @@ -233,18 +238,24 @@ static bool amd_is_stb_supported(struct amd_pmc_dev *dev) switch (dev->cpu_id) { case AMD_CPU_ID_YC: case AMD_CPU_ID_CB: - dev->s2d_msg_id = 0xBE; - return true; + dev->stb_arg.s2d_msg_id = 0xBE; + break; case AMD_CPU_ID_PS: - dev->s2d_msg_id = 0x85; - return true; + dev->stb_arg.s2d_msg_id = 0x85; + break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->s2d_msg_id = 0xDE; - return true; + dev->stb_arg.s2d_msg_id = 0xDE; + break; default: return false; } + + dev->stb_arg.msg = AMD_S2D_REGISTER_MESSAGE; + dev->stb_arg.arg = AMD_S2D_REGISTER_ARGUMENT; + dev->stb_arg.resp = AMD_S2D_REGISTER_RESPONSE; + + return true; } int amd_stb_s2d_init(struct amd_pmc_dev *dev) @@ -269,18 +280,18 @@ int amd_stb_s2d_init(struct amd_pmc_dev *dev) /* Spill to DRAM feature uses separate SMU message port */ dev->msg_port = MSG_PORT_S2D; - amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->stb_arg.s2d_msg_id, true); if (size != S2D_TELEMETRY_BYTES_MAX) return -EIO; /* Get DRAM size */ - ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->s2d_msg_id, true); + ret = amd_pmc_send_cmd(dev, S2D_DRAM_SIZE, &dev->dram_size, dev->stb_arg.s2d_msg_id, true); if (ret || !dev->dram_size) dev->dram_size = S2D_TELEMETRY_DRAMBYTES_MAX; /* Get STB DRAM address */ - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); - amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->stb_arg.s2d_msg_id, true); + amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->stb_arg.s2d_msg_id, true); stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index ce0050699a5a..e03b576105a5 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -44,11 +44,6 @@ #define AMD_PMC_STB_S2IDLE_RESTORE 0xC6000002 #define AMD_PMC_STB_S2IDLE_CHECK 0xC6000003 -/* STB S2D(Spill to DRAM) has different message port offset */ -#define AMD_S2D_REGISTER_MESSAGE 0xA20 -#define AMD_S2D_REGISTER_RESPONSE 0xA80 -#define AMD_S2D_REGISTER_ARGUMENT 0xA88 - /* Base address of SMU for mapping physical address to virtual address */ #define AMD_PMC_MAPPING_SIZE 0x01000 #define AMD_PMC_BASE_ADDR_OFFSET 0x10000 @@ -459,9 +454,9 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) u32 value, message, argument, response; if (dev->msg_port == MSG_PORT_S2D) { - message = AMD_S2D_REGISTER_MESSAGE; - argument = AMD_S2D_REGISTER_ARGUMENT; - response = AMD_S2D_REGISTER_RESPONSE; + message = dev->stb_arg.msg; + argument = dev->stb_arg.arg; + response = dev->stb_arg.resp; } else { message = dev->smu_msg; argument = AMD_PMC_REGISTER_ARGUMENT; @@ -486,9 +481,9 @@ int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg, bool r mutex_lock(&dev->lock); if (dev->msg_port == MSG_PORT_S2D) { - message = AMD_S2D_REGISTER_MESSAGE; - argument = AMD_S2D_REGISTER_ARGUMENT; - response = AMD_S2D_REGISTER_RESPONSE; + message = dev->stb_arg.msg; + argument = dev->stb_arg.arg; + response = dev->stb_arg.resp; } else { message = dev->smu_msg; argument = AMD_PMC_REGISTER_ARGUMENT; diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index 8252d3a52849..69870013c0fc 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -30,6 +30,13 @@ struct amd_mp2_dev { bool is_stb_data; }; +struct stb_arg { + u32 s2d_msg_id; + u32 msg; + u32 arg; + u32 resp; +}; + struct amd_pmc_dev { void __iomem *regbase; void __iomem *smu_virt_addr; @@ -41,7 +48,6 @@ struct amd_pmc_dev { u32 active_ips; u32 dram_size; u32 num_ips; - u32 s2d_msg_id; u32 smu_msg; /* SMU version information */ u8 smu_program; @@ -55,6 +61,7 @@ struct amd_pmc_dev { struct quirk_entry *quirks; bool disable_8042_wakeup; struct amd_mp2_dev *mp2; + struct stb_arg stb_arg; }; void amd_pmc_process_restore_quirks(struct amd_pmc_dev *dev); From patchwork Thu Nov 7 07:27:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865940 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2041.outbound.protection.outlook.com [40.107.96.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 4DD30198831 for ; Thu, 7 Nov 2024 07:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964471; cv=fail; b=bT4tv5HR03joqmF4uW2XvovetWRCkJNRBMDgFK0CasE/una3RFAbeGKVZ+M8R6E23hcCFFItRzkxqpn5a23+VeR37MarqqjxpiouHbPfKLwb5Cy0tDw34l1HYmXpwlaI3g1eSlYau3eUCbTc2dV28jfbJ/cKYuWtxXj5wzg2FyM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964471; c=relaxed/simple; bh=6C4pfXDa7JNWWV+DmNcqqOUh/bPcKoZqIuHIwIjh5z0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pZcctPUuGlVnoO22qacpaWieb/PxHnKZhQUtjcUf1wHjTlz0kDrKxxZg/tKZrPJgJykDNuF1YnFrMIIJoVthGrmMZD25sUM/rRKiRKVOLINjdyNWBPRDAMM2vYjlCrwCXlGjuzTeKYaDvSwxGjx0yl85GIcqzEfLcVTCu8gTDGw= 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=QVPdPUtq; arc=fail smtp.client-ip=40.107.96.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="QVPdPUtq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yFrY8HOozY16/dGMYJSleU5rfgXPxK3rIiS0dwfjJMCHF2Le7sv0qMvP84H2nWW+O99tp2ZcJ7+sxIjOTVGepEZPPVKrw2aUI9OhVLMuivHVZ33fGWQdojUVf06jw1+3Ih0yeQ5XluNYu6MBtSDJZJ8FIfQysZANz1xORcU1OkIJ7K2Qxjenrl2LMEAp1l31+QGIpWhS0kQpMUtc+iPoWpK/KNyxBUZOp+GdO1HqimU/rZ8Gk6snRLEeDjHfiHEQwt7MZ0pR11do6b7FEsUi0j8M6DjZOSFkJEv/qK9kg/AMVmysnPsbBNYAsFesaSMldw0soSEwc29iw3Qu0Yq4jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jml7J/B/HxfOV41OOnv7IhR2gemZrOl5TDeiVE9asYw=; b=Ab73x6fHgEZGdMC/uFYFdK1hL4gMm+I8yXwT0AX+OO8vhCN3JVCoYrR94wfeZJJTJUDBfeRivW/s0hAjZkxOphgZ2JjgceDPBgE2bvjhZnVP2QB3FRye0GHtWCBkSMz9UaUnVNkdUAJi8GDHKnI6fdYyWHjeJl/iFtvl8WnW5Jj+ystMyoxXKmpTPc4+5Qdi7CU2chyIYE+ymgtbMP40zHl7OvY244kx+Fj7pD2gxa1eKTCnghasZpGnkZ/ROuivn9iuajSyo+F/sh7diiubWVGz4+zSuWxw/7bjYCMj+RGgoHOmG+I1ZTcYQJPcCiUs5MNmfXMS0/Gox+BfSqqlBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=jml7J/B/HxfOV41OOnv7IhR2gemZrOl5TDeiVE9asYw=; b=QVPdPUtqFsU8HWtAU17gxr7voi1np41neM7ykS5Ct1CFgbwjJgUu3o7v24pgmj1yv4eOSJhgG/vpWKqyPe1CUaptBOPgSLg6rvr5mtCn7EECx045Xzt6YGR04XuRPng1npPN/ykpkWKV6t6l8w+MX/Fa4X3nS52FplXyaZGuXtU= Received: from PH0PR07CA0023.namprd07.prod.outlook.com (2603:10b6:510:5::28) by MN0PR12MB5931.namprd12.prod.outlook.com (2603:10b6:208:37e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 07:27:47 +0000 Received: from SN1PEPF00036F41.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::95) by PH0PR07CA0023.outlook.office365.com (2603:10b6:510:5::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 07:27:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF00036F41.mail.protection.outlook.com (10.167.248.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:46 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:43 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 07/11] platform/x86/amd/pmc: Use ARRAY_SIZE() to fill num_ips information Date: Thu, 7 Nov 2024 12:57:10 +0530 Message-ID: <20241107072714.943423-8-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F41:EE_|MN0PR12MB5931:EE_ X-MS-Office365-Filtering-Correlation-Id: bbee1f4d-a160-4ab4-e39d-08dcfefdad76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: Qw9vNuoF2YZUtnkHEH8VbtPfdQWjN6Df2Uvgk1rCgPABnNc7LDUYL/m7Vaol+ARaCyLacZrmU4R0wCL2UliZqHnGEskGA87ArXOXpab0hhwsWk25zTAe+lrfZLZFKyP+Dl7BPFHPrAyeShXlMm4cFWefQB1zVRNZ/UqRjqLg0c99Q5OBqJxbAmFhaRk3L34C37Fq6fNLq4mmQb/Yo/BiBoEguFmjpXQBZyUW7fROCzSE7qvZZpIKi2wWhd4jsP6gaf+CT/Oi1xY75DUg164ptHHLQFzXhbcxc2p+KI+uzQRS/gd4b2pjCD+JKJ8ImGKk92gNiC92woPlXuaQ1uCWamb9G9O4hhsqBC44le7m7AsmayVssk8ufsVrEzSAoAnLNLd4VkL3J2raSePCCcPs56FhumwScmXuqNjC68tX+Y/61VGJW8mDDiyQVwIvTlt8ENkTJ8sQZ/BIFlemiYS4ETARC8C+agDAmkEdmoF+13M+B5secgArwVqbiLwRz3CoPVxNdqUsU3nfaOvxaJFm0+k3hJHHb1GZUrEsVkCvfRL8Z5oGP6OHecErSEbEgsixL6cgAQT5Yommv9VgokpFa5LT8hUg5wMsdv1acFLCWFSjYWg99EnWxxc0gGPgJpkXRA0QNYsru959MckwhOoKE4q7gLuZvnqob9QGiJjxUvpukNts+swTMTMbq81kz5z0S8vXwPy4sQt0GPuvLwpUV6mXBUKrkS21Ka7J2tqjb6gWIEBIEztCqPLOanQkMEq8080CJIGFW/eW9hPEmBeOyQbVZJHkXcorUz7C75hrX5OARdp66P/Nq/TtclVs/TeSQp8htQ8HOu9QX78TgbYMtAoufaeyTD8M4sxBUwb9jqOhL6ym0xmcMqlqNypl2Vx5a9//PyypAIigAiGEvK4viz7oerZLXhuBcyXt2/Z+fnbKfg+i6rupSOMEHJQWpR/IL4UxpNgowPQaWWggNYqQPkuxffbW8lf0yyjHsmCoVumBNH1QwlxQBa73jaYJ+eVx31GGHQvpEGkPn4VoKBCXMXj4I/1gnAc4dd5YQ6o/FeuDupbpbqsMEohe4JgX1PBjPbQnhps+W7wrKZw2B8BRmrPk92JfoQzztSckbU9yH/TTa0Dwxu+kCP2sGpt3AJ+8ZcFW4Swmj5UyeS3oTuzEp7U9gObAMDLO5ynNkA4KWum+p8zSc5SrKWmE7cGbiDVGeNfOm5Q6pHTohcsSXervJDbhKXUG1TLDJns2eAVs41mLz7PJnwHavGrLTEMCu6UFvVnjqnTjDaHmqW+pX3ZLF3JAGltn5LTJUP9ovAUhqU+chBqIGR1LO7O1nO7H+0c8mppyggy6hXBvKveKeW4fEHb18rsZYaUg4dNbvmm7vuGyqqp/fFjaihoQFASrDEF0vo813ejOzUqvHdQu2gXHqA== 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)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:46.9261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbee1f4d-a160-4ab4-e39d-08dcfefdad76 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: SN1PEPF00036F41.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5931 Instead of manually specifying num_ips, use ARRAY_SIZE() to set this value based on the actual number of elements in the array. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/amd/pmc/pmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index e03b576105a5..7c3204110bf8 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -117,7 +118,6 @@ static const struct amd_pmc_bit_map soc15_ip_blk[] = { {"IPU", BIT(19)}, {"UMSCH", BIT(20)}, {"VPE", BIT(21)}, - {} }; static bool disable_workarounds; @@ -169,7 +169,7 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->num_ips = 22; + dev->num_ips = ARRAY_SIZE(soc15_ip_blk); dev->smu_msg = 0x938; break; } From patchwork Thu Nov 7 07:27:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865941 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2068.outbound.protection.outlook.com [40.107.92.68]) (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 E733B196D9D for ; Thu, 7 Nov 2024 07:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964472; cv=fail; b=ZmzqeGILP/1JVt2kppY1Cz6xQH1I3xqnskcsfTZfOFZggoHbGHt9sfOQu6PJ8ynwmraABZDrTCyTnAmYIaJKBhCXhH/+BzhKRJfNSEjQpqgqLOFnYGnWXwODMP3lYBD+4LemNd/djuo/Gd7L9FJHNsWPkSxRGy0u2fsbQYQXZsE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964472; c=relaxed/simple; bh=v/Lzk6bexhipwd+kAWwSfLfIUuXdxNLXJxjwJ19qmz8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ive83R5mtsY5NtWMpj31EWJ+DJTIascm4K1cchXUAWjkY8zVn3vMqUA3RpcAu2/qrSk3pPzo3hLCT8aMXsjjXQJJtT3Gg2L5/Fp2wivZyOXHv8KSW0c9dRfqPckyWSaIoasQmHuJ9aBo6yDhHqj8eHi4Zzl17vKhdnIDg5ETcc8= 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=UX2xTPvN; arc=fail smtp.client-ip=40.107.92.68 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="UX2xTPvN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P5LCy4HQlY5oUDAMQdcPnGQryp0LGuCN1rxOjxAlbwXserLITIj8l9b8jrvE7iLMVLklO6UTiIopWuoPl4HI9hZQx/anDqVZMsK6AiLNK8fisi1tVlfrT6P+PN0sXd1dg8Xexk7spzXF2STsVve3dgeZkSA5y479Q4OKSuddFZhuUjKCKJfKWlIWVBeATY7ydbN/7MNTVxdYKG5/UfSsdc8lRK0Oo2LojnDLk90sfdPQjYvX9Ld+PGjA4odYn1EByMyzMx/v8M7+oqnbxWXk1JgnOvSCq2Jj0npgukNqpbkE+GMwxrnUEFEdCVyyL2C7c8lpWONbzCHwMfQdZuJ85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=WgrhRWs4QK7gHFw1rGcUrnn+rwx9xbzSl69zuWj/bck=; b=l4VcjbVzbDBzq5t8zT3Km9MOuyg+dvkDWVgNafLol0LNwY8h7PMQ9QxS0Gy/IDKciuh+pfxvmE7TWRqFpbT5V72IZ7O0UaDb+wx3tjn2ZLKWW0PpUlkumRMNAaHPgCpavNaxQLx5vcRu3wIrIvpB2o7xBOH/OTH2JjzOVt39ld2cR/nQTA2UPhWd4VZR/tkoRwmIvS+7uvQWJTuVQ9YVAp1ihSKXXgyhxpQ82Jg3yyp4XAfcXGE02Ii7kyshdTEA43xgoal70S00jREzDACMh94vk8alvA4vQOezf8BmEDcn9xagetEnHjrwG5ZlheL9pFCXed0BsbBfcLs/uAELSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=WgrhRWs4QK7gHFw1rGcUrnn+rwx9xbzSl69zuWj/bck=; b=UX2xTPvNTLyrb3R9hSQgKsGzKnGa/zLsj/GGfBjA9MzuDDO2rO2tPZBN30jdgR35ACRhNgGo1Pb2XPujnQGmwPNHKYPZi21b8tlJNfoCyQ3Ug0ON/1zZZxNQrfcsr9urtgeOPFQgccbo2GxfxxTDmK4blzIyebiaJl3/39SKsJs= Received: from SA0PR11CA0156.namprd11.prod.outlook.com (2603:10b6:806:1bb::11) by CY5PR12MB6384.namprd12.prod.outlook.com (2603:10b6:930:3c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Thu, 7 Nov 2024 07:27:48 +0000 Received: from SN1PEPF00036F3E.namprd05.prod.outlook.com (2603:10b6:806:1bb:cafe::4a) by SA0PR11CA0156.outlook.office365.com (2603:10b6:806:1bb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31 via Frontend Transport; Thu, 7 Nov 2024 07:27:48 +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 SN1PEPF00036F3E.mail.protection.outlook.com (10.167.248.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:48 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:45 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 08/11] platform/x86/amd/pmc: Update IP information structure for newer SoCs Date: Thu, 7 Nov 2024 12:57:11 +0530 Message-ID: <20241107072714.943423-9-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3E:EE_|CY5PR12MB6384:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ea0a870-8a37-4f32-a960-08dcfefdae2f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: hF6ooRPk4k/WDdW4eNdnEhNEJwnv4rndwbtBhsHN10Az4dWLdGfKtSfhJ/6ZIpPGGvfI53O1qcBeSkioxXzt99R9nrDR5fx/scxcmSfJK++C6/HIw3CDFNTvgKIZdTnYR+rkvOqp3eQ3ocEaN8iITJC2CiCUCTx1Mc/4+dNF/U4DzGMJDxwkH52v0e2tFItXHUD84sZmfK9YZYVJA7dfXW527Bm0B96kkpr+29ylCDJNc9z21fgglfOlCyhU5vNIFP5KGWsByZGl1G6Wy+i/FuG8oLubNmC8SDs/f7lKgthNhtitSLDRVKR3+QlIE9y301xOE0Nf0SLmjLLLPkNYVVqaq58iOuMxlUM7Uo3PHG1xdGmVkEHAEKaTkgXUOHYHV9y9p+77HuubgecUEZlQmtFoKqlSzPY7J+1Hamy+rLBEoZg7MpQTla3Ul3VSqi4C2bVCWOy5rWQLxE8Py4OYFBQDLK5ln3/L4VQ00GSvxrrRw5xMiB+UR1UOcJnojnbbjkAEW/t344uTfsHc2qT0AyS+PHob/9f9k8ouiXvMC6jrONe8Zv98Td/NzKyCxEc0lWB8yizfHNNai16kfUWUhLFJNQvkZ2PPYfAS/wmbTsG5uQVJQqVfJuERoQIQJ+/t4agcOVljssI73Qn6/CCdvcKXYR1EEr2xeh174tj5tD3vDbto+HUGb62brnqFwT7h2BfTBpTbkZ070PGA8XVJz+IqS/JsF8UpPGhLc28lypatDNFDAZoLkrhqdDD+jfzXyakNKdzZl9AA+1CWZ9J0vooYhovz025OELN63fTQdv22TnT4ZmDnOwHAgHSgb7lozhF1PyHjJegJxDyP89wKRrOCW0ht8pGZ8Zrkr8chMWxe8vNpDTeydh2vqogcfZ8SnOHkKfYDZbb1dgyLLydFGf10SZ2DOT5646dJudE0JaYYbs1azpY+vlCIcjFT/kvsbMUQZeE41zCPfmlAVZHeV1JCEO70pa44m5vIk/dAfJw0h4fBZj5scMynGkf3c/BAivCQTdKCVTYKbq42YOLiRh65W9BoKoD5pwyZpfApeKgIYhbfGn53eAKj4EgnCLQ8JXh0dBQukbg4z030Ekdg+vvdr+Tu+RycRPGjoWHxmBlL0SemsEv3LRmO187K7XW0IJF30AkC/oORpCjNPNPkdXKeO5jY92E2nY1WbMMQHBqbGAF7hXR0uY3O+2Y32GqireuEr6yntc0K5sWtnWk32c0O+7ONXqqY6zb+jQ6JcxFkhGeQEKgtWD49Ro1LpycOSQUeHU9gY940YpaCJ1LLU7w4u1HXwAJ+uqZk5saKhViRPSLS3kG5BYhbXacISkRrFJvmBtuVaK09riqeup3QhxqrBBNhc7y5sv6Froip5569gIs8mPtpsLxAGXAZaYIsD8qthlWFmUU896kudiRw2g== 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)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:48.1370 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ea0a870-8a37-4f32-a960-08dcfefdae2f 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: SN1PEPF00036F3E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6384 The latest AMD processors include additional IP blocks that must be turned off before transitioning to low power. PMFW provides an interface to retrieve debug information from each IP block, which is useful for diagnosing issues if the system fails to enter or exit low power states, or for profiling which IP block takes more time. Add support for using this information within the driver. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/pmc.c | 42 +++++++++++++++++++++++++++--- drivers/platform/x86/amd/pmc/pmc.h | 1 + 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 7c3204110bf8..5b99845d0914 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -95,6 +95,34 @@ struct amd_pmc_bit_map { u32 bit_mask; }; +static const struct amd_pmc_bit_map soc15_ip_blk_v2[] = { + {"DISPLAY", BIT(0)}, + {"CPU", BIT(1)}, + {"GFX", BIT(2)}, + {"VDD", BIT(3)}, + {"VDD_CCX", BIT(4)}, + {"ACP", BIT(5)}, + {"VCN_0", BIT(6)}, + {"VCN_1", BIT(7)}, + {"ISP", BIT(8)}, + {"NBIO", BIT(9)}, + {"DF", BIT(10)}, + {"USB3_0", BIT(11)}, + {"USB3_1", BIT(12)}, + {"LAPIC", BIT(13)}, + {"USB3_2", BIT(14)}, + {"USB4_RT0", BIT(15)}, + {"USB4_RT1", BIT(16)}, + {"USB4_0", BIT(17)}, + {"USB4_1", BIT(18)}, + {"MPM", BIT(19)}, + {"JPEG_0", BIT(20)}, + {"JPEG_1", BIT(21)}, + {"IPU", BIT(22)}, + {"UMSCH", BIT(23)}, + {"VPE", BIT(24)}, +}; + static const struct amd_pmc_bit_map soc15_ip_blk[] = { {"DISPLAY", BIT(0)}, {"CPU", BIT(1)}, @@ -162,14 +190,22 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) case AMD_CPU_ID_CB: dev->num_ips = 12; dev->smu_msg = 0x538; + dev->ips_ptr = (struct amd_pmc_bit_map *)soc15_ip_blk; break; case AMD_CPU_ID_PS: dev->num_ips = 21; dev->smu_msg = 0x538; + dev->ips_ptr = (struct amd_pmc_bit_map *)soc15_ip_blk; break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->num_ips = ARRAY_SIZE(soc15_ip_blk); + if (boot_cpu_data.x86_model == 0x70) { + dev->num_ips = ARRAY_SIZE(soc15_ip_blk_v2); + dev->ips_ptr = (struct amd_pmc_bit_map *)soc15_ip_blk_v2; + } else { + dev->num_ips = ARRAY_SIZE(soc15_ip_blk); + dev->ips_ptr = (struct amd_pmc_bit_map *)soc15_ip_blk; + } dev->smu_msg = 0x938; break; } @@ -337,8 +373,8 @@ static int smu_fw_info_show(struct seq_file *s, void *unused) seq_puts(s, "\n=== Active time (in us) ===\n"); for (idx = 0 ; idx < dev->num_ips ; idx++) { - if (soc15_ip_blk[idx].bit_mask & dev->active_ips) - seq_printf(s, "%-8s : %lld\n", soc15_ip_blk[idx].name, + if (dev->ips_ptr[idx].bit_mask & dev->active_ips) + seq_printf(s, "%-8s : %lld\n", dev->ips_ptr[idx].name, table.timecondition_notmet_lastcapture[idx]); } diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index 69870013c0fc..f6d9a7c37588 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -62,6 +62,7 @@ struct amd_pmc_dev { bool disable_8042_wakeup; struct amd_mp2_dev *mp2; struct stb_arg stb_arg; + struct amd_pmc_bit_map *ips_ptr; }; void amd_pmc_process_restore_quirks(struct amd_pmc_dev *dev); From patchwork Thu Nov 7 07:27:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865942 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2049.outbound.protection.outlook.com [40.107.220.49]) (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 C5FA7196D9D for ; Thu, 7 Nov 2024 07:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964475; cv=fail; b=Zdx2T7LcshOWSqtTh+qRWcUyFUilyK4T12/8d+GFSGyhxTTTr44oX+kUK/CMcpDd4R6iH4c4YTj8308Cd0vpODG59DZwJq0pTA3SZUp6/0hJ6KK4SDFYNr8ObcO+qZj/LM/cKJtMClCmi0bID1dkNSYt88IyWysdUaC/PVhgiRM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964475; c=relaxed/simple; bh=cFsiaEhIwb2M3eVu20QYprPIRN1wWm6CAGVK1goUbv0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jv550PFh4rPSvK6tj41bsJNe6RldwFfPerFj84Jzih2iqCPVXY4s278TlP7ZexE4IkfP2hnPpDCnpvPfpZEO9ZWleVyuLGs/extq+nxXoGmI6nZoGVExXXo0gzYo8+bplO+CPT9KHqZww2gOHocedmvkC+M7dF48qOzuPbkS5Vk= 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=gdsV1mrq; arc=fail smtp.client-ip=40.107.220.49 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="gdsV1mrq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=au3H8AHRjfLXbstjIzOtK/rdGEFBLt2hIWRo0k6kLyXQrEhqW0Fq2/z4aJ05oROkXTiasb17gNYVO1aYhx3Vfti4Y9u+m+1Vyjy2aUojU02XctuElFnPWaushgciHMJC4pN4hGyMUbdqQuxFZQHA+l2k6GNdutl5c4SttnOKkDMXRBvMPnL1UbuI/vvCAQOVw6zGvWYi7EWTNfYGc12wXya5alXjoK699Le/2mHtJL+1SkLgShS4c74vnVld0coouzAo3GdWo0V1hHT3MkvWPCatj583Qe2X9kE+3CLHi/gu1eKdFaiNfSfws38pX6oVVqjRogUgtIqIUFJ7S4Lf2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=DL4+wdjqOWvxvHnEjOfOLG3FPfrdAcLiqWxn4BdRdWc=; b=FBDnEObuBy4dV7NfSeoOLaM43k2j/PMObaYVggc3mK+h2IQvrvU4m+HYgu97plBNeRUIKWXumD+uyFBwdvyFbFPQXAMf8w0Pt2ppbBRgBJcoB+OlE+tL03qIp11SI15IwGyLT8SPpuEQuELWXFtPf62KvAFRoJEyLB52Y2El6hoZ1g/ccDMYM9ITXUvu9jNhoh3oSRKj83LcsvAAzJ+DwOkH4428X7OK26wgEiLThn7AbNEoH3OtVrp5eatIF+niB5SpZbBw0j3/PmglHjWfz0VPFN3z5zPWAk64CCxJNlKyp+sjH47K6oudXDJ1wR0Q/gxOIVz/RFkNCLl65KcEkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=DL4+wdjqOWvxvHnEjOfOLG3FPfrdAcLiqWxn4BdRdWc=; b=gdsV1mrqLrd13GLbdAWw1+4ZojEzfAQbiLG9jzSxFmVhGrm7GcIfmzfoo3sVX5jz86jWHGm2Dhl6H8QWFZaGmPFZvPlnxQAtBOkz+eDvKmxuHgXIDABvyyB636TZZw2KJXeNJZRdeQF4GfTosy0u9QUAGUnC6ViBqYmo9cQeJ18= Received: from PH0PR07CA0028.namprd07.prod.outlook.com (2603:10b6:510:5::33) by DM4PR12MB7576.namprd12.prod.outlook.com (2603:10b6:8:10c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Thu, 7 Nov 2024 07:27:50 +0000 Received: from SN1PEPF00036F41.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::39) by PH0PR07CA0028.outlook.office365.com (2603:10b6:510:5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 07:27:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF00036F41.mail.protection.outlook.com (10.167.248.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:50 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:47 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 09/11] platform/x86/amd/pmc: Update S2D message id for 1Ah Family 70h model Date: Thu, 7 Nov 2024 12:57:12 +0530 Message-ID: <20241107072714.943423-10-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F41:EE_|DM4PR12MB7576:EE_ X-MS-Office365-Filtering-Correlation-Id: 6131d8ea-9ebd-4fb5-e111-08dcfefdaf79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: bypzgEesv2MvroTfKOGqHsnykPUUM+61FSOCTNIZrTX3rI0yxBS+Uhwyi0dHOzNMJpltrfjt9CVi3duP36YVuCVMnGBu/J9yzPSt/4ulQJ0utY0F5MCxmngG+nSkqxRJk1Ru2tZ9Jh4ti2a1Ll1xfwW5KaoaMYodETLYEnJ9Y8oip4B0nyqvCTeotG6ODnuvm37mEJNUfHdOxeGuTDfLfg884XhF8rYNgpmHiViIRy8aizzbRz1E4FLpPUstFguo+aVm3l3Uy2HqzTbwqp0CMex413bYtTCetK+0sk/GjEXG8vmw+kj9Av1m7AVJCXPmtgvzESug2RtRSi4FXbkd+JB+Osbqcgr1+XXSsf32Tsza1F2i/J53siTOJSmSZUNy/is3hrpl2GeoJqbUk6psIOSqbXADNgNVnDRqhubM+iUptGLrBuEPYi+PMVdcWtSoVwWg0W6122f862iMjpNAgUTWQoCuzRTkr4wzl7uNrvoz/PSBoaHLrLVg7XYfs2hbOSWCDks6/p7XclBsER6ghnV0D8Wqa2gGMQlL1p8wpgHePE10avzgjcT44DbZLm8o4oMla2rxDQ+2GqPo36EJCr1+CoC0QtIhdjCy/K+toXePbMuIzHrFNRpv/xu7ASoLQDFgkrvFQcoWcA3tSREAwVeOtaZ1fxlBk//nyDoVmLo1wJe42dq5R00J243xkevZmnEpCDuN9CMVhcIU8ZE7ogd4LNkzVDPCeNTq2Esp9VcXL147LG3NT8vXAF5N0KE4MW3ueMSSsFOO3ffVZfMrgXXJEozGLBDPCgqM+RS2BgTKWcZ2lE5xhxBNEe+Gy+ndPQ8tFJayF88/6I2uKVPduWX+1t1VAM707zEDm5D2+ghuJtYyermTv3gpuXp3qrweBwjrTXPAZzEpDjzX1zd7YsXMOMZWVGRQs1gVoUXK9GdUvm8ofwGbqKXyI13lXHrEzAmfWjQ+R6R+h1VW3DWTyzFeQmrYXQckmN5iIZ2QEeWxaxMCSwBwbuH41lTeKCkogSUVs9N/qgYKMfv06PfVPN45lVGh6NRK077v42fSa6fS+lDDdzx7UFuCv2fOR1PXOvrg3rbRo7PIoxFbvvXdA4AQdgKUwdHxWedRUCb3kJwyc3D/RmiWU1or5rSmNE5vtsfC0lTKfC4SOtZzfpiajn9svdBiXe1gcki4E/a3kh3feOYHShwt+bfXS/2Brh265Kkrj5EVOFSPTSpVXjFYdNVm0ZkFLb7eVLDIRKrGm318YCV1JXK8LhgfEc8orP/af3jNCn54nYp9DeYKm3wyBUfWW6hiujb1iRJxNmKqcrqmy0XlEs0KMN7i/XsGkO5TLWxwxgMk/OtYLkJsQoaxQt3bwR9HTs60EAJZoaQsLmiA9wcuS0j5v8KOY1aMbvd0fzM9Oqvof/HeYpbD3irjkw== 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)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:50.3167 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6131d8ea-9ebd-4fb5-e111-08dcfefdaf79 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: SN1PEPF00036F41.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7576 AMD's 1Ah family 70h model uses a different S2D (Spill to DRAM) message ID. Update the driver with this information. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 6a54dd3e7f4c..d19a13a82e1e 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -245,7 +245,10 @@ static bool amd_is_stb_supported(struct amd_pmc_dev *dev) break; case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: - dev->stb_arg.s2d_msg_id = 0xDE; + if (boot_cpu_data.x86_model == 0x70) + dev->stb_arg.s2d_msg_id = 0xF1; + else + dev->stb_arg.s2d_msg_id = 0xDE; break; default: return false; From patchwork Thu Nov 7 07:27:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865943 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2047.outbound.protection.outlook.com [40.107.236.47]) (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 24D69196D9D for ; Thu, 7 Nov 2024 07:27:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964478; cv=fail; b=I3Hke3ElHRMOJUhgoJN9jX+zrJNFrQc/jfwBxFWw3VT57D1vyE4eSj5qTOXsGjeLl54NCsMgGpjAcJFZFSqTiQewRe5dMiNRTeoQmd9V69c8d6PckO2x2nPR2erjh/F7rnZBLkjRLcUKi11J9NEVIaFstWgZZBMp9DEll3cL8VM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964478; c=relaxed/simple; bh=/pP3zgOqPJXrGI3XuQfUTszCxSIcckTmjeEb15xiJGA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SPGGeyI3Q+iVLYJZeB5jc+aYVlTxquEdcnP3nlrDyaVASNNLtiz1ilzjYh6V72Rz21gZQ23HXIVDH45/X+e305uzRWN5d3AaGCX1j/RwzW+xy6Rt47WoMQubqJpVqN25xIlDdoyE03zlYdcK8z/LshnVb/7G5p34dsXihoIAQyE= 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=qExGrFfz; arc=fail smtp.client-ip=40.107.236.47 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="qExGrFfz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c6idnzA1bwEE6sd8KtsVa1bQfMbaCaNIpXe49UY87xu3HCqkfADh1D80c3i4qUkmSog4sSSqBf78/mDkyMHByjtBQf+Q627Rger8ZpeeRqRUcJlIWHTUKmwfa6RU8XAhUU8QJgYQVEj5W28LvdYjDqlQuORK9NdWuSwoNZLalCEN0x2KkFNvVUT4Zw2AHFbOkifmYfQuUkwHh6oSnPPiYwzH4xcts4xcFh9zROqi3P4CadL5Uyx91PtU8dBoycrtQxyg+NlsEuwnat7DfeoKD1qnnSmYQtKno7pQJ4Kv5fd2oXAQcZbe/kyREAt8h9uxyEwPvkbj3yf54g/EZ9FVnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7ANLe2AzFf2d36GQZwoiuD3S55CjPJwmYcGPf6jjU1Q=; b=o7wvhJOIckNvTeSytLWEnbr6ipgWFVaa6SUC5PA9K7eVt/HxzdVkbr3J0CuOK6jPSepMVIa/3nEmqKxXNUSEbbU53SeFfO0QaV3ckox8kF9rPyTNoZz3/IbHG58yI6Fvsr6FFKpi7QQdSvMZZPEws8yC68anYIUZ2dXN+nnjH+m+4TXqdIbB1YytT/LKbiJZ8hQg/liIXrB9Bo22/t8egHCPjxDMo0afzaN5f9MvO4cctgtZoeybRvpMnUK88tRmmk+KNtB+sUcDHtbG1WPElTCMDnaJrG9/lHrscV32s4C4R3TCi67MYdYk549xa/QJ4NCaQCT1aMQ29nu8GxIVBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=7ANLe2AzFf2d36GQZwoiuD3S55CjPJwmYcGPf6jjU1Q=; b=qExGrFfzzp+1ZmdMV5QJigHZRs2BG15jZMMHrCbPGHMjzraSCQhd4xk5JwIHKcIY/DRlcEIkVEWL1GWdwwheXPTgjEPYrYm9R3eC8kujjxbdjgm/MFF86NvLtklkPv+yIzgHa/xCNMzgXMMcigXTsMaUscQMc6C3jX+inwxttL0= Received: from SN7PR04CA0154.namprd04.prod.outlook.com (2603:10b6:806:125::9) by MW4PR12MB7141.namprd12.prod.outlook.com (2603:10b6:303:213::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Thu, 7 Nov 2024 07:27:53 +0000 Received: from SN1PEPF00036F42.namprd05.prod.outlook.com (2603:10b6:806:125:cafe::d) by SN7PR04CA0154.outlook.office365.com (2603:10b6:806:125::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Thu, 7 Nov 2024 07:27: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 SN1PEPF00036F42.mail.protection.outlook.com (10.167.248.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:52 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:50 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 10/11] platform/x86/amd/pmc: Add STB support for AMD Desktop variants Date: Thu, 7 Nov 2024 12:57:13 +0530 Message-ID: <20241107072714.943423-11-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F42:EE_|MW4PR12MB7141:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ded350e-b02b-4d53-6e33-08dcfefdb0c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: oagklkoZBBkdQ3Nx6/pwU12Pb0TRfVuZMmKJWVV1pHoWxmMe3yXvz1VODUgQyiCkTy4zzC7XcAaSo4V1KCQg+DWPyA6zmP+ywozKZaZhZlea1WBJtzYYn3dZ/EjICHMibmxShtVFmCajQIDxvG8+Zv2LXsj1agQjtgxPuCZ4sTQGa9+NQb+4jXIRTsJlfwL77RO9gbjqEG2wzF/hETLdBwtdmZEhQcmNw8mWIIiu/eCT1w+dHGj1mZbbcJREjlrNW8/1qwJZnqK5p4IYeWs7sMI6vhoyDiH4KCx+rsqbYuQwYfKGIFvxsiSX/bRhwkj3EiIMrWQJSvfN5dgcqVvl4LDJexBsS7qUVCS2C+V4CPzq5uMvI/CuMDpGzEnkN8xsUbfvl5JXY1g7oHkhlHuN7R8CBh3V6HhM8f5HhFG85R90G9g7KYCL4WvffI3ca3MefeIgJtiCEadDbqKVxRAmMotE7+puoD23JtkLCqgGnLttUfT++t9Ps/LDDvwZwG+tcAVbZxbUP7FJF0wyk8wir/WO3C9MQVjSgziGG6Nf5vMjFj5OTYX8zdN5KiONmLP1eBQoh+5o7zi144JrmnEHhZN7r6+JPnwsnXHbzNWQZsRJnLj5o0dnx185LTUYQarZDjS2vE+xy6T5RVcJiWssqjRXQM9RXLf7WWSxY7ecCFCSAHP1zRgk7xM3fI9jDdIIo6IEhh2hmHgwn9baAhEy+YNi4UAXnOwQ1L0IN+AF3+d00jg+KdaLyUzhedajwsmt7f0jgHar83UuNsVHuBq0BKQn3vtlpxZAvsRJK/DQqOJQZVMLnOpWsXvWZm+T/ojkvriWX7M5hqJvo7OtobWDRWjPW1o4DXqGEmua/GhbmBeUSP9rTOeekce9Z38qsr/iu80y5/NX9ikuHWqHalVckFrPuQWCY+LVe36qi7gDZQhtiEP26ZIsMqB5p0SNk9ENT7icjbqAFFYcU+nwoZ4gjYSgvrTY5U6nOrjqBq8Mxmux8UTmc9+DPjQKTYwuA4E46hlnZHsyYkOqnTMuW4caFr6jZp18VpOqqlw4/3Fk3WpOUZ4D0b5xYzYHs1SVA6HKjRcpN57y/WxWJDsc7gb99Z+bK1JO2UVypeDgjnxg/egVwS8DJvarxkvD653q9z5Lfn3bjLJwY7NZcFXduwKOI7Ja2K5akTBRNjxkqAKmAjwlHHZwIm31nRNAmY1WWRiTnFO7CZZPikWcGJNDRmmBad01IMDUri9xFL53TDlgz7CDpYarysh3J+APGCyyX5no3+ARA1CbxfP2wjRJ4buLpkc88FYNzFMeMjx/8yyybJHDZDJCjAoxPBt3MpR7yrcWEMX0b/FfJsyFGs/GoQd9Tpiy4HoCN+CjyZ4eR3M+RsbSZzFD4tcRYPzCbb5GkNOip8O+enro/zFE3JgZ8sfGHQ== 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)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:52.5002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ded350e-b02b-4d53-6e33-08dcfefdb0c9 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: SN1PEPF00036F42.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7141 Previously, AMD's Ryzen Desktop SoCs did not include support for STB. However, to accommodate this recent change, PMFW has implemented a new message port pair mechanism for handling messages, arguments, and responses, specifically designed for distinguishing from Mobile SoCs. Therefore, it is necessary to update the driver to properly handle this incoming change. Add a new function amd_stb_update_args() to simply the arguments that needs to be passed between S2D supported Mobile SoCs vs Desktop SoCs. Reviewed-by: Mario Limonciello Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/mp1_stb.c | 33 ++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index d19a13a82e1e..c005f00988f7 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -36,6 +36,11 @@ #define AMD_S2D_REGISTER_RESPONSE 0xA80 #define AMD_S2D_REGISTER_ARGUMENT 0xA88 +/* STB S2D (Spill to DRAM) message port offset for 44h model */ +#define AMD_GNR_REGISTER_MESSAGE 0x524 +#define AMD_GNR_REGISTER_RESPONSE 0x570 +#define AMD_GNR_REGISTER_ARGUMENT 0xA40 + static bool enable_stb; module_param(enable_stb, bool, 0644); MODULE_PARM_DESC(enable_stb, "Enable the STB debug mechanism"); @@ -233,12 +238,33 @@ static const struct file_operations amd_stb_debugfs_fops_v2 = { .release = amd_stb_debugfs_release_v2, }; +static void amd_stb_update_args(struct amd_pmc_dev *dev) +{ + if (cpu_feature_enabled(X86_FEATURE_ZEN5)) + switch (boot_cpu_data.x86_model) { + case 0x44: + dev->stb_arg.msg = AMD_GNR_REGISTER_MESSAGE; + dev->stb_arg.arg = AMD_GNR_REGISTER_ARGUMENT; + dev->stb_arg.resp = AMD_GNR_REGISTER_RESPONSE; + return; + default: + break; + } + + dev->stb_arg.msg = AMD_S2D_REGISTER_MESSAGE; + dev->stb_arg.arg = AMD_S2D_REGISTER_ARGUMENT; + dev->stb_arg.resp = AMD_S2D_REGISTER_RESPONSE; +} + static bool amd_is_stb_supported(struct amd_pmc_dev *dev) { switch (dev->cpu_id) { case AMD_CPU_ID_YC: case AMD_CPU_ID_CB: - dev->stb_arg.s2d_msg_id = 0xBE; + if (boot_cpu_data.x86_model == 0x44) + dev->stb_arg.s2d_msg_id = 0x9B; + else + dev->stb_arg.s2d_msg_id = 0xBE; break; case AMD_CPU_ID_PS: dev->stb_arg.s2d_msg_id = 0x85; @@ -254,10 +280,7 @@ static bool amd_is_stb_supported(struct amd_pmc_dev *dev) return false; } - dev->stb_arg.msg = AMD_S2D_REGISTER_MESSAGE; - dev->stb_arg.arg = AMD_S2D_REGISTER_ARGUMENT; - dev->stb_arg.resp = AMD_S2D_REGISTER_RESPONSE; - + amd_stb_update_args(dev); return true; } From patchwork Thu Nov 7 07:27:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Sundar S K X-Patchwork-Id: 13865944 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2078.outbound.protection.outlook.com [40.107.236.78]) (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 D8109198841 for ; Thu, 7 Nov 2024 07:27:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964479; cv=fail; b=XOaGZAcmynqmpdBBKXzhiHLxhBLPyJU9vwDSjxP2gl3WLA4XVdt5O6jpLNfEJSHNkihtXDjzRcFPPaAkU6p6YqU5Kt57SmPzktsfSG3K2AsUp4eA+j4ueLRHUmWkh0g1AeCMrj7KsdoJAvsM88dEKxZghLNqxGCdx86KaZbBvo4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730964479; c=relaxed/simple; bh=6nB8OpxtwswmgeLJr8x7V25awST8sgsYZzJwhXLJDNk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=b1xCfINI+5FGXZvdo1h0BCRAdv6vsAWMGfwEUx1pGV5eeQOG3Rv4Uk5WGUmNRuTNPvVBZ5ou7zHANbjI2LVLA07IZDmwFJQidlo28JUQRdvdjx6hG6Padx7Uu/lA7qIUwqus1VtAR5p1CH5MZ0AAQLnVLOsQrCT5KWqZ/jXE1dU= 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=mAUsuSZf; arc=fail smtp.client-ip=40.107.236.78 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="mAUsuSZf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q7D9O3e51FJ/Vgl+ZhMeBJyL+SRJIFrBObVWKLi9fw6ymjpZRcUhinP9UNrLGec0e5xhJVl6qsMc7Na9zv1GP8ScMCoB5jOLedp5+ZbWRnUedMmdmvVcZ4y2YtAv/SFW5OovNw+WIzNXWGibrd+xZMYAvnGPjBvre8XBWCdvG0oW6K9MOFao2sDun9n9N0EFNyOXc8EozmmtLZskJ0OAkqgAVbUws+xUjFMDe0HIpaHlQ4IDbI6h3Hob5llM+shjzM61hRkOCkHLWchyRWAsibBRxazUxgRlYrT+XTNDOdo/kZEPszuh/xP7l4OWo9xXXWwmOTXQSVVOFTMwkAwCrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xkk70Q1IQNV74wQTovoCrz8FQm7x+g/AhC4HOP2Vmlg=; b=xy3fVVsJ47wUkIXGNPIVxQHCr7D2KfNugDb7yjFMgylnmzjt7EK6DwZ0I8B9jYNb4ScUkluq+htvxsEnK4PWrv/1woolexLS+kZ8zCMKWo3+nL50ZTQ3QXDcOlvNN5EbRVgrEJR755uplgE3ss2CNoPBfRv862SBDcjV5xCs45QllSocxZMZjjNF4uzETCv8wMKRs+0uKnXzI/GGlEneNwpULoySfANEzWJYw5k/PjmFvNp3JQKuksJL+C2AvYSm1p9QpqFS9iNpdjYFpwWi7k5PIJjFClkqkuik0qbiu6oLYvbYyYHtQPt+R+7IbVCveMeTgBUDBJXVL35Y2doRhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=xkk70Q1IQNV74wQTovoCrz8FQm7x+g/AhC4HOP2Vmlg=; b=mAUsuSZftGOveQ7+lQLAXFQzs1+6meUevQ5mqiXVt7Sv2TDQiqqp+mrkCKtuk6SQ11FP4RGv4FpwJFVlfsLFHFj50XVFHpUCnQRybRlMS6EZCEanmzV9dfxx9P9bib6pl6WPN38G40xsy0nyFmUB0mbtqTGneood/bPBnwB58yI= Received: from PH0PR07CA0015.namprd07.prod.outlook.com (2603:10b6:510:5::20) by PH0PR12MB8099.namprd12.prod.outlook.com (2603:10b6:510:29d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Thu, 7 Nov 2024 07:27:55 +0000 Received: from SN1PEPF00036F3D.namprd05.prod.outlook.com (2603:10b6:510:5:cafe::87) by PH0PR07CA0015.outlook.office365.com (2603:10b6:510:5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19 via Frontend Transport; Thu, 7 Nov 2024 07:27: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 SN1PEPF00036F3D.mail.protection.outlook.com (10.167.248.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Thu, 7 Nov 2024 07:27:55 +0000 Received: from airavat.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; Thu, 7 Nov 2024 01:27:52 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v4 11/11] MAINTAINERS: Change AMD PMC driver status to "Supported" Date: Thu, 7 Nov 2024 12:57:14 +0530 Message-ID: <20241107072714.943423-12-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> References: <20241107072714.943423-1-Shyam-sundar.S-k@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00036F3D:EE_|PH0PR12MB8099:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b46df27-86e1-4529-df4a-08dcfefdb247 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: 7L/F40CTJC8p3PisOVFuwyTQ2IYCvNkswB2rmcV0IqVWcHwHXDZts5iJG4GM6KmilLVe53Q5U5xu2gr0j/yMp2syEx8ewd70vU6PlFT7A6O/6V0kRbLsYqpDaJWS7FU/sUn6ONmXDo4MQ9Oe7Ku7iDreaoRS5W8cegY6aJsaUFU7ff1lxRULBrpFhWQY6ZDRjjKZMcj3xjTM4o21s/odNEhTQYf3GYQkzex1Lu3eMo2LYUusNt5PARzFEohimTifxjg5BXTLBmirFGuLjkAIHD+QgV4ARYkeOm9cTCfvfx6AFmbWLA7tTOlO0Zg4KQGxFDSNl47CD8+gALGTOGhhJFToupDh8vkYaBG06/INtzunKjKeLzos0pMgRQwhzYcLYi8dHUoAHvOBsYRLM7Nb46P45C+LBKL9cLuHppFO3jGwNVaD1wbHGuJz37glcEwU+1WiFpibELsNywx9vvQc62zOX14FnWh5HLQu3ORYdF2kw5jAfOSJt1K/9ylyRureBkc+xqbmpNdn1/upLFdWztV0TTplzag8agJAvC5yMHJLjicMRxWFT8FeCdIriwyfi5tjk7DEChP8a65XJ/DbEFDVUXz4DjUxVySnwvFJL/XlzaIeHfiQ/rwalRus5lpwUMhGKyaR6C7aT87d5F+ud75x0JIeUnQ/AlI9cerdPdnztrZwdoPsxg+DqGF529pPfXuF+hwnZ82HBCgoDxbCHvqL5LNzaB+GzGVWGn4Bn3uanwwdUA1uGTXLtFinR1b+VRyzcsc7Mbi7ppTQFuGw5Tl4ugK5RQrfgyKzVoXfCvDIF5ERvlcZqIMyJeTaIP3ockOz1KennJHsGgfmm+F/VKhFlrh4rvp4Awc1ju4HxjUYeaVzJaxn1+q/Lc92k8UDcj6yIebdXj9+2a43qcRwTGjsuKynI4lyK5u0cUV+maLjUaY9bDuYG9nl68gNMlDGFB8foGjDo5R377Xu4tjuW9fMow8KwSWru9mroMTGg7u/4MzZEgmymDdSu4K2Wi0afL9K2702FqzGVUkMZlq4e5hSDdRAPc6cVPNpBSs36q7tSfc65/fV9mBqK03cE2wbkrh5x4g+40ZTEFTizVvRqkFRoynj4yv53+xBAmvybf0S0BvoBsoyBm+k8RdMw4I8GMVYu59XzrZ+x7W3gCtTbyes0+O5Qjg4FJhUyhQTJ8zs/t8e+cFK/WqviMQ1NGjJQ7jFQBnNhlLa4oJ9eQ0C5aB5yaRK22D4Y2+Q5chSlyIyncVVK5d5d8ZrCIODmJ3AMEg8ukHo+xBvYSvHGoSW/cSXSOnBii3WOqkaPT5DYTUl4WgkgIpRew9gQcnKvipZKlD0sthYFlj1nT/4ganhv6V0DRzYUeLsGHKyJuhp8TirxV7LZt7SHwJeMr8wGBcdX+6lziTb++KiezPX7V5o9Q== 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)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 07:27:55.0065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b46df27-86e1-4529-df4a-08dcfefdb247 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: SN1PEPF00036F3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8099 The AMD PMC driver is actively being developed, so the MAINTAINERS record should reflect "Supported" instead of "Maintained." Update the MAINTAINERS database to reflect this change. Reviewed-by: Mario Limonciello Signed-off-by: Shyam Sundar S K --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 91d0609db61b..a92fa062ce5b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1118,7 +1118,7 @@ F: include/linux/pds/ AMD PMC DRIVER M: Shyam Sundar S K L: platform-driver-x86@vger.kernel.org -S: Maintained +S: Supported F: drivers/platform/x86/amd/pmc/ AMD PMF DRIVER