From patchwork Tue Nov 5 17:36:25 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: 13863259 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2079.outbound.protection.outlook.com [40.107.94.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE91515C144 for ; Tue, 5 Nov 2024 17:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828270; cv=fail; b=msAQ7cmWYvM7P4TaetjTRC/ozmhGGsUpAUoCT5JXKKA3ppPfLkDzu2o1fd8brs/oDjGibn0lXzL1Y/qtPKKwwUb1ruPF3fR9WAU2SYwO00NkswscenXOwWwqrZxlpMQENufCJUsJobP+stP7tQVdyKxxXd9NvedPk0J1I0qJm1A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828270; c=relaxed/simple; bh=w7h+cRrwg2zH/sNGsaTzH5fbV7dBNPpe0eUmxWGIbA0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PM+P+T5FUfvpqhCvWJov4fPNEl0r9FX2gpRKVCgD+W8Aymipkw6NZEtH3kiFc1lEzOZaYQ6mPKHlSLUakB0bqnV9bY/xKJAf9I1+xGDumaDvk3mMXKPbLDXg881yEv3dAK2WqcoD5GLladD1ewvuNp86pDT9b1vdAiwm+f2USkc= 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=qY8p7jrB; arc=fail smtp.client-ip=40.107.94.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="qY8p7jrB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pkch9HFVF9X1e9DquGseP7GSvyO3BCdcec5751ty82c0cNJ2RZPf1UTaWOXzSTaW4cYkrp/2DBBFj67fLChZ1elhNXTTYNtayYIdKJoXxQdwlrGy9GTOc5MP6HXdkfgNLmYBLRMBM0dVjMJ/GzOZuQzP5R4dO/OF6SkCpsESJy2tqa8bkMGMDX8kgIQH311TMsw0yHV1RxzUOX7q3sB2IWaFCkPCuym9DbwWNCqOBQQceilzYoZsWIKIZi2VbwKMePFsWtQM4MaL9Tj3VC0HN16hGxQf6mV17mmyFfKG+K6A8k29AVxhXZ9MloCL0blA0WdjI2LgOsAGXdTMVvbonw== 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=mslxaJtDUDc0VvJ2A8RB7PUXFgH0OLdVkhsf936jJjk=; b=w6p7rWozZvJupuG60pVNqWPEUFwsykIh114PYRNW+723pTowZ4KGxyqmQ5qiT1R2q4wXd7E2QckddwqM3AZ6R1elYJ0Q7hqcFhR9woloN/MtjF7yPke+/b/Y70QA0MFC3jpgowuIo+NKsUn8Lh17aqzKNNvFemPBX+Gfe9jgEw3yhe8DBD62vcJd8Kp/sqtsWL2B3LeqvNKHv+btrwjXzIm3s93R5rqwUZqieqF+VVlQjGCvL2xKYnece9yV+TqWmpXa9DsMYCSaONG/cL7755P65T+1f3jsbnL/CPSJu4/CEoxVNvRY8Izw30deBt908CUHTy/0CW0hRS6yecJNvQ== 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=mslxaJtDUDc0VvJ2A8RB7PUXFgH0OLdVkhsf936jJjk=; b=qY8p7jrBW88jt1EO2Bn5J4imXgsxEuF9mn9NSdrH07x0k+ZWnwAEwKVZGc9lBlI60EIq5Dr83iOsSAIK+k1aQqGiySWrh7Kw7MdesTiJKnk+2nPzksCefm7UgEkV6jkqhw+GHYnMmdfDgetCllRw8KmWGTBnXNB1ziWZM2eiWlA= Received: from BY3PR04CA0003.namprd04.prod.outlook.com (2603:10b6:a03:217::8) by PH7PR12MB6836.namprd12.prod.outlook.com (2603:10b6:510:1b6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:37:45 +0000 Received: from SJ1PEPF00002312.namprd03.prod.outlook.com (2603:10b6:a03:217:cafe::57) by BY3PR04CA0003.outlook.office365.com (2603:10b6:a03:217::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30 via Frontend Transport; Tue, 5 Nov 2024 17:37:45 +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 SJ1PEPF00002312.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37:45 +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; Tue, 5 Nov 2024 11:37:42 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 01/13] platform/x86/amd/pmc: Move STB functionality to a new file for better code organization Date: Tue, 5 Nov 2024 23:06:25 +0530 Message-ID: <20241105173637.733589-2-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002312:EE_|PH7PR12MB6836:EE_ X-MS-Office365-Filtering-Correlation-Id: e1688347-94f0-4572-0db1-08dcfdc08eff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: CT5q2PIhI0CxwCNr7N/xQPkj49Fn8VD4jjHsMHu6JOWikZWQqcJ8faMYjRvbE+EQhbwmxp6y5ck/eqa93jrVw9z3IdD9rfORtGtYO0iIlBd6awlw28yQqFKJBjv5vPEfoxz6YaKr+zwO34ws8F9NipApNC8dpnsZeQYQ7RAZa1Vh7HpMC0BZuwYV9kDstuOs1RoiFFYGLid/qeF54iT9JeaNjdZhAb1D9lkOQIB4DC3CgrBAB5TgbIh5C2JcQHkQoLuZD4H8aCLTqoPgyLyZui2i5WacBtcoyYdTO/Iz89sTvkVlgyqsbZTCgRISGcPCELyr02RwZy6ejTKj0OYJcECZk6TC79ttNIVHqljSkBC9BGB1p1wFCgiNaDm1pyrqG0gUiQaJeAL+nPnDSHLP1uKg4H8k1N6SqQuHqNVDhaO7+SoLUHp8wVGZEEXDgzDgfG+ptJYyokSFgDbcjIj73pu9VV1y13D7XMEVwp8VQg48o2M+quKsIftsMDdnzh/OliDvUKvk/M4t1Zgxwt23NIFcNKhqdAzZZcruUYVjilzcIiFNd7ugCtI7wqL/jCeETIBPie2uxMUbHiVLCLsu7Wdya/qDi2ed63rEHzdyLoOKQRMtS+nAAeCkST2+sTlilvAnGggjPhoaPCQjZn/NpZnLijiijSkH18nHwpUIHOS0w3v0fzBM7Guo6H70+aceHbpKIVD6Y06K0uGUrIU6pRS/CzMRC0QGMaKfE19CBCNi0wHNaWLh1uvN93xV+uDOnxJtWOJPANVDo5IxXQjWRpMq1cMawXzVxeUH4/6GMGFeP2HCBMMvby9vvQ+QJ/DqhiNM86x4Ov7xIMmO+iPjB32RCeswHMZFa8NHziE1gyTLFlYAMDeAU2QlSl8BDxnUdDAEawEYRIQ3seleVE0ZD8mBZmP0PFeYOygJqfW6RCwek0gIvny+1ve3OHjrEbYxfYPN/8G433UPUBgbGIeI+TjFNxJS37RoqMrvnE6LEbNlNELcfZmmrl/QpnMfy6LeQjfcD3CTHswrNeBYxr9hXv4+gEx4pfnv/ad7wYON2hDfrd8SagRyXsIG382BgWP3oezv1Gh0sATyOL2DW9BTgDDA/SSPNtac2Vw08eaQkRPA43oaI8LvguEsybDGmHyYPg5q8R5ne9ra7j8LlerBPTZfHp9D4P4deXP8Ed353DNiPrfViFthSB/SdIlVU5CEBD/DHNkrmD+8Fj/ZxXjDEzPOntTX0Vge39jtYbwoSFq1RexPIjLqcNEhqu1oWpEUoB3SLfDp8yg49WNZzHWmS0GR0UcnrlstU+cMaXXMGgNymS5QBuEuA75tau9Ul8UDiOy4UD7trtKm3Li9MLwUbvAXCIYbRulWqhhvYg/AdaVGzlvJACLtnGOe1e3ccrSJq2rT4Pjm6cb26blQhpIMhA== 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)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:37:45.2833 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e1688347-94f0-4572-0db1-08dcfdc08eff 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: SJ1PEPF00002312.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6836 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. 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 | 88 ++++++++++++++++++++++++++ drivers/platform/x86/amd/pmc/pmc.c | 80 +---------------------- drivers/platform/x86/amd/pmc/pmc.h | 19 ++++++ 4 files changed, 109 insertions(+), 80 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..8221def898a5 --- /dev/null +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -0,0 +1,88 @@ +// 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 + +/* STB Registers */ +#define AMD_PMC_STB_PMI_0 0x03E30600 + +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; +} + +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; + + /* 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 bbb8edb62e00..e70a56d85ac5 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -40,7 +40,6 @@ #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 @@ -52,9 +51,7 @@ #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 @@ -97,7 +94,6 @@ #define DELAY_MIN_US 2000 #define DELAY_MAX_US 3000 -#define FIFO_SIZE 4096 enum amd_pmc_def { MSG_TEST = 0x01, @@ -105,14 +101,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); @@ -162,9 +150,6 @@ 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) { @@ -683,7 +668,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; @@ -975,69 +960,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; - - /* 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; diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index f1166d15c856..ffc9eaf8a522 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -14,6 +14,14 @@ #include #include +enum s2d_arg { + S2D_TELEMETRY_SIZE = 0x01, + S2D_PHYS_ADDR_LOW, + S2D_PHYS_ADDR_HIGH, + S2D_NUM_SAMPLES, + S2D_DRAM_SIZE, +}; + struct amd_mp2_dev { void __iomem *mmio; void __iomem *vslbase; @@ -70,4 +78,15 @@ 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 +/* STB Spill to DRAM Parameters */ +#define S2D_TELEMETRY_BYTES_MAX 0x100000U + +/* STB Spill to DRAM Message Definition */ +#define FIFO_SIZE 4096 + +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 Tue Nov 5 17:36:26 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: 13863260 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062.outbound.protection.outlook.com [40.107.92.62]) (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 1AA7315C144 for ; Tue, 5 Nov 2024 17:37:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828274; cv=fail; b=aNfgMMBIJkBRCQmwiUumbTXyLj2YOSr2056buVVVAnhmAfMkF5X3riHg0fEEt0xb9dTyEefR+xddZrjpcVCLw3/CLO24j75MhGaxl61AFRZr+jeyk/tOiXTFdU22s6dN18+S2RUFpC0RcaT2UV8eW3LFW0q/qrOsSOZm8MlCy1A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828274; c=relaxed/simple; bh=RsOvApohFRA1xblK9AAt15CCJpyRiBU7J8SNtlRsxNk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XzAmyhkdwmFLIy3xD2oJI80XPbQ5FFe7w+CozIgxW79J8slKB6NwJ0eulziFV+iFnbC8ZZedsOxcH8dbtpRRTfcGaDGSy6gXF0LcGlkM7C6wUZ4/6wJSWnMeMuUY1lhJTY6foJQ3KQUKovNLrJ7bkGav52kTt9fQcGbrfqevViA= 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=KtneK0Ue; arc=fail smtp.client-ip=40.107.92.62 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="KtneK0Ue" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hrCe7xESh1CBEOSPDcUkTau+pG2TNF499HfWQttZ2tylA1fQbD9J/D5n14P9XV2R9BdEp9uOjdFvLLvu9zmmgHw59bFRZoNvW5f1NyvukwYcJR+RrztZMBZfdNNS50trwEdOt/jHyP8DVCPIniqx1sEj6XdeceV+2UcUB6XhJzs6dsmjxtbha+p6yigHMyiwtVhubiJFnPR1NBd+U4TBwyZS77D/oOsLT4u0DksdNw0yPQE+LXnEoNNhsVSPw5L2fbpafUSyXxvA6rduV7oflz4upgX3PerHZcppVhFQZ96G716DJuArZbZPnaxXcHhIN49LLP4HTcW3FJf1AzjUQg== 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=LwEGQlp+6xk4VciNh00DfIfHUu52NvWR6NOW5hbWsTU=; b=C0EChhdLMv1+4nx/rvwxAjZhugYfmaAdvjR2NS8rLh5dJkYoyWm/d6bk18B198DA37kuDodzi4AcessvPntSHakzcF1xHZ/Bjcf5z4E4IFOnFVzrKmiuDiSvyDKgodZ2Qzn1S+1dSQwqyZ93KcjT1ZZaziXTTqMdpJH2fbJdpfSMJfset+KEBeqk/0hNphFq5LXSVaXst756wfLoJQB2KWecnHwwnHZc1peWWU6bguIKw1wmRVaPWool2ru2Ntoq5i6OhFppKH93fZ4mGmA9Zm+q6eFj3zZYAjgWJwamlsUI87rGCRyfXDaPWrbvwCQ8et3QYWGlwbrDtb+FZ6juAw== 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=LwEGQlp+6xk4VciNh00DfIfHUu52NvWR6NOW5hbWsTU=; b=KtneK0Ueyv6njR8NGvqoHCIoDI3Gc4Y6TLc5Y+pMSs3d1yqjaOVfMSCnSXjW1UHKBWZc6QlWd0xJfA/c2zu3iOGW+NaLhu9JR2RXXCgC5AoZpZ22IKXOWymzH+hjhZsKYlUiAh71w2vxIiLjkO/fCJUIwnHGoYNiRhxjtIZjXvc= Received: from SJ0PR03CA0344.namprd03.prod.outlook.com (2603:10b6:a03:39c::19) by MW4PR12MB6950.namprd12.prod.outlook.com (2603:10b6:303:207::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Tue, 5 Nov 2024 17:37:47 +0000 Received: from SJ1PEPF00002311.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::98) by SJ0PR03CA0344.outlook.office365.com (2603:10b6:a03:39c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31 via Frontend Transport; Tue, 5 Nov 2024 17:37: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 SJ1PEPF00002311.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37:47 +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; Tue, 5 Nov 2024 11:37:44 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 02/13] platform/x86/amd/pmc: Relocate STB Debugfs to a New File Date: Tue, 5 Nov 2024 23:06:26 +0530 Message-ID: <20241105173637.733589-3-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002311:EE_|MW4PR12MB6950:EE_ X-MS-Office365-Filtering-Correlation-Id: 629f9609-c05c-4bc3-d99c-08dcfdc0904d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: n5xFlvl1A6g10uZaSAJa7c0WWmZwnsW1wGy2oR5S/ZkbkKwZgwzqK0s8onYkwaqs3oYjSA8x1lsDKhTMbTdVHu2ZYE2TEnmjZWYE4kSQVFJdVnn/zoGkpOI2ieqQpsHZ2TjRLNSIGCX64Zy38gV3oCfY9Oj+3hyAxqEZRU2Ux0isCkc4AA4IFTL1FOrewj354KGndrWqPMXdPR40cMEk8zBF1gi3MfwMZUEeimpG9olMiGIMybIZCm32exOtgRV/eJSuYmlkAL7LnUMPGT4+Am6vzAR9nGsGsqqHdnRhCB//g3NvejZasYKEPdfP6yG9yxmhQ3+Acp0TC3BR5I6vr1aKtyXbLTwZq4AOZgIMH+Vy7JXB9GOk7l0Hqfc309WeAiBFkk5svg3erAEoWCxOqbmSmkIuPd9KUWpeyAWit9/qPVjd1897lKqos+Fpv93RJnIjDPM2IXcpopZu29rPpGcHHpGEbTIPd89qi+Kmzd+TcDhYoyWA33hgLLtRb5vKfk5fbCba6U/FMqN4IqgwAiHRouCZYTC/+wDGTzIfdbch48KmBsU336DDY1X21+xWNkEdZjG0KGzqui/WydNVCr5hgqq/+uUiRchF68a/xJmYD/lx6edq7R2ZYLTkGTohXtD54XTTtH48RfQL+HdW0HAGlh++gutI2e7pPsck/gsMgR/bNDP8DsxX1fjdyxX7NvZmkZsGM2+BZmxEwkLhbveZ/unfyHV78XkY//ruyt2fT8x/dShzKvxklS5tUnhIViWvdpY5xMiTev4M9tB+pS94a2AwqES5hpcrcXxVvCswyvOMDKz9sgE4bkv5uWhkgUDnZfp5ms98UXC8WYQazCOzW5tj2Wj+NsTzMbfCT70sC2KWWmka4hfrazk2gg2k8hPGy9O6RPvrnXq1x5OxAcSeeuK/YSlF4OzlUvj/G4buGShtGXhizUlOz16TsrepAeqXLIz/Bi3PfovFFvuNiEeL2dLWocBjv7q4ogznmrX81QaUHviQVcyhcUugalHysSKXnlCy1uwZZyKcaARcMtFC29AVmHw17wxISmfSoSGmJCkHfUsdamnX+0jyKZzSOt3GJiUJvRacH8VGvzf7y1p5dCehQYB9z7sHamHR9+buZjir5H4UYwiSbuj9IPSlgl5C2E8PHolcol4qqw949JsmG0TKdjp8svvPZVKVpXsmq/URBx0/C19tjKLlsrfNttBn340MjfGVHbzo6J56Zgyq/mJev11E6/Om7ZAIKNFopSFh8cOsvTYtWC6NZkORXNcO2jFa9vTRLOq+VfyIBUXT0zdMWxpOPx2q19ZZwXW3iqNQmhyGaxmYIhQLJjGggMORwIFk+TRUbvtCZ4QTHWjtGDrZHOGrEGZJoTdJlwyv4fUak5ZmaGSpse+ZT5BKXySPyIycUiPVK/6fbZlU4g== 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)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:37:47.4774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 629f9609-c05c-4bc3-d99c-08dcfdc0904d 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: SJ1PEPF00002311.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6950 With the core functionalities of STB now transferred from `pmc.c` to the new `mp1_stb.c`, the creation of debugfs should also be moved to this new file. This change has been logically separated from the previous patch to avoid circular dependencies. 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 | 206 +++++++++++++++++++++++++ drivers/platform/x86/amd/pmc/pmc.c | 203 +----------------------- drivers/platform/x86/amd/pmc/pmc.h | 14 -- 3 files changed, 209 insertions(+), 214 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 8221def898a5..6552617bd9c7 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -20,9 +20,37 @@ /* 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) { @@ -52,6 +80,174 @@ 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) +{ + 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; @@ -59,6 +255,16 @@ int amd_pmc_s2d_init(struct amd_pmc_dev *dev) 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); + /* Spill to DRAM feature uses separate SMU message port */ dev->msg_port = 1; diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index e70a56d85ac5..58fdf044fd36 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -43,19 +43,12 @@ #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_RSVD_RAM_SPACE 0x100000 - -/* 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 @@ -101,11 +94,6 @@ enum amd_pmc_def { MSG_OS_HINT_RN, }; -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; @@ -137,18 +125,10 @@ 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 inline u32 amd_pmc_reg_read(struct amd_pmc_dev *dev, int reg_offset) @@ -178,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) { @@ -335,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; } @@ -610,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); @@ -633,15 +447,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) @@ -1017,11 +822,9 @@ 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; - } + err = amd_pmc_s2d_init(dev); + if (err) + goto err_pci_dev_put; platform_set_drvdata(pdev, dev); if (IS_ENABLED(CONFIG_SUSPEND)) { diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h index ffc9eaf8a522..8f939ab32510 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -14,14 +14,6 @@ #include #include -enum s2d_arg { - S2D_TELEMETRY_SIZE = 0x01, - S2D_PHYS_ADDR_LOW, - S2D_PHYS_ADDR_HIGH, - S2D_NUM_SAMPLES, - S2D_DRAM_SIZE, -}; - struct amd_mp2_dev { void __iomem *mmio; void __iomem *vslbase; @@ -78,12 +70,6 @@ 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 -/* STB Spill to DRAM Parameters */ -#define S2D_TELEMETRY_BYTES_MAX 0x100000U - -/* STB Spill to DRAM Message Definition */ -#define FIFO_SIZE 4096 - 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); From patchwork Tue Nov 5 17:36:27 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: 13863261 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2078.outbound.protection.outlook.com [40.107.96.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 BC2461E282B for ; Tue, 5 Nov 2024 17:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828274; cv=fail; b=cfYLCYUmGz2fcLeOR1scfMA35tpelabnYyS0gJ2rQyAbkQIubPf/QhJ5cHOMl88l48b4Ugvjri2bMswMUSDtVUdAT9cpu0GzFoddgaZBEzQcq7AbXbcQGKAKhapdYd9DO5Jpu+qvqo4/8dqhBz4WPwXqH9c3mujiUP6L53xFnsE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828274; c=relaxed/simple; bh=b72zcHwk7q03hJjP44NO6LkRuvl145hDxBstnDUcdk8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FOP/hVAcMTmBaaAWbQSf3S2CB1vcCzOu+A905Kuxx5CbILcj1nc/nBMnH30AhWx6qmJRmLKcvvgBzr1NBAL+MIvF6pmHsftsK/fxFjmcB08CJPQlfh0mMYIH8gWyNhTA8zrsUvA//xaoBSFZOl2Q1f5OZbxCDLzgnQlBphoorTY= 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=TL/FijFx; arc=fail smtp.client-ip=40.107.96.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="TL/FijFx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KlH5/Qj3Hv4ASIjCvXb3D3pWvIq3hCKy07zBZ/pnKAYWDSzLKtPG0zyo4KkQD2VX0WH7W3qKBODgyxHwyu/wZ+lsZokUfZezkrKZAOgaU3SPZMx/bhib4Cbq9fo7gqIGtegxK3575lCSgdTYWJTWcjDEqkywTvH+xDWHdZ48chgK/r9P0sExp4pHg6GRbPkftJBP3ypZBLrvZFKBoxob7vboY+jt/MO87xO0FSjd9z8TkeYyg7MMKOKeDvZtYtAZLSCfYksk4R2Eta+voDwV7UHMk3OV1GWl6U9WEFXZ/TguZHGy+PBTDULZ+FCnhOTfmi7jyVxJVSRx9El4Mrh44A== 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=T0tmgwCc7Eyv6xpw9mpT/5HZoZfkuySfzR+aVRyGgmI=; b=tA4rsN5oVYGNqnOF2n8Bi8NCdFFqAXy0koTVr3GP8hmWXes36JoYGqGvu0d6+K4myweZMiu9DBqlVBMQSJOKgJbV17hgEBh+HOQo8Rt0LnxGUFVCGt50Cv14w1Wh0AJIB5Vyw2p0nSXU/LPwrm/5aRdT8KEhz4GLC79Fa71em07CBI+j2NBukSNMwk4UFb1r5gJOkRKhIXvmDYvB6zL8v5C5mTSMnTIsXqfmjtv4gad29niZRshvvkM1QhEBrCOgLhxyRd5mgJAbsDwIXxFjzfQqGQG9y4pGP5mGJM1tZ62BAkXqVebDYjHUjrGf7YE7OQaqaZdmkpXWTyBlpKXNjA== 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=T0tmgwCc7Eyv6xpw9mpT/5HZoZfkuySfzR+aVRyGgmI=; b=TL/FijFx7xZsBYw/ZhvmdKQWicwAlSU2o48ck04POvUSfWIMSPWxcfJDRe/oydNqw0ClzrPL9X+tjLTXf1Vkr8hzZAc8PnA8AvGG/t3IjPzmRj1RsxqAyjsJq7eWwf3e8jtdYZA9+ZvXrxWmoaW3nl++yb33vmVxFlY6eHYjNTQ= Received: from MW4PR04CA0140.namprd04.prod.outlook.com (2603:10b6:303:84::25) by SJ2PR12MB7943.namprd12.prod.outlook.com (2603:10b6:a03:4c8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:37:50 +0000 Received: from SJ1PEPF00002316.namprd03.prod.outlook.com (2603:10b6:303:84:cafe::7d) by MW4PR04CA0140.outlook.office365.com (2603:10b6:303:84::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30 via Frontend Transport; Tue, 5 Nov 2024 17:37: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 SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37:49 +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; Tue, 5 Nov 2024 11:37:47 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 03/13] platform/x86/amd/pmc: Skip Completing amd_pmc_s2d_init() on Older Platforms Date: Tue, 5 Nov 2024 23:06:27 +0530 Message-ID: <20241105173637.733589-4-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002316:EE_|SJ2PR12MB7943:EE_ X-MS-Office365-Filtering-Correlation-Id: 02374e09-b1de-4f46-2c4f-08dcfdc0917d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: J07mOE8WTm/jOFSjKjakzJHtCS+3gCaEuIuRg8u1QPECFZhmDCrW8t3ePVBgNJdJv2Y3ghxgFKMFNEskiOVXvyhv81XRkW3r86HaGaaNzELMEMF9LFDH2zqIApwMh5QPuQVaWOmmqfKV9h/tvXxjNNntigsflOMmgL+0/m/wqGLNKQI91bwcnTPolDmNKqkmpnS6O95P8wuaPaojpQQUWqnnGKVPfdR9MVNa6DRz66p3QiS1/sh/WFGpDF9W+G9E7WRqh6cUgX04bTrhVFE/Y+ii+21+4pK/wegE2Ujoqhl0RXRtyZsupqXhhSCzqeocH6fWqSLKDdKuUwkkGXfhaGNYAnQwJoqEx9oH7PiTy0zelwpojr1Eea60w51NTm+QD84VoypnMr5fCJyubtb77pzKSELbivkBoTO/KFiWauTEXe97ur+Djb2GxcQYiiin2jfXjhQdbnCBVX1Ks16I4+pw5U0EZBDCYUaA1Xdd70GqnrfMwPIECLHaSAZyDeHeFr251wypaFfzmJiAayxAcKZupUqpVuYBflRoTtdexvwxHMkM5r+NTzOJ4M9wWJvdu9g6blhQ2gyBSdo/cLebVtvbCotDllM+BNJdGUW0vqnZSAYPPbfi0QgZJI0tw4pcGFm+OoET+Npl2rnvWWvIEw1f2SpnhZfIZNTDnP2/zqDWDIpQKgCbhK54BuACTtlLtjZPDUiJ1ACTvNlELFfcUPJevaPzYk9l/oR/bQd4JJjQ0Oe/ze7O9zZrZhmtQug9936Uk7fRxUv16FM2sRVI/To0EFqlT0LAP3JvZionKjjcSTYcqyFVBG8kY+280Q9KxiTo90OubhJOZILu8tQmYK1Cqwb9ARUTzz11Bl8HDV3Iu1wcToq/dAWjGW0THQNvJzF4dl/QSICGN4t4NWOPXi1ZLyUMcBIloY6DpU4SxOiD4A7J+UzQLcDbVmUEnlMBkyYJeK0T95vSW9hqPALSojIcrB84BnaQy0TkNNl/baUBFqb9E+KQax9t5flyALCVlgXandHIFF3we2TcCdJ35lv0fblJ++3VAbfjn2DGj8o2+cRtjAS4fycO/JvXqPqvNTlKil88VuBnKG8+yI4jpAlhIAYOdut1krH6z/8tFDvLn+cxfPTG4JEYy6fmSWE6Xa85py1toqcimzttrtowOuYw85gnvDoKHsGn5JiZYswbTfBKTe71tpF3ZJH+MbGVMYWkIgZ8O7c/7MFXypoQKKBnHiF6E0PpJ4WZXCDiEjjXZnCZ++J94JhMNLYvp7GrY7Wd76FKmAS184K6Octpw5qhH5ObO+r2tWTOiVh0LEfYgPVhjEkrOoJ8lmkkyuFi9k82LicMMGf4Dt+QZhhK3qUXbl+On9U+VB7kqrAT9QTor41qui9hzeCBtLCKRQOEJBvrPmtcYUFBk3fjwER9lQ== 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)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:37:49.4653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02374e09-b1de-4f46-2c4f-08dcfdc0917d 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: SJ1PEPF00002316.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7943 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(). 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 6552617bd9c7..29e0241190e4 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -258,12 +258,14 @@ int amd_pmc_s2d_init(struct amd_pmc_dev *dev) if (!enable_stb) return 0; - if (amd_pmc_is_stb_supported(dev)) + if (amd_pmc_is_stb_supported(dev)) { debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev, &amd_pmc_stb_debugfs_fops_v2); - else + } 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 Tue Nov 5 17:36:28 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: 13863262 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) (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 CAFB715C144 for ; Tue, 5 Nov 2024 17:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828276; cv=fail; b=dabYLwWq0pkb8368u7T+k7e54wpXOwSk5rIzzSrURREdW6+hb4aZ4/IDB5e+BoSkgDYZgR2l8/gSX0FeZ9z28FYgw1Hg+bFqp3JEJT0ROPnAHlM/aOnjEbK94f3O4OhG+vc8ioYYbkF2AvEv1dqzZ3TIkpFMwDw4VAqK/7etcGY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828276; c=relaxed/simple; bh=mF/UrjtUYfAlNQo4geDB3cgtANUOKP5uY9UI7cTGbuk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d2EsEijqPQvhuxMncIAbczRmkgi/8a9mc1KUMaLZ72pxQWm29N+HaAwlnr1f1ieVY32ouF4B/e/rUHPgtrwlngyGZ/drNdH7iuPt2+7quPShkTUfN46RAx3SF8dBLd35PUoqiZ2RAwGPo9nGYst/pYw1/E4JMr4MURS9ZIFQHNI= 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=K8NuhK3S; arc=fail smtp.client-ip=40.107.244.66 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="K8NuhK3S" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f8SU49JTolCCQk9F9f4CWknwDqbIxkLBbJwXmnbf7cLXQfWvu9BhzlkOVmXvFVQQBxFF5xQVYJcBffg+cpaunrmLayQF/mshrL40BYyWLAiShBeLsG86rbl7sbNdG5T6R6WI48pStDGC6KDLNDyHKK+Ts0/MVvUUSpbJvzYaQPgSG6bfT0s3TKN+J1ZPSCzWCEWyfPtKHzGTUiypibZ0WSaTT/LjgEN3UQk/HPcmO+qAfujVumIpcxW2+8q/xYjW3EdzF2ZkPxIMoHB2ZfAex5XbwIwU/2SOgxTgVS5PNHReQwtza901AhWuhIJnvSgDjhgPe4Vg6grug1j/d5FplQ== 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=U1gyCRQiG/FnvV+ezaPBZCkMnLrPaY75NCM5hWIjxGI=; b=Y7ouQX3g/lw//IVDvjpJxlB5rxAim7EInQbeJS48iWJ3F8441xLAtuTjmzgE6dd2+Jt3BM4HXmBdgee+rU/NGn3RejkAQdmjBpy6o2uDkGpHS5yCB1mVSEVXhP1NtXVKFyUaYbyyc6g2me6D+Gw8FhpqvxKEknx2EBDv7t7xGYy8iSU3aKwCSc1Exxfaik6AqycCgu4tiQrpVytnC/Ozs+vlGUDw3Mx1GgCyeb4N+jQw8DTfkeSZMWKMEfeOypsZVlJgu2SYEhuCj/xM2hLRUuXQPrjvlvt5NDSPTJ78szh7l4BFT26LBbgrkU3JeabiNwvRZ/845ZDk9vdvgiEgcg== 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=U1gyCRQiG/FnvV+ezaPBZCkMnLrPaY75NCM5hWIjxGI=; b=K8NuhK3SoVD0vROxKMugZyiyPQTrfDXRz+xyMulYadMHAEkEMAZB3bgzVWKEXi/3J88TtftjsfVbyEbYDUIJmy/PZCpeBEtoqMovvfnQSc+/sgDuMiuSrdOtd/UXEVr8eF8TZZB9uf8Hi5S3PPREV9uHUZEOTMi07phvVOhUN+0= Received: from BY3PR04CA0008.namprd04.prod.outlook.com (2603:10b6:a03:217::13) by SA3PR12MB8047.namprd12.prod.outlook.com (2603:10b6:806:31b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:37:51 +0000 Received: from SJ1PEPF00002312.namprd03.prod.outlook.com (2603:10b6:a03:217:cafe::f6) by BY3PR04CA0008.outlook.office365.com (2603:10b6:a03:217::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Tue, 5 Nov 2024 17:37:51 +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 SJ1PEPF00002312.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37:51 +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; Tue, 5 Nov 2024 11:37:49 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 04/13] platform/x86/amd/pmc: Invoke amd_pmc_s2d_init() Post Debugfs Registration Date: Tue, 5 Nov 2024 23:06:28 +0530 Message-ID: <20241105173637.733589-5-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002312:EE_|SA3PR12MB8047:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bff37da-2d81-47b7-d33b-08dcfdc092ac 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: FPt3jxczO7hY9HMllBwUK+U2NnxsNGXHowZ/fOsqcqPnKZHynXLEJFXJU4kwLij3WVmmlWw8MIwpZxmnE4x3ww7zvKbD5JsWZUarIiUPYGnwWqHDBjuLOuJrXwrNM6wAsqYCQ6x9zLeS9Q5NzaobzXTEhAWuM/CaU4JJxcKsJOzddflKV6tjkT0ZFfj0P+XCh0ACR1VEwnuQFjORpt83Sc8j8OYY1KC796TJvPAU8yDKY6Z0kEyPSPiKP3U7LbSxlN/LcPhO0v8PvCEUskDtSKrM622/M3C1SbuRFJh9b4A4qsWQPwR5KU3dLgmdNWzDQlAYnO/641NtxQs0doXKYFP46MvrxVJoqcJsQLh25QXa4mm+KhAsJrE7wSVZdZPAdJptZqrZdU06BlwWtxqpUcRp+QWoIGuT+wn3pIIRM4vg3V7EpxP7Tzg+reuw5a51AVsZH2s8TSUJGbXh8EIzv6ON5WFRTQloWwf+vJZap17DrfQZYb+rJnA2ShkslidkpiSTU0irSxeD+K6gz4PAuL+ElY1FFPlh862S9BXG3ns6X/Rb4ss69lIX5YE1pbuvuudlkM2pmq3eWq2qRY5wekagqv5wiqlVtfEMjngixlmRaW/ZcDjHzqBkpoTFloLwRnvMCnRlfeZJ4i7xUotm0dFmY2bzTu1Ceb4+kjEyiL94Jh0XcawiRxfwrpyzODPme2ZVv8vQr5Ve5ThlCvJaODtdI4tkqQDLSUPK0khs0zDGmIIVoT6FR7kdP2ad86XoslbP5PrfBJqumuZBp2L/HjmWTElDqTq/iDDFZ0yY4ysZimePZ9rmSV4ZEoi5xoqS1HZejYVdUN3HNU1LTv2nW1i0jPTDZjgSUZc5iabVBmMdWSIJ3ZoJKUtniA2Nh9vamAJVyNOhxEuuVpb92vnl4Xj5/smd08Sxz49AmeAUkrgU5LkDi3ajrAfdPm5VZdvY1goRrdBLLr5w877TjAAQrMSuEaDzbF4ctGfmDsGdDb34CC8zXYKp7BKtpsFLpx7NpzN7cZ2wbBl57KcG3+P+stNJupYyWQANtJkcd+OHRFSuOZvNPBuzgKWkOcmn64ZgA5PQaqK9ozLGiBJ3RPOjKvVoHSjcqeFC0Kir1NxI/LGGQZ6KOOdtmMmxT4P8y33kmOylXByPCYvFTVK2GqEZNIqAiEq9sIRj9mRBePDE99b1m9Hu6lJQStU5YqzbZ8U23rTohClDCQRwSHeg9/7TcFQpsNAlmSS8VejUcP3ho1KOzS/P+uEaP/JWSh4/+qUEYQSMNfQxZ72A16Tb8sPQQu69Tn8qF9if9TaFtNqezh0CRdo6L0yAWHul5Okt8sLAu21sW38gvW1oSYBMHrPN8AbrAgSwGRMV2PwRLNhx3cRylG5KfEZ5Sl1z5jo3NBnNKxlhD4kcR4k1dS7VaMU9WQ== 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: 05 Nov 2024 17:37:51.4553 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bff37da-2d81-47b7-d33b-08dcfdc092ac 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: SJ1PEPF00002312.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8047 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 58fdf044fd36..6ebb9123ba00 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -822,10 +822,6 @@ static int amd_pmc_probe(struct platform_device *pdev) /* Get num of IP blocks within the SoC */ amd_pmc_get_ip_info(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); @@ -836,6 +832,10 @@ static int amd_pmc_probe(struct platform_device *pdev) } amd_pmc_dbgfs_register(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 Tue Nov 5 17:36:29 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: 13863263 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061.outbound.protection.outlook.com [40.107.223.61]) (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 3501915C144 for ; Tue, 5 Nov 2024 17:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828285; cv=fail; b=HchdRZszQcDVw4mMq5b/V0h+BnAeEhdP6/oDgXQTZLXF2R68JFe9Dm0Tgryut1xE02NYCKy78BN8Bm6PVfel+3rJfQKkmSK+joIQbkDf+KF855atq0CSuI2c4zDUiFFY6zV8ti+dxGM1UR+K47+Pbu6/GOOiWusNwhyTJzhwoWs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828285; c=relaxed/simple; bh=5mLaW8LB+pSaQ6oeo/KkCfZpRjKmIIKWuN4UOVmQHsk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q0St2xLb9tnBEaClXeS31OmomTlZnR8tpfmuH78IjzzRRFJEDjYSVCUxiUbyJ5UjRpDifdJQsw95wbNEYuKbM0xCKVYFG77AqSvWDJnIDFfCgwUoDc/W9J3wlcfs+4ppK3o5y5/Z/rrmy/bT03biuj81LRafsCQShSmi03p1iiY= 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=EEWUZTiY; arc=fail smtp.client-ip=40.107.223.61 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="EEWUZTiY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Mo7TbZgSfPml9MgiqkntfbUdQ1s9OI08GUnPMd4hpZurxvVrwp9k+o4ZZD6e887VOx/TbX6EJp9F98SvyT3+mAe6VUS8dkja+MbcmF67LgwuRxNmttaLc7Dn2cM0odNYPmdy+R6CQcI7fUUWHq28MO/UQh2RdUpQLYMHlqGbA2A9oSmPmquTuw16FiG5sNpLOozAJaQf87e6UU4mMBps6PjnEngVGjURZeY5AoTfKtSkpX4FofEvEFJNL/uK/XjUDYox2FeGXimxBjA2EPLUvKRMX/9MNS+VtYgEcuSbRKET/FvwxKdfQbgY9DcmYhOtcuKOEvt2sW7igtTGH4LHGg== 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=NopL2TYB+tiDnol0hqHw0Y97BhiQQyTrGMtg9SuEH81DZ16EBAw3JOlfxnwAQd3SAEd6LMDqKlFlrdYBQB1a/ch6nmLc4KhXjHQVHzb8XKj5KzfS9xYV4J2yBQ95X+PCyTI9+DEjBSzH9bSoBi4ZS4cBV0bPMprRkfi4UZuNCaR79YB2+FRi4UWBX1gSLSiu0RPSd7lHk74F+2vxIk/Byu5UqoYTG6E0Ts3PfY/RNWtKUpmrXMFVOBYyRZn8drJ/sZhDi+A3++n/KtDJjOaVUdcrhKRfnaWa/KMMcOD0Ow2Tgu+L1kha/FT2KAKW6tvzHku3gn9pynbWLCAfJKvW5w== 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=EEWUZTiYGQ5FTMXnZunVQfldmN0IET/2hTIThlBwlpLOLAoJANF06fOUW9RHLkbaGsmywFh8AdT7/JwFltoY0VoQ4LnRoaWFsKhQPn3fd3EO7uj+NcUa9Tbk8uluFdj1eZIjTup/Ds4fKuZgeC40uhISfNA90N9qBCiNlo5GlMM= Received: from BY5PR16CA0012.namprd16.prod.outlook.com (2603:10b6:a03:1a0::25) by IA1PR12MB6353.namprd12.prod.outlook.com (2603:10b6:208:3e3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:37:54 +0000 Received: from SJ1PEPF00002315.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::84) by BY5PR16CA0012.outlook.office365.com (2603:10b6:a03:1a0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29 via Frontend Transport; Tue, 5 Nov 2024 17:37:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00002315.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37:53 +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; Tue, 5 Nov 2024 11:37:51 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v3 05/13] platform/x86/amd/pmc: Update function names to align with new STB file Date: Tue, 5 Nov 2024 23:06:29 +0530 Message-ID: <20241105173637.733589-6-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002315:EE_|IA1PR12MB6353:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ca96629-290b-4a6b-7014-08dcfdc09409 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: AC5YPZGdm3TJPpWW2eX3EO/KBYYQCSx1T78cZ4RKX8zMRUdFN+T2mscSkUhs1lYpm5mNqRfSjSKGO28P5d5LyR+PDWl9LK0apf6A+i/93AVtMAHVA3u58MeHCM9c3BQFCSvtyNxK+1AWfkDMM4LJ5YzwxeoZ3C/cBEuwYZ/fnNN7jChwtBkmRYg5uTd8NH3+pCPTkYCczHleLb0xthGlOAmt4XhSm2rS6W3QF6KjnmTZBmurd/Lz8/BU5HAYNleWTemE3XRQq7oyilPiMbJB0XPuX3wGjxDy6cRIPXRsXHyastHBWROISdTEmrD7ZaNetJpggIaXVVJqysIiIAOwLih5iE4Vih8S6hwQMMEDb9UVQJvtqLQzKSzSC/b+f8kAx3AckDrDGnWbw2j+YVN8DItvVUWMpCWsDxtHBnodJ3JtuQJg45/8IaVojHvKNAZ2k4l8Dg9eb5YkGiHv7X7uSkmhZ4K3nbVzX+mMxVffbtmCJEoyhfsMKg8YD1tA2+A+ywJvKShjHaGvaiJ2QMKRLWZofsC7qOguNYPrVEK01ucraJKp8IWMpl0lN/nWGdk5Uwlq+gB686zulWxVfQXgnY107Qy3ZchBGE1UgB30sSeQa9Mhc95n2SpyN3yIB3Gq51U+nqcXg9YxiqJ2LHdF+IxLuz2VguW9UGEqPiJO8mdQ22+XXJpqBqBYHRSmzUZugaXnmAUaSoKCUPIR01iQsoHzSPoW8Q/40eh16y6bdBm0Lyf/tfXndzP1jJ5idJhOcpBOoI7W4/mEaKDJPii5TubG0mnMdi7B5RsBSLHD2utVm+bUkXlZOtIoAL+9SF1PPy/+oVXiK6J6Pf5+Jt1D9Ls4SYdHsAP6159InZkVuWNsmvLrAk/YRhXC851oF1P6D5Ks0UPqGzE4E2O6Vo6pLp+EjsyqtXdIbu/eS7kKZ3fRJwjtqkuxb/GOveojA2CDeioioaq9KkHGT9ZQUBzAe99FbUcf2W9EGWetyMqNs5dLVvgBgnRKOXxBnB8Vy6wBNQcC+5kBMJDMLA3nF/lyeUmBnbT+XTSGUDQvxvcWZ8rkiMwm3t0nbI3WUQWH6LeFxKPve/pbYH+GGNZrM6gJ03vnjsuT4afLa/L1zK/dTI95FcZISMDVWkyvqBpoDygy0LQV3mH/078PtxbiJsbl5joHpKJTS6XLbX3LCqhKhap2dkVFVBC035JnRrHzLo48544vWNyVrkdGlJPMwgGR5c6A4Cp7++mu3F7Cjg0koX7uvrYNMCDJLq+kqrZAxmY1UmXczppAX7ii0auWcNSG+lbJ1HIq6IYQoAy6jvo+FqxRoKN8g+33nFTW0b5EonAMoBGuFpquSBISc+HECPWWmGmWF0FK2LLW45d0WYvS3uZjZ22dMniXQZP9SCyGer9qf5wvNcedxfbVQMGtwXeppA== 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)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:37:53.7399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ca96629-290b-4a6b-7014-08dcfdc09409 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: SJ1PEPF00002315.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6353 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 Tue Nov 5 17:36:30 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: 13863264 Received: from outbound.mail.protection.outlook.com (mail-bn8nam11on2051.outbound.protection.outlook.com [40.107.236.51]) (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 5F8211D5ADA for ; Tue, 5 Nov 2024 17:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828285; cv=fail; b=umh4I5sx+/0nRL8jzsJkdos69rGIk2CuUcVZLLvF8gKhxY1zXAJKEmZdCc/M36TEWGaLqwawc519yk/XU7qhs2sBbplt1zsU+k/NLy4AklgbFQWfM7k0gLxmam/ftyXv/Map8kFz8bRPnWEK6+b6e8+j0gf4gEj5r0XrxCL/IjA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828285; c=relaxed/simple; bh=0Pj+DguNAAMJhpk5Uu02LwDkSM2aNSrDq02yQVZA4p4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sks6Kjaozy+fLC3m9Vkd7DkgLFeize4jlHf9oTgtkC7xBZ8nWov+0OpsOtT2lfPoCZXCm0lNefn3HBoAj8hP6fpI8/D0YyuXDhG88Ffy0zk5hGSy0GvlIEqSYx8FRVcfeyEBGmL+3nIMcWf3eMT8wZC6jcj2otNqHTXwoccd0ks= 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=QssncQrL; arc=fail smtp.client-ip=40.107.236.51 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="QssncQrL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mRxZ4niAFuhWuY1nkjqsrOEquiLXOKupNbionF8iiiHFPh9rBrRwdzNLqncwSD0eKUiGPgEC8KRsz6GALap+5fdTPGhPBGh2iDx8muJINlGkjn8uzXeMzFuXR9wzOsVQ5leKtbnz1RZndP4hvSAfnSBC1kDf7so8jNw7cDzXzZoUuCkpfC1omgy8b4in0EXqFYct5NgHC3+X9XN62X49gApov41v2KQFydOY/9z1I8JG2XkWG3v0fSAn505+DdF/ls9dWmHARuQ1ktSFA8UqrJvKTJWkWrjohcIrCWPQZXtul6NNmOsxKd5/lbdNlE9SHntWg61J4c9YUmAcl+a4VA== 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=2/ll664WPMtIS6D/QTe1oYGz2/a9meVGfSiHFhN2myw=; b=mqDOLzHDwAToHayk8MNwpT4/TRNQom9BUG4eDaCM+7YpmKiBWOvKSioQ1gDWL9pDAVFRkBYCrHi+AwnKnfjZeA9rjv8avfjKR3EsQ+GTWE/upeKkoGakB6y2obABv1hROpNsgbufjI91t5HuVCemOTGQpxij523kfM1e/AdzpL6OHDgw8ELyGkF4MTZ26ywtkw6VOweQzI5Vj4h7Tb8sq4DrW5ya47wu2X9sNh1WUFRgzT/X6M3WveKUHsXcFXoh+vSCYy+ElYFRz4UazGRcnaln45COxxc1QOYXCedoM/DAb2VJiGeu9x/7uSjKx5s1JKsGElYdBNTgOq5+/LzXoA== 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=2/ll664WPMtIS6D/QTe1oYGz2/a9meVGfSiHFhN2myw=; b=QssncQrL6O+2pAmc2n2/5fDEeVR0a0LPAIz3spsYyWLO1+v2hInGtSEwYHGhfyK/dzckEdge0nYVROw/Ew5vUByBczozq84LwH3geGk4xwxKvrKmIETSWWD3edRoHCl7ZTyKmIGuVv3xVHAtponwDNvBP7GtilGwz2a3RWOD2zA= Received: from MW4PR04CA0146.namprd04.prod.outlook.com (2603:10b6:303:84::31) by SA1PR12MB9248.namprd12.prod.outlook.com (2603:10b6:806:3a3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:37:59 +0000 Received: from SJ1PEPF00002316.namprd03.prod.outlook.com (2603:10b6:303:84:cafe::49) by MW4PR04CA0146.outlook.office365.com (2603:10b6:303:84::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Tue, 5 Nov 2024 17:37:56 +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 SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37: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; Tue, 5 Nov 2024 11:37:53 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v3 06/13] platform/x86/amd/pmc: Define enum for S2D/PMC msg_port Date: Tue, 5 Nov 2024 23:06:30 +0530 Message-ID: <20241105173637.733589-7-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002316:EE_|SA1PR12MB9248:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a9c232b-bc8e-4232-9b4a-08dcfdc0955a 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: d5lNULDZpOwSnL9vhRVh/Qeb5J1bQbVbDLgK2DCHYJcsrfdh8l5HuKlHtZ8fmVyjDO66xsTFARcm6qpypCJJ8ukkpp+yq3TCZZ3j/1pt92n3lf1IM4C0uzPoF5fbvMz5/XwBEiNiuh56gdvCKDojRtTvowUCD1oUgMlx9SD2R1cDR01NgpqugaVdxZhhLyqEwMPS0o0FSzRi4SWK2NmgxpsO99qq9sv49zaiiGpQw+RNVMe6p40peXe2V+gDIsk9RSZWGM4PbRO6DyDJd/kbo9s1mhK3bfyrOOXI+d1POhlL/OKfUcl+/Puv3gLzbOvcg+JEd9lc+wxK8ciDU2UDw0c1iv6VG1f5VIchlw7d8teky9jJ+pjX0suD1SnXVIFVnj9CZjJF0eHNUE6+D8BrjRvnANpEVsoGl5zhski+H6tjuVB+jS3DJjSHzcj0jl8SYh3MnrWMsj4qjI8WKeYU5EeGZ89+yyrc8zrkLWI/0lWuiZzY7Iyvld92O1pRYdERkEROLNT3cHV6s5lkjeG2GxMdiSdodZiLGtLLk2zJ9q+/Zsc4328cK39GgvNpTt/you5I1zDuzH2W4SQsKTw9zRxJoJAtokE2c+4NJJ5cCBWTKQFl7JiF0AzDdSILdTEf4errIIy5xbRwyELhHCptVa0OVLGRlDMWkwXSugjU+sDac5onx1+dxX0RFCh0hIZNNgPXOAfWqgIFWJdz3LbVoZXsRAXKYtFS6YwtAdPz8wcFjxuFnAyqh3/H0cXBGk1bWkUhf/mfxsFAxzH53h7ZQ9KzCjxPwwi5HAmXCGVLv67J/adYZYuqFj/eqMPlk6IqKGSHtQT8kC6VKchLjZiNq7MFSgY9loq2xOsRnLpT19bJnkrPmrpI7a9I8eQMz6JHOJ2TKs7ZsLCOLoi4g6vhUHVa2UVRhjI8oFH0iMeEHD9YPGRl9MwdKZUukvogmz1i7+McUMmDgCGZfBIwxEx7nj7h4bT63le+ai65hv3rytpmiszh+d5Sb89rOKJvaBocSDC9FQY+FDAdCboFbkj6e2Zlj6/yXRObSyqELjsdPpr0+goPFIIb70Y7RJoQ5CHizAPgrSHPAPqpV2WDIHY+3bJw1W6nvvC55sL+Jrnh1E15y90tCCW4pfLftlIJs+or60hPvEUM/y2EPTA3UMQy2HrrtFK31d4v3euA7TscancDbUJDtqIBkuhE1tCJEIjNObLzm42sZ32Ld3HyF800Fwdx9wuVxhu+PHyAsLmk8+C/XfTBrL1m3Irw1Z5Nr+puFFmv/Rl9lLK+4wpeGVr1+oeGWxnIYgeY52hZcmvt1RAUQzcFv2casRVUJHnudGIBjpFMraKe8lJjod48Sa+gBgzXMG43y8Iw42qvE5IreogF+HglWG/qtRtStt/XF1vpmu+qhgcdZzVwdj80OHyyrQ== 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: 05 Nov 2024 17:37:55.9652 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a9c232b-bc8e-4232-9b4a-08dcfdc0955a 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: SJ1PEPF00002316.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB9248 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. 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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 5c03ac92558f..fd7ca1626cfe 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -47,6 +47,11 @@ enum s2d_arg { S2D_DRAM_SIZE, }; +enum s2d_msg_port { + MSG_PORT_PMC, + MSG_PORT_S2D, +}; + struct amd_stb_v2_data { size_t size; u8 data[] __counted_by(size); @@ -155,7 +160,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 +177,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 +272,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 +290,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) From patchwork Tue Nov 5 17:36:31 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: 13863265 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2078.outbound.protection.outlook.com [40.107.93.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 629051E2619 for ; Tue, 5 Nov 2024 17:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828285; cv=fail; b=Rcyws04+OKz4lC15g8PTxppSTKfQY/FkMOhipLJpqfiDCSHo6klhVK03Oh/oQ2m7rGzXsVTYROmdgbuzOPbURlSAu9P7zgWmd2A3zrmgPgOQwFWVT0aeNK8W+J3v9wat2hvOD9G88TUdFp2GLzUM8Kz0TcU4hLXgXoAuNQjB4tM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828285; c=relaxed/simple; bh=FW+jB6twZ8bO7ZK+ijJZRvdU1rimFg+3b8rlupxsufg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VvUk7Pe/j8AyxH2EB7C5ublqkpwPu1orztNeMTncOFeQIH3j7RwWzOaYqvMe61tmS0DxUC6JaySNmpw9p/HucjteiLqiWMWRJdZO7uE2PuztTLVPcjR4gs9r8GuF+Qr/3bmiX+JimnI5IB86CgZ/3emSwVTIG8Ymk4A6CRCLphU= 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=Awxapdg7; arc=fail smtp.client-ip=40.107.93.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="Awxapdg7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Cbgn82R2z92eApNom02p6U2UDUvKl95bbKL69fciUcGSBoYzbQ1MQkbEzzKIL4mZgaoIkvU8LCMJJXLdbr9PbT6IWlTEGN7dR8u+4nB1l2PpzjF89McMj9UoJQf+3K80ArQpJ3AAsJeCaAzgbcRtmbxWqjl4F5xTrFgYxpnFxps/LMr5WtIagxGRvkdsooz0uadBr42cV+5CX8nvGMpp3lYkJkIXzZwno7g7X/yONLYiSxMQcbe1ehOwIIGxZWHFeomNeXtphTHBXSgXYbvBkx5Dc8gRefireuSkzOCzYDGtBfKBF9PgMpDWcIMVLUJgCpt0SuAjSlMjGzgEkRKcig== 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=TmmzjZy7ORcoFQT6YwnT2S36yrEl9AWdfP1P2rtNd+U=; b=DShLjLL2r3ILKrafcQW3C42b76BHA7abrfP/jZ27sl50NMoGO4seHdM7MseiYp6FEnpebHOwJElUpEOwTgcX7tz8fHcDgI9SI1L8omvP/bYoukygy0KK/OU0j0HScq3bEza25tlCMNFevqX5KB4XYW+2ZCTGc1pV2ErROHsDM52yq0toDhbS1SkCzzT+sl1lzDMZb5hvfge3EjHTSe3zForZzI/enX+wDIxlwLLZc7isG/e5PudpjluUMuKa/T02WnZrbQHxrxEqsdsYW/5bk+uh43ys7bWiandnUkr5DfM2Ym4wFN2RecSxlqIXG9y8CullKuhUFfDHf5wdH39OZw== 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=TmmzjZy7ORcoFQT6YwnT2S36yrEl9AWdfP1P2rtNd+U=; b=Awxapdg78BVogvzNADUfrSsyvgA+hM+CMvcsCXNTEl+Gcu8SJ4owe1MrNSbXz0J9408Jux2XUqmOwQhpPujiLb3Fz+HYoNqjgVhbhP1DjTbOwdHJtOC/UdEJCTZ46qrTxXq7QT2C2uJThuXsLC0mtzxljWdsErPKdgcFjjW6ERE= Received: from MW4PR04CA0146.namprd04.prod.outlook.com (2603:10b6:303:84::31) by CY8PR12MB7364.namprd12.prod.outlook.com (2603:10b6:930:50::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Tue, 5 Nov 2024 17:38:00 +0000 Received: from SJ1PEPF00002316.namprd03.prod.outlook.com (2603:10b6:303:84:cafe::13) by MW4PR04CA0146.outlook.office365.com (2603:10b6:303:84::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Tue, 5 Nov 2024 17:38:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:37:59 +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; Tue, 5 Nov 2024 11:37:55 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v3 07/13] platform/x86/amd/pmc: Isolate STB code changes to a new file Date: Tue, 5 Nov 2024 23:06:31 +0530 Message-ID: <20241105173637.733589-8-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002316:EE_|CY8PR12MB7364:EE_ X-MS-Office365-Filtering-Correlation-Id: a429cb22-d7ab-4b63-7e7c-08dcfdc097c6 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: H7GKUlBwgcBwQ1ejYtGQwgAdNiK698QcKk7eYQYHrkOZrPP/fZcJ1MHD9/38N4SrKv5/vBs2YAD6OG5NWbYIeNSwEbJXp76m6MLV+aemywxw5SboUimj+nvkLJRUXKlgPwN+BAEbqPgiFPKiQfzJhljPzVZ8rQoMNFrgl6w+NM8fpJmtfb68dB//DER6Zv8B7y542eUskebVQ+v/imZ4YmRWjU1K2we3YbVNEx0+Weso+ME5z86+Aucl8s3mXT4xvr3mLGwshoqTNEZwPHjLwVBxe4b6DCRrZI4DlooRWnPAp/8cLOgYEuNqJIaGcux8bbTU7plpE/XLkHvVrt+gFQ6wOPRH0aOuxktk39JXXmlyfmRk+hhwAn/MeTTtWFqqCNio2F3QeVCXTEFG2GSwn6zUtyF1TmIUIJJdgrlCBH1ln5AOs0uu7iMBzpCpbZjJyJk2BlqDqkLnOL9TG0JuBji8ZdJSG8tdusEnIclCDNpY6slgVcTyM5qUQLkBeYOl010CHjx0HKnXMfE8RGpTBPgbzgr4ZSi4aCrJB/feVCRIN4uxbDBgE6j/UmHG+xLzcSYSL9Xch8frZUpkleuK0YO5xoFaH7mcoqyMijn+yYSbiEAuyMwknzhhem+pZ7Qp2lcgdItB7apfu6JTgfwETJ3alaTlGoIaXCSRxXbUoR0alOe+LCYXbrhzyLBlBHxxFHKbBQEPRdJpN+bWjjnD/j0mn5fPUPsMMaL33hIxELhHu78eCUj++FLcR0BtCmT6B4OgwI104UFtSUS6sPaNp+PZA7/IEIsCLw4WaetfNsjKX/jpkKt9U4KSgfZNQXOuHPAkaQWsh9001wiIrXOGRzIQNxju+WZ4aZCrDEFw2/sc4miUWnQc+7rIDAojU6LhVCzHH9ZNFpFWIv2LY+sqEMqXRT03r7chEuTYVjk9QI8l46hY63jwKt81K2ymv0dAaqSe3N/ImQypt6tGZVU9RCIgCcijN6+xdYnsxPm7GZl7w/AlRXllkAS1ehy1AG4tlMQhVv71y2W5Bb0FcDXAbyRtEslytYCTMOvaEh3tiQBwwdbCtFEyiHZr+VEJCwjIpcsZClUN/sUl9XygeOpf01PoMc3PTeRPzMOpPoFReMd2oJvZRbRsI8/c3ZV4joIZTuKC2zUtXvo31UhGHGfCzq6TirjG3WcE6pVKrzvRLbGRsBdKSIVGqkhEBic2icvfJEix3DMevezFPGD2ZeSz7sd+7IDPdmWWxr4dtAE6zUwotMuuqS9VU3FrGqR+72HTHVPW6qMrySqYDMVJc/w4urcp6nOIBqdk321tELivz2Lk1Acq8GrrNdutRyRu0g0PrBKNquFRnHKhZ5acePrAWHk+xrydeCjd6nqLXK8biqIbj8Ub+1S5PRBtMehU6nFHjLqnGJoiejEPMtRXbiRbqA== 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: 05 Nov 2024 17:37:59.9340 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a429cb22-d7ab-4b63-7e7c-08dcfdc097c6 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: SJ1PEPF00002316.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7364 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 fd7ca1626cfe..38729c9b205a 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"); @@ -175,7 +180,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) { @@ -238,18 +243,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) @@ -274,18 +285,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 7726a05091a5..90a7983d510f 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 @@ -454,9 +449,9 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev) u32 value, message, argument, response; if (dev->msg_port) { - 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; @@ -481,9 +476,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) { - 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 188284feca72..be3e6b35433c 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -25,6 +25,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; @@ -36,7 +43,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; @@ -50,6 +56,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 Tue Nov 5 17:36:32 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: 13863267 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2058.outbound.protection.outlook.com [40.107.223.58]) (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 38AC01E2619 for ; Tue, 5 Nov 2024 17:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828287; cv=fail; b=E5Dc+LFl7bHBi1qpx235Zqp/9rPbmzLvD96qBBwYJ0KqfBlcLgpQOPnTr7U29DupGiFWZeF4hZ+Sm/OrXNwfD4N0SzObZ81R1wa4dlJEz94G53sCvTCD3DQGBPUqxbpokbFtXBBAbs4H+okTXGJD/Ufcnrwrgc3HHyxIMlYLk6c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828287; c=relaxed/simple; bh=f/xg+NNHqUWO1GdugOvYBz8iXqVxmY/M5uhSj1c60kE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n12CmB8+M++3cFG/Pf4VIhuKs2tmj3MN/3t+DngsorPttiZ3wqsx2iWcxOb6QtpOaKogdIPXpKeilhHM+q1nDj599ce2R5AE9ErHd8l1N/P2VbS4X3GpGuaI14yuEmccKzpgC4i90Ir7bzb0MX0U2SWtyQe1BBrAmOTPbsJ/lH8= 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=RQPuR5m6; arc=fail smtp.client-ip=40.107.223.58 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="RQPuR5m6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FQcXHEZFBCOOAxgtpB9vniNEVCK+nyq6sJOZ9WeMQPwH+DtcCGR/eggcX3EDIm4g+KxsFvuLdVD8mAvQIyubcYlBPlpcea2aIG1OsNdoF/kSruYlZ9s7IxO7O7Sb0IYcsM4TzrdVxcCqDVSnZLHm932Lx4DyKM+Ons/hUCG/rxXVXI1cyAqMSno1ZNbeuXRx35vj/oMDoMfAGhs8amNJP5DmZxWwkffqrCXAhRg1rWzaDTAdk0Koa8S7Rs6E2YmMXJih6st6zsJK1JHKI2+U/j2dCFrTfWWLdGWt/NG6T6aM/gAiMfptr3bEA1y8bL76rvFvv1lNMSbsnb4uF3JtKg== 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=sgB4g1fMRB56wZZlh8xycx8LyZTekfQOvX8IaaM2Pic=; b=Lwl20mKdi1csowfG4u7JHfD8QxEY9oKiiyYfbdqtGrp9opzG72RtWotAFV/Yz1IkF/rlt9QnAAhQwiY7M/HShKJZm+qe+Ej6DchQFIZVeQn6g3cEaSI4K78ot9g7jK25b5xgt7vDemsxIWGoxAKHGP6zBpSxpPZ7dZJuX6IVqfvhBliCQ/mGuVqtCWZQwGLeXvVT2BvZf19WDizw5P7j5WiDOdPFjY0sXbOo4/sZcF0mTOtpm5irsHewMpEFae4tnvGjlk67zzUdXQQYEcwJoVKWWgOJFnPvgC2mPEIxhrE+O5n35A17P8F5R/HEQI8zsahq+yCRDiLRlyAkAyPLEA== 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=sgB4g1fMRB56wZZlh8xycx8LyZTekfQOvX8IaaM2Pic=; b=RQPuR5m63mFiqkpOP+IyELnA7IAW9nDvX0RYHJ1ttsonwOAQc7WWR2uWCCx1hyPX54F70RB5W0P9Zo296rKROAHZA7WBRbpIKNchuX6Vc6uEhNfLIezRZALV98xPBiaPJLvYc5E36g/mrF/+9An7l0Y7jVMh2sAdUQZMh6SHHgs= Received: from MW4PR04CA0131.namprd04.prod.outlook.com (2603:10b6:303:84::16) by BY5PR12MB4212.namprd12.prod.outlook.com (2603:10b6:a03:202::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Tue, 5 Nov 2024 17:38:01 +0000 Received: from SJ1PEPF00002316.namprd03.prod.outlook.com (2603:10b6:303:84:cafe::9f) by MW4PR04CA0131.outlook.office365.com (2603:10b6:303:84::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30 via Frontend Transport; Tue, 5 Nov 2024 17:38:01 +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 SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:00 +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; Tue, 5 Nov 2024 11:37:57 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 08/13] platform/x86/amd/pmc: Introduce helper function to set proper string Date: Tue, 5 Nov 2024 23:06:32 +0530 Message-ID: <20241105173637.733589-9-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002316:EE_|BY5PR12MB4212:EE_ X-MS-Office365-Filtering-Correlation-Id: 8234521c-b6d4-4cd9-15a4-08dcfdc09840 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: QtTw01KzIEsJomxals6FmM4EF4S2FXTWlEXQNwGp/txBhDTSHAx44QcauuXhniRbLngZMbwvz32AAhD8rpmY99zscgH5N3aZsHmi11OAuj1q4Y/s66zLyuRwseLBwq/NXUrPbEhwVeU4wlk7UFSxepQJ7jo0y1KZUHqR4I/lqv+fvQJFlMwN5FexeqUFygLbkb9ldFaSRM7cFIlxwQsDNEi2dCqtA2NnDMh7DFFYQ09G4My6sSAP3wKOrLLqLJmz37bNc9FpSBfohHNMFrAM5aSHyVXU5mAEVX7JGBLmL6Hj6o0JLvEFHzLIGtR0INRD8CzGDOWUHQ2gPQgdrz//Z7CFPA/z8Qp+yZJhpeY7spAQZ+uBt9kEO7/aTxBehqOA1C/nUNZ6zQtsPK4GDNVwXmskF9WMNCYRmwC5p61XvPRTBL0t4ZilAaY9WXUH3//MTzu0mm2JevMfUGqyyZpdje3e1RqUYey6n3eu7+8ahbxkgKv40IOwJ4l8/ZIj1flYCvmt2W4vjGBgpbFu0qFYHRsdclZtCWI/5AcBSh6UveEmBxOekDkmizxyIBSE2dZq9QnRBaqOCmxx8oSyc/3xiHzYWAlGgqfr++ShT8bqR1z5b452He0T+tIgl5F4D8GsVeJLcCPbasu+Xor6ITWZd0L3+NbtDow36+iCDcivnzrB+8J+Q4neqz/Hp6ja8G9yFdJ6+fEbrbiCu22qWaPIed5VuAvD3TI+zr0HhvUl9tmVzT0LYS6jaHGWnPQ0fyliCexfMzSOIZ3xkBkHXQy+9UGFcaZZARJ36LJCsNJ4LG0Eh1Ds3V+BCb4mzBgOueWDp/dzyv8ymnKj7kJ4PIfHyQUpNisoaYF65YN9TscpUXCWmoo3FwOi5xDfmnK7nY1MzCmkd7lbjd6WDXeY/VyHDsDCXTsJNQ+WhveSRbG1FlrrwYGGifOVtGM6Ga7kdyq4lguQn1i4bVYVZlC/FsC5hotwZsyGGNnZTHhrteC1NP4FN7Lgvr9p5PZhApszLS71hNUWMWtnDfTenZ1Z64FFEJvgT5uCY+qaysqg2KVpA6F7C6eZuZLhpn7wtAPcR1WMz50RY2l58y3ihmYSif4crxGNwaqlgL/w3lL0xXYcLQg4S9FL6qwpUJWRRAU+zMiGePMBMMXizwJrHAMw6e9K8/cRacE83i6bsXoIv6BembApLKDelnmPjP+ZrunOqga3Hhs5iv1UoYRPnRKM2ih1rdorUCahrrWNpzjZtVbRJuLIqC4n/TB6GDNkzO0hqkj6GHOXdPKacOegMntk6eYHuWpsxEaD5Jv6aUf+YcbsKAQ8ytiFPUJ0wKip8vhSRAX0SqgHKbU6HFN6AsLr9O1vsn5d4xl/uhgryMntjEVhtCpko6tj5RR0A7CezdHRE47tD4kG6n/3PBbNqSNdsT0X2A== 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: 05 Nov 2024 17:38:00.8090 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8234521c-b6d4-4cd9-15a4-08dcfdc09840 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: SJ1PEPF00002316.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4212 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. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmc/pmc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 90a7983d510f..1f0ddf5440c3 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -444,6 +444,11 @@ 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; @@ -459,13 +464,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) From patchwork Tue Nov 5 17:36:33 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: 13863266 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2082.outbound.protection.outlook.com [40.107.220.82]) (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 51D8C15C144 for ; Tue, 5 Nov 2024 17:38:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828286; cv=fail; b=a6E+b62GvHTbuLRPB7PGoY5HHTGIryyL8h/sjPlPDzHDSpd52jL2MPiB7NyOZ6+KLIzejy50jr1QwU1U2N7cWOopldlKa0Qf6gFk/lOtH/bPuDCYCsOsr8QgYEVkC9zt4g1bcg2GUlNaX5yVDjKsfSCIUBXQ0sOJQ7pzWaYtnIQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828286; c=relaxed/simple; bh=iMuqLDE8AiznDwXnE+85YS3+URLkrt1OP01qY0rGnT4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TIQgPC7LC9Pn9PrT1YdtxNlNIDCo6nuDLAp+j+eNgU7fU72UxGfljL3oXDtDZ1deOgX8TmwwJfH58wlySQ5eYpyhxenWZsD0trp8hvC8JTS5hY31C5nC4saVLWnaQMGxwi0bCFBYpHvRHX85CHOSzZKqyty1qSfooLVcafLmnO0= 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=Ltb6jJMN; arc=fail smtp.client-ip=40.107.220.82 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="Ltb6jJMN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hDTXWBuUTq3g/h7thc83qxyAACH8D/RDkSD6/5ZMOap3RsyNAQMYO0Risysok48c0Tg5YfXU7EPPqI72TUPfntLYpUsbx1F9k00448Wxf7lqUITNDwnL07hkqmWOOyRUPnWsEmEW4M5W99mqYMhlj32PjVSlU08Bz4DySXaahjEsLfuSzgrJWy+NDZXICfPsoFJsdHWTjOpTcxZOx3k/ALyr+lSa6wHRwQxf7bd00TcegqgRogYYv5cE7r5en2so2jt+PeFFEdnt1AEqfp/PvC53PRla5lb37O6par52d39ARkVv3+dgXQKiunId3K5ZFPJX+PJoTsp/qrSYCDKG5w== 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=MXqjx+7bIxsJBducZiPf4EtiQdH9e1D7ua/KKJVY00k=; b=eOvzCkSKdlWQv3qgogR6fgn++hYhBUZyICkA1xwquB0v0d/gyI2xx7/2M9lGH5A4HVG2h1CTWFCkKxii0KhI13yy7gUS2BAzUT3NIoFpMtIXU7w/w3BW0Sj5c5x42qZQ9m67fGsWS3X5bSOuiP1ORfgRrV/2zL13qjCKPKzf5r7Bh6I48AA3kUzKLo2WANUAOOPSZakGYiYxtXJhKXCE3zeOCkAJCIEqeV9hW67GHcMCI9ennK+sOxDETH+A9HL5PM54RJsWpeJeSlS4fFwgtznV+fiKwvM97D3mShmCiv7JsNzuKRWrH5DAXo7RseUdceKo7pOncZo4DsEXrceYug== 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=MXqjx+7bIxsJBducZiPf4EtiQdH9e1D7ua/KKJVY00k=; b=Ltb6jJMNXuM7wJ6VC6lGhgl147s6Gf7CQOcC5yqToQHySdJHyxpEZI3JAUDUfCNXWk4OhCRWhpm+LH4G9WRDFeCshHqn4AVIqXve8WD4Nf39eZl4WdU728MlTp40XOJLW8M5VwjbwY0X8SsXuff75RYR5ffwCuSVdAEta8OyFm0= Received: from SJ0PR13CA0087.namprd13.prod.outlook.com (2603:10b6:a03:2c4::32) by MW4PR12MB5627.namprd12.prod.outlook.com (2603:10b6:303:16a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23; Tue, 5 Nov 2024 17:38:02 +0000 Received: from SJ1PEPF00002317.namprd03.prod.outlook.com (2603:10b6:a03:2c4:cafe::f4) by SJ0PR13CA0087.outlook.office365.com (2603:10b6:a03:2c4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:02 +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 SJ1PEPF00002317.mail.protection.outlook.com (10.167.242.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:02 +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; Tue, 5 Nov 2024 11:37:59 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 09/13] platform/x86/amd/pmc: Update IP information structure for newer SoCs Date: Tue, 5 Nov 2024 23:06:33 +0530 Message-ID: <20241105173637.733589-10-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002317:EE_|MW4PR12MB5627:EE_ X-MS-Office365-Filtering-Correlation-Id: 57348afb-f697-4ec3-712c-08dcfdc09920 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: VWJFDLJN8CuE+gLpY4mSZQuK4zPWiUMlJou1L16YDv4KD5MtsapwQLDKEKkqN8vPcTavUCzbzhgd+66Jv1nAROKOtS3a0qbPjM84wKWafUPPGBlJlnyuJ4YucBK4cweJifbIMx9lLJvfX8Vtmvd44KQaoil+OlSEs65U3eOi6Usc6+D2/0+4e7OSqdmcUgkts+wEBS2bUf8c2tLQ2F6N7W4BDSNMS1iRsZ3fFzLuENawBjGW7L2rmx+uQ3A4D5AmnMPc/bF1/XAVYLZOnWjZzPCybT5wIlnY0adwD/5Scrzvhzp8DErTTgQIVntX1owIZ6sp8z5XlZ9CUek2AB2gaMR3K4FqZUjCId1lOXxTn58UC+4HP3KBwqLdc6sOopiy0XG84CquHLEyBzvfDeUSlXLtBp7JAlazHS2V5yrp8xO4s0nmJDk/jHjPSFY/ZsqJnJpq/eJRgHglrK2ZOt8qHEQYGoGZ1VIrPiIggtyGMIPntLRll/oB4E01q4gZPGy/JO+H1UaS3fmBqmn0wr455BztiFhDRos8B4YMPcG3rzDHXulOy1PEKT4Ns8va3b7DMrwo7LmFvb9PYMSAOixcQdW+dWBTfea7GYzq4IBVOMrdU1ieQYp0vOUs+naiP2Y7xVG95bo9kUrtiQ0cHV3jfGeVwoWkF+Ln1T3GBl8lKzvyFq5QbI1Pe+ItaXOvzGrgar97ChRu6bfjy4hBQ6kG885ywtZcvuMB3se9+yMzjfH537Htryq2RjtgxYn8bIEvx+Kx/5bFKF8VmxGtcwjnflVu7DsrtA7rOjETFcZhr7pyth4q9gtrdHnDiOgP0y0B5KW7jvt1nJKyJ7ZGBpbZe8KS7o0V/JRcGN3PUt6hG+xeAhWJ24WXnRqlZSvUnQ5ijhROOE5zJetJg5AUpdvAcdKmtT3HaWN8q68MKLch/XiOq1OwcYNn+GemYJ8+WfXBtElZY3J7irwAKJFBr/2BUNwfm8+EtWCqxBzxzk9zMSCt0F0f27eQ7LcC4TowJXs+EoClg3gqEC9rv7QcX6fb+F6BXkQzRA3ZGUvDzTrbHs7EWViKAXym22tDzqkne5BiiuDLa0+w+Qfyo+MRecy6B/W1WQotJkGHZPNWbeHr7Kba2O4bOwUSsELiQV7JEXYE5p70HWywVGjP2Hg7c+7aDfWAssWRj+kgFBZD3qHvXkAOgVytWjeOU1KbUJLcFIxrAZpZVmBWLUvAKAVwuV/Ksdu71SFewUNRjKNS3OumMX1wGgWHNhpHxw17Dw0O8JQnFJIcm8tHsn1cAnjQPj6UNzaSq0kFM5tTJOBDtartzJtZNXCx+iBSTODbtfJa1IwppO61GxSyAK6vrX1jWlpfTqKWv/LEMxWo6m4d0h5Db/wommCO+z/XqO1uCd7lIbBAgWw9NUY1Q4ltlzv1H33VBA== 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)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:38:02.2793 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57348afb-f697-4ec3-712c-08dcfdc09920 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: SJ1PEPF00002317.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5627 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. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello --- drivers/platform/x86/amd/pmc/pmc.c | 43 +++++++++++++++++++++++++++--- drivers/platform/x86/amd/pmc/pmc.h | 1 + 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 1f0ddf5440c3..5ca97712ef44 100644 --- a/drivers/platform/x86/amd/pmc/pmc.c +++ b/drivers/platform/x86/amd/pmc/pmc.c @@ -94,6 +94,35 @@ 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 +191,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->ptr = (struct amd_pmc_bit_map *)soc15_ip_blk; break; case AMD_CPU_ID_PS: dev->num_ips = 21; dev->smu_msg = 0x538; + dev->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 = 22; + if (boot_cpu_data.x86_model == 0x70) { + dev->num_ips = 25; + dev->ptr = (struct amd_pmc_bit_map *)soc15_ip_blk_v2; + } else { + dev->num_ips = 22; + dev->ptr = (struct amd_pmc_bit_map *)soc15_ip_blk; + } dev->smu_msg = 0x938; break; } @@ -337,8 +374,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->ptr[idx].bit_mask & dev->active_ips) + seq_printf(s, "%-8s : %lld\n", dev->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 be3e6b35433c..32b02ba95eeb 100644 --- a/drivers/platform/x86/amd/pmc/pmc.h +++ b/drivers/platform/x86/amd/pmc/pmc.h @@ -57,6 +57,7 @@ struct amd_pmc_dev { bool disable_8042_wakeup; struct amd_mp2_dev *mp2; struct stb_arg stb_arg; + struct amd_pmc_bit_map *ptr; }; void amd_pmc_process_restore_quirks(struct amd_pmc_dev *dev); From patchwork Tue Nov 5 17:36:34 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: 13863268 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2051.outbound.protection.outlook.com [40.107.93.51]) (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 51C5B15C144 for ; Tue, 5 Nov 2024 17:38:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828288; cv=fail; b=l+CyjNQOn5pGdURLO+1I/Co8xtowJqZQ2MeU4lkkRxF6Q0MrDwKSgYANQeq23BWxZfvK+tLFnwvJ5xkrJarHYMgyMw7a2f/EKlSdJ+SpC5IdQY99IoPcmSpi3VRrKft5YdB18t4huQHPA/wOy1TluazURYEYf6mfKlT1RcfHqJY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828288; c=relaxed/simple; bh=+1gbOZQ6yQnalxYEjCR0zZ8a98sZyvzoodlTsAVsIkU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XkkZ0TyN8pjkl0PGpyBYWzC6HIHNXBNmgd6MR/IUDO7q9VQIcVCDtCpNjUV+HsIY/iONGN6jmkQ/6K//U44X0g7y629b9WCduQyjlCt66Wpc+7GA8S+elgL2l9Qbt1+lZms0wwGpRmkl4b2FIXwfSZxScsB2HV3aNmtVoFDwhys= 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=x92vW9VV; arc=fail smtp.client-ip=40.107.93.51 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="x92vW9VV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dIDVs6e2gwbNNacsd3VnTbSumqA1tMOilEUq8ZI6ydFL39KRk5E0FjILrzYhBkvELbd7vd65469FztVQP54+BuurklL1AFZ6vHcLb0MLs8Nzj1bV4LXf4jNsnBTHWeqDg3ejZHMFFNq73bB9R9QVDY/XwJGyNyGcU5m3DdnVW6X99D6vuf/+29wqafqbnR67sTRiJ+4sATUiTHerFwUIhLwQaTaS6z4YPL4NmLx2k6LOK2nGjvHJ/i6MWUDloXqUUOVkZiDab5P6Bt22mKxvzUiStrxuPCyT2ItkrdpF6j3FcrkC+TxYDfwiTRxNJGjnBYp64Dwl0z0aab0204HtVw== 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=4xdE3+F9yBuefbI85vmFDw7FMv1RUI5kej4TGiUwI1c=; b=leT/o+UHT2C9c4MDz+QoVETHalHyYZCdpR5gOOm+x7S50T6BhHbEgc74S3M4wwNrflB6XDZR9OIzPkzozQ8QpD6eR+juC4XT7PLI0y02qtdqhuV9OZPKmDMvscjnSZPhg+3nXS3JVAnLT34alPG3IRmE2OZFxIa+hOrl5TYGqo6k9+tBwm1Hl3fDu1sVkdKAfumsREiQKkq5x90oD+el+sc4d+ut8CUO3Vjf/xG5sngvhKaHkhFOx5F/dFEjykSbKNoWo1aN2/92+Y6156jZ4VVfseqkD5Q1TgDjK6HCPV7rATOn11ARDvMvMKPFOUv2xi5N19fXrQS/korufDhQpQ== 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=4xdE3+F9yBuefbI85vmFDw7FMv1RUI5kej4TGiUwI1c=; b=x92vW9VV7arEWoA+yk6WkMJ+RcS9Rp0HGGUd7UAt5fGN/9KcsL3QeV0gUySnLrJN85G9BpVCdRn5Oc8gEsgIXwtHChVDDi9Vz2hzpypRgTfTMRKDfEFvVt92ZK6WRAbTb3qziCnruIEf89krI2Wv/UmMl3TJPGX9yoyI3jcOiBI= Received: from BY3PR04CA0001.namprd04.prod.outlook.com (2603:10b6:a03:217::6) by MW6PR12MB7070.namprd12.prod.outlook.com (2603:10b6:303:238::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Tue, 5 Nov 2024 17:38:04 +0000 Received: from SJ1PEPF00002312.namprd03.prod.outlook.com (2603:10b6:a03:217:cafe::6) by BY3PR04CA0001.outlook.office365.com (2603:10b6:a03:217::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30 via Frontend Transport; Tue, 5 Nov 2024 17:38:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF00002312.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:04 +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; Tue, 5 Nov 2024 11:38:01 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" Subject: [PATCH v3 10/13] platform/x86/amd/pmc: Use ARRAY_SIZE() to fill num_ips information Date: Tue, 5 Nov 2024 23:06:34 +0530 Message-ID: <20241105173637.733589-11-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002312:EE_|MW6PR12MB7070:EE_ X-MS-Office365-Filtering-Correlation-Id: 34f5db85-598e-41a7-a9db-08dcfdc09a54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: 8Nthu4hoWasQMB4mrxo5gsEZ96RKALOmDPAQ2ajpJHnvYL7huJByS/63p6VdS3KE8/5Kjwty0HBKuPu8y9tFscxOraI3/4ugMl3i7Se/7BGz1PgM4XZ7bhB63SGBhplFJPVYLGaBv1uqPihFZIGA2d462r+mV5+4givtCPZ+WCtq/TVH+PxUloA6f8GqJD164EExF17LkM8OeNIyUpWSHS92+7ZBfp4REEx8lnAu4GvsfIqyqhwKo9E32OX7U9nrDj2+j7HxWbs6L8KzU+pI9rBEzaAhb7krhq/nxgNDXkyeoo5VHxoE6+nJhrH1+iNLG5y0FBDkYnwBCZTPkp/Sj2UPT7lQgYRq5N0NZ8xVGOujyUCYyFzzLzMP308cVJes3+1CCf0usHian/PLu9SV87bCivFiJCBIHrAM8iwhGDp52GPkwp/4PH+tR2gVTQmsFWC7CnsBsGZpytP5PfLq9DE51NW0dvJotlv5aXpuXWA+ZsANwKEqL5g/ta8ciaZw/3RWh6USmW2tdc39znrJ2J/AGKziObsej6SqqxAfQDnZAOHYemP61bTLV0PNBQk92GKSR2+fBEqviH2KaOYlcVXvq8PgGFU4E6FDLV+jZMSgMbCgwo1cfHdAuikNibiYB6+cy8/F79CGH5arCggpKyK4mAp2o3G4vA7lKGkCj1BD/fJUlyRXWImApIh0OXogH/tEs0zE+rHqhF/bH+9Wd1xqx4GRD0DPldZZ1bR/oBg09Vm6+TqtYuL3TD8/uUiUrMlq3eybJT8oTPF+lesRslYLsHuQ5MugWcwsNVO8fY0Q673WOm5jDuhHGKgyknK5C818aHbAy600+0D7cnmcZQUTdcy4Prh2iok8BJaFGJYLptiHaWXvr+uRC2yM7BQYwzrc1LeC8UFrQ+TJsE1eOpiL8MHtExwS80Kf4vCle2nDBovCYB9shn00iVsEOLWRMTgYMJetTIWNDM2s1J/JZJnM7CxssMQOkEIRJgFPhkK7/8ffHvvxt6VzH/PZMJGccNAjwzjHs4TudiN5R3zdKTIKnSWYFA3Au5Mbo8U9oe/ZlBhb002Tm8hKODH6x9IS/SsocIVPEkd8dqqErR6Wmudpngira2ouP54OnKQZQDQbUKCLmTCQ07f+4wJJNyhKtS5zYXBHddNYJwbKHKpj3h1pC7rniXYeuhWjgi1gxmrOgXOpb99z/dgS/j311bjEj5oP0AqwyzZQom1IsnnFa7dyxYEMZxmxpFhz3rgnx7sf0Q+tZn0GKPs+Ojvn9suxV18K6g4K4cvCp5mEpzTQSOd1bJfgUVwvRJWuvj0iye4igFqo1+P/4uoqzAtWVLKwliFYOksUAiaxOPKzqyJm3TjaWH9PpmxGBmOvFcuXpwCRAg8H30dp0QgqIa1zc0X2Kv49HsN6JYOo3oNsBN5lRw== 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)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:38:04.2993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34f5db85-598e-41a7-a9db-08dcfdc09a54 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: SJ1PEPF00002312.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7070 Instead of manually specifying num_ips, use ARRAY_SIZE() to set this value based on the actual number of elements in the array. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Reviewed-by: Mario Limonciello --- drivers/platform/x86/amd/pmc/pmc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c index 5ca97712ef44..77f2c6e78139 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 @@ -120,7 +121,6 @@ static const struct amd_pmc_bit_map soc15_ip_blk_v2[] = { {"IPU", BIT(22)}, {"UMSCH", BIT(23)}, {"VPE", BIT(24)}, - {} }; static const struct amd_pmc_bit_map soc15_ip_blk[] = { @@ -146,7 +146,6 @@ static const struct amd_pmc_bit_map soc15_ip_blk[] = { {"IPU", BIT(19)}, {"UMSCH", BIT(20)}, {"VPE", BIT(21)}, - {} }; static bool disable_workarounds; @@ -201,10 +200,10 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev) case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: if (boot_cpu_data.x86_model == 0x70) { - dev->num_ips = 25; + dev->num_ips = ARRAY_SIZE(soc15_ip_blk_v2); dev->ptr = (struct amd_pmc_bit_map *)soc15_ip_blk_v2; } else { - dev->num_ips = 22; + dev->num_ips = ARRAY_SIZE(soc15_ip_blk); dev->ptr = (struct amd_pmc_bit_map *)soc15_ip_blk; } dev->smu_msg = 0x938; From patchwork Tue Nov 5 17:36:35 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: 13863269 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2066.outbound.protection.outlook.com [40.107.243.66]) (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 147B115C144 for ; Tue, 5 Nov 2024 17:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828291; cv=fail; b=UyNHvyS/+1IW1pbYeR8e5KAlepm5Xk8Go/dTNl7ph1fRfRw7x2L8+uRJKQBpQyPuvlMY3NIhMw5j5TNomqczOAI7HnExRD6ukuutxJ38c0r7iO44zwCgtYDRS33dFZCpDfzZ7Q7+HJdAxtE4e5XUvMpWwDHAXse2g+/WIR62T7o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828291; c=relaxed/simple; bh=j0hmej36uztwUlNDtTGoYieRKUtQp63jgt9DaKAShYk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ULS20zw5TbyhtDk9opS4cDoq29wmi6qqUTtWCBNjj5sm6Frcxo8fesllKw+wkQOFat3CkrUsnsXxavvwhJH0dy0Ph0Pee5eUBrypHRtC2fshNhheLSoeDTrjny6GqvJenOtpmF8MoxEaZB9YHIJNTWp2TsEJNLhLWdSBvhjkr3Q= 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=xE/qDo5b; arc=fail smtp.client-ip=40.107.243.66 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="xE/qDo5b" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=V4g4/OvAHJd/fKixq/Hk/Yy0sBLN6YiW1txKjGnYEUy1lwG8Hy4tzeVEFebQpWnuRSHFY8LMZ6g8wtnd4MJncOGtH8KDdeWG1lk2WwRgBxbY94YfQTluRusAcAQ2iwIVjBhqC1KgW7EeFBdWKlc+9iPAB+/bundxJD6+zeZpvNwbR7vCrWd1GtzspwYvKq4jEIFOQovuBo5AyqniTm5mnLJbO3L3uCmTJ625gpGWEscqxJKgp9S48QZ6Sl3yN8PIeLPAhl+4+8Os18Ahtydnl3Ng04D4ZoPb5q8QyiOXtk15ZXtvj1UECOJkCbzcjBY+nIbabuG0K5A3P+ooSqdB1A== 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=hfTChAUA2b2Io7CfaKdaUj553UUzuSsDRWjKgn1kGEc=; b=pXWdcaWBLVAJbUbluMiXam7n3dX4JB5malmSU4LENiJJ/03JBxy5COZcuno8jXHYAUn9TOB6E/XUbDXYd23NllKcqO2QgCGpMirrbtt2sXmGBe1WcsGPYxjOPUYc8P8hE2dgbCU8Fvz60iad5EgpEIFSsnpx5ApeVp9Q4YS+7JmPaHe0XSMjtqDsl//YePd5Ej2RR3qHZHeZMEvrMZMQgLW68HgyGcgcqL7qRF9wq4+8xiPxcvYnDXJzFNFgKFtDe+NZnc1EuYSerRo4ph0qIilPLDd1PEcfOw3BOgyxRomEs+NDXcOMD8Gpk8qNmgzwf0yZvu0dQyMNNSBT7A/IYw== 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=hfTChAUA2b2Io7CfaKdaUj553UUzuSsDRWjKgn1kGEc=; b=xE/qDo5bE/0sxTBnegzSTvv2lvzof0j3wC/7ATA/tE0NXPg69z9jDZuI4T82KVhKzmtSBOb/4wzHSKdXBlMI9lIQGVB2VpkJy+967mkez4n1w1W74zyv1itdOJetSJ/tc+ZQ5Yd5m1BL8mGpqqIE0Q4/YGZ6eAuXYGpHD7+h3es= Received: from BY5PR16CA0028.namprd16.prod.outlook.com (2603:10b6:a03:1a0::41) by MW4PR12MB7215.namprd12.prod.outlook.com (2603:10b6:303:228::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:38:06 +0000 Received: from SJ1PEPF00002315.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::64) by BY5PR16CA0028.outlook.office365.com (2603:10b6:a03:1a0::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.28 via Frontend Transport; Tue, 5 Nov 2024 17:38:06 +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 SJ1PEPF00002315.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:06 +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; Tue, 5 Nov 2024 11:38:03 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v3 11/13] platform/x86/amd/pmc: Update S2D message id for 1Ah Family 70h model Date: Tue, 5 Nov 2024 23:06:35 +0530 Message-ID: <20241105173637.733589-12-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002315:EE_|MW4PR12MB7215:EE_ X-MS-Office365-Filtering-Correlation-Id: 25f15cb0-3466-44f9-55b1-08dcfdc09ba5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: nYsOrz+G7eoOLm/A38HKqarDYXExOIEl/ilioS/tn4RzI03gTmFCwmGxAi2jHohH2DEoIc7KEXi4VNp8gAw4URywlg2yqzkt3RDSJDwdkomw+b8PJtaKmlONMq5TWqm9VVo96dSIjbATBt2UNC7b4fut+O2l21FV5Mqzt3DX16AGpVOWv6IJjjcK0XN2ZrcEQfT7xj5wVoVkB1zfoUf1dqc8aabpqfkDIY0jn2jyY4+A53W7Y6fwaakAPKh5XD1qixNbcRiMg5/cGx8lGHXyMrpud6urmU4x0tVI5BY+PEkDFakeOVxVCmE6B5DX/FQk1/Fyt3CPE7SPxM2CgymcqtRu6SDkZCfqlY3N1j0jRjwCVJr5QODKuf/xUQo7WYaW1EEcwdcocMvLKHAGvBYpz5nMc0NChocJLkZ3xYuay9Jla50GuLKtQTeGYqI3kW0/QHW+IxZT3PMEBRgK6ZjtoO4jLsKf7x0uoHCixp2MTZsWLEMs0AaThz4Z0ORsZQWpzk/hKIm7MlyiElEsvf3w123q1Lrgat/pqbG1R8JejMpYC3Z5J5zgEpZWPNTYm9B1ieb7wrdUhUR0XmefUnrGeiLJ+13ZGdFanoX44pYL2bK8ZAXK5fa1v1Z+pp1/ODmlHyJULmhKDNimbJtREtcCZiIg7JPN6Z4ubAPnsC0jJa12ltsryknxK5Q/h7gxzI5bu4Jn3AX8fCN46tMva9iSngSucX2w/GscLrTuxq4QXSlw5Gq6Hp0jOl/u9m14teKNa5zNVmhZYCb9yZQgVeiLXafj4jWdJsFpS5+dA84nj9X+W0JWKFA6FCNkLeCeoxdi9NbYR/0rEG2iNglqVxGYixFFo3oGoXG0YvOiZSqdg2sAD2AeLTGfMeiEsDcuw42IUYQDJQOTIRLmpW9bCT9I9KsuvWyNo9KcCD5V9jWVfowZyttIBxoIIwu/H/hVVr1Y936oO6hAJsYN7R+y9lMPx39ez1KiU17ixXeCiqsLbx7OmILdIew/BXqqy5AG7x0238rir1DPsCySOGj2X5DRNROGOmYKT9oYHNoDS37BYXF919+rJLvOzJu6CnonlxBksYVFxoehQnrE+AJ7up62OGECroFL++R0WZG70KSzc3uAKgZvmO+VEitbXCo9QZ0KgzDDu3m8o96pwLdFEmviXGa5zzGAW+SJvtZYocmgHKCe/7v25e6il5HMqBvSmmDt7QgXVnx7O6kAadONWoWjX3+amSZvdNnY2z1q46gHwvYlxxGzM/xM5d+u75wU3GZ5RDO4p1wQiJ3Tevl29erQEYo9PRjgukExEf8IWuYBGTsdfoGvPaC67uENIpw/yzImgvqu53d70RV1mRGZc+y65er8TnAHZdjUQxk/PdYlQgAFosq+uF4pS+/5ZXlQgE1O2k2zazIgzcu8vIl2+BhR3Q== 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)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:38:06.5057 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25f15cb0-3466-44f9-55b1-08dcfdc09ba5 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: SJ1PEPF00002315.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7215 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 38729c9b205a..ed1723853158 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -250,7 +250,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 Tue Nov 5 17:36:36 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: 13863270 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2053.outbound.protection.outlook.com [40.107.223.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BDE715C144 for ; Tue, 5 Nov 2024 17:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828294; cv=fail; b=RpdvRfO1K0UZVF46KSQ2hoPOmOOKR+hXpxKRFgdFZ62ApcNbwPQmnwxK2T1WMm3E1ZzKM5JdMsZMwU5AGrTiSVvqTqoHQZERYV6NefeqLnfz1MiH1e9kyQUB9HsYeKr3HCGt5/P1ALOF3gIrgWHd5Adscn2EDnBEqWxV9QZtz6Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828294; c=relaxed/simple; bh=Iu6YwLJ9OMVh4+XZMxtyISvpBjGAZJ1kKz6pb9hdZ+I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KZSHOPHSmIHnXJVHXz82c8Xy+yfK56LFxufHjg13tKZhWULpMC3RVNDg70QJZfaVCo6X4vHsiVu9ELUG8oYGEdvXIMQOqjrIc6Nx7VID+Su/0CC5tE6aY6dchoVEunUbTOAM9CSkOphdk50WLgmAVkai9Xr2GzmDk6Y8Y/v73YY= 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=NhWJsI1J; arc=fail smtp.client-ip=40.107.223.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NhWJsI1J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OrU0byu+Fruls5Xic6ciQvLyNrszIK/d0Ks+UTxGy1NIi7OxgZxzifkAjuUlOWbQGemfPK1lQzCQcC6xN9iVi+uxepWZWKLxSMQpWMxIcZu3XtnrYr46YkOM4Jdw+e+C1Ug5StnkusyarNCngghyL0nDuVAmpViL220PZOsp283IrFpchDDunwSQyBUFln0P8pDp10A/61rx0ZjTUdYlQwkBGTl+i34syv5G1vKO1vUL12889uOaJ4l9+57qjonvF/+pvUZrUNJhjhS5nigp7F5umnNEc+0WIVwpEIelxh7Y5Xh/5iK9Iuh/eqPmFv8xGrY+gomPSx+yow4DAf0WDg== 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=GCjnunvn4XfJs4efjTzSEtEOXbZwaZdyAEuamuhw3Ik=; b=EZPQ8JsGWT6L+KEPbGv7bxn71lvq2rA0tYvMVKtXoMfuYrJs+sBcG/qZXhvQMrAec00b2aaQLOJ8yJWHBr0KY+rxjMjoSdqka2y+A8MYPpTOiMoEDDmpnvvY9yeRat5Us3PmUA+8Z2PJrgGJUu/DD6UJVY9ZcGoWQEMM58swt3XE4xLuxk4drJDvOKiGgKsX1XBd8qHjy6RozUopUu3WyeIb9YIxG/14NKK9JZujwRfcAjIWgZ1J2eivAHTgnEudek+kdnAMu0MjCiNo/Vza2aFsqf34CR9zB82q5oBc44xk34YWxYzX5YWplvOZ7ve7TIHT2DzmCj3qt4VrdKLH1A== 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=GCjnunvn4XfJs4efjTzSEtEOXbZwaZdyAEuamuhw3Ik=; b=NhWJsI1Jk+av5LFBgQNG1F5ZKsdHPVzKwjAjNRZm4uhOZLscMupFdlLpiMsckL5wUvlmpVQSuaqMh/aCBUjrF2z+SYV139sVbEWUbl51Ayol5RTY9pC7HYnd/dGTeEWwI72kEjbJX1Eu5Q8tYln8Tcx0jo5sYCZHLRWgvKBu2Lo= Received: from BYAPR02CA0033.namprd02.prod.outlook.com (2603:10b6:a02:ee::46) by DM4PR12MB5721.namprd12.prod.outlook.com (2603:10b6:8:5c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:38:09 +0000 Received: from SJ1PEPF00002313.namprd03.prod.outlook.com (2603:10b6:a02:ee:cafe::2e) by BYAPR02CA0033.outlook.office365.com (2603:10b6:a02:ee::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31 via Frontend Transport; Tue, 5 Nov 2024 17:38:09 +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 SJ1PEPF00002313.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:08 +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; Tue, 5 Nov 2024 11:38:06 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v3 12/13] platform/x86/amd/pmc: Add STB support for AMD Desktop variants Date: Tue, 5 Nov 2024 23:06:36 +0530 Message-ID: <20241105173637.733589-13-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002313:EE_|DM4PR12MB5721:EE_ X-MS-Office365-Filtering-Correlation-Id: ba92d10d-5a6a-430e-2b66-08dcfdc09cf5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: DMH4T2zRB2p1mkXJy+EYqQNcStq5kqpRaRN2jxcAPAgKb+FCXQGklA5yzgO515s76RL6DiWmwsXJf7qOasFNmuQbUj9fGpgkerJpYkkkZifDXvhaI6qiXjVgfb32TSevuksHw6nCstJyJZIg2DOB8eZVx9v66tUR67wdALbM+YPdtoXgwjjTaZGbihIOI+z9K0O21nb+TUqhWuPSNVphBYR/CTcN9P/Z+WFRtW51QJ1ddmJC6nqoHdTXt6lCXskMYPoDhFZf2cruFZBooZ3azX2SwZZq5YqUAAo/WPRLrNJYsbaU1OKw5xGiLhNBFuITj4VbNmIQqdWXgyPMQJqn82dgPsKM3tUnF1PqevktXMpFibxSKTDa5Kr1VRTUbuj4rlgytGmjNYjUi0MvvWuCHH9DC1Z80At5gfBFWrluYwn6+1911pO8eQE4q+fzCuMReoJmHc6ff8aemu8F1gIddZDp7NNqGkgjAn9fbZJvy/NdoMdR6VOMu23bngnvu+CI+K9kMopHcE9ZZV2S1jfNhlnlkqqAsEvZ3DB5ABsUJX654Q3XkX4TsSxaYYNDPf7eCFOiZUaz+DdJ2sPW7LjKntp7Trrh59uViiDn+5jSdLOqXUv376OMvexhGXT1hGV2+PGkHl7A4mTWhgwQIQuLEPD82BesWwObZV9EUkZfr+n1sh+SY7pK15GjfiYTQJcaw5106S4L0T2DnNR1tKJ8o3d3sb2L9V24js1ZbXNMUusp22i+BOo7S9yzQZtc1t5BUbw9/SKjkJnfVYw61ZJASiZWNANsD2vllW9OFEtJUxp0Xsvv/ipXwqYw8hFDMxthydlInBEIpeo3BAyDAYlNIr04/yAVye8b/v08guscYtvQrGCYuobm5YGD60MXVD4vq3r22qJUMA0ztbKWmiosftoWFC9aW0EwgkVg95vYpU/N+U78aHMslZvELCq2MhXeAwC9puOZuX+l516I7Aoy8NyLhHAeUul38X9PiJPiqlkPmt92LbJhX6QFiUbWRRi8ZIZ4f/DuYEjYfR8KUguhnQDh6LJ3DrwOiAaDVT39yoILCwWtZ88PVzLg3ENvyGo0THoRqBzwGfa68Iq2VhRkHf9qTXqX558Nyco7wx/VMtMfTPjijgvIaLdp09QldUhG2rmYhtxzAlULmKE74ZKTx0dSLiIeqFv4OIsy6bWCAYG3H8X331CQFCK4qn6HgyijbndjGXNJfIZVfpBK5aFH4SruqNKiq6iIHGoHqyo40z8BAF5+lzcG8aUNW5lRW1qLS8zYNnwOmeydB7WILXTvz4H29wWflpJ4pJ643dbDH22u+gFkKA3U58ajDbP9KCya7y3C5W93lFl2skfD7BftW5934a2mSr1PhNCRtMJUWIBVr+CSlM1mTKNOdwYj4arSp0gf+3f/FoFNOeNNsKsZRw== 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)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:38:08.7066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba92d10d-5a6a-430e-2b66-08dcfdc09cf5 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: SJ1PEPF00002313.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5721 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 ed1723853158..f0d063b4cba3 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"); @@ -238,12 +243,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; @@ -259,10 +285,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 Tue Nov 5 17:36:37 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: 13863271 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2054.outbound.protection.outlook.com [40.107.237.54]) (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 873C515C144 for ; Tue, 5 Nov 2024 17:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828296; cv=fail; b=e6E24ZU11qiLM11FXeFoeIUo6cSbZhGV+7dlS5Kzqo6reZHUWFEvEQ4OsA6QL5ybuJV6j+JKSqZtYS+uyjCOPpHi4c/9ZOGhRtU6oNDi4ERytdVY+VQHLUuaOLvR5Eu4lYVGnwHG0bCx+97GvZup7xT9ze0N4CJWd8lhiKPUwBM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730828296; c=relaxed/simple; bh=6nB8OpxtwswmgeLJr8x7V25awST8sgsYZzJwhXLJDNk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qlYswP13PNbsfDVRYp9rUim8KIIJ70+gyHlSPpSBjzOoEoRTqxIB/7yS6+Fwk+wmXbGwuQQWYdUBVqmpi/Hks5Rg0eBOEHuni01bVTS127npOWKL1JQLxd8CfhpSYxtw9wqxVEJOFb1QroVx8/SBFNCbfmtDprHZ3WmLe6DJtCs= 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=0iJ/ZyA6; arc=fail smtp.client-ip=40.107.237.54 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="0iJ/ZyA6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m7vZSviOSBMmb0Zf3yi2c0rDxkgiRjWYWiMQkD4TmaL/qP4/yuIMXva7hPN8zRBbWLJl7NK50y7/iDVQRLrCMF86aCx6qWGtB7QdLPDIGONNHebOOxtPQ4OD/7JE8ci8g3QwEO4YalSTScbZGrOSa94oQj9RU1sWDuVS9JVtDkPySk/VzJ7bGAc9MGIjnBlemuODFMbs285j04jsvIMP6yn988/ERoBIefWSCtTyX+bhKzqrgq3PXd+Ov3sLA3oYEDLSsXJY8HHEPXsh61LLXxS2IFPEiCWm0FkxhWXVRrPn7tAz2Oagn25C1m0Bbrob0ggpolG01GZ7WUu99z9NYg== 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=OEjt8Bf2xv8ySA0h97xIcTFkg1arwUtJ5BvbCY+hYL0F+uvzGwnfwaurpjddGzNMEWsSEjXm48SHlotDrOtDIN7ge0YvaLfxoMywQXB1quSqjHNcznbNK4kk+lFhuRydo+lvhLTruRKIPzzJNKv7E5KmFzwxo2tDLP3KaP8+jjim5lYpZM/TzhmnGtq+3PbHfXAMZ1jNKoRyjmEQCQm9538wCXsypUeEPJMMI5r4qUAE6azsXp/hrfS6hfR790Oi9apB35KcpH5PuYrFwfw/MW9yiKqADaX3Xni7dDwkdASHmfZHVEAiJdF+uLKSFfTnWEzOAKwx5pnPUkdORu7RxA== 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=0iJ/ZyA6UUXbrTOWzQIlWr/J6bCmAVonMGoZNuWORmHQW+Tg7+c49eyvX5eXwccvLbXCMo2G+pg4xfRTw5/PIO92lT3dSqftaN6FaghuCrkuQdrav7u/fUXYzDI2fN+cA4Yne3PqCrMUJbGmx4sXXUFbcnwFzINg/xDC1z4OXkI= Received: from SJ0PR03CA0341.namprd03.prod.outlook.com (2603:10b6:a03:39c::16) by BL1PR12MB5827.namprd12.prod.outlook.com (2603:10b6:208:396::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Tue, 5 Nov 2024 17:38:11 +0000 Received: from SJ1PEPF00002311.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::f2) by SJ0PR03CA0341.outlook.office365.com (2603:10b6:a03:39c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18 via Frontend Transport; Tue, 5 Nov 2024 17:38:11 +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 SJ1PEPF00002311.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 17:38:10 +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; Tue, 5 Nov 2024 11:38:08 -0600 From: Shyam Sundar S K To: , CC: , , "Shyam Sundar S K" , Mario Limonciello Subject: [PATCH v3 13/13] MAINTAINERS: Change AMD PMC driver status to "Supported" Date: Tue, 5 Nov 2024 23:06:37 +0530 Message-ID: <20241105173637.733589-14-Shyam-sundar.S-k@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105173637.733589-1-Shyam-sundar.S-k@amd.com> References: <20241105173637.733589-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: SJ1PEPF00002311:EE_|BL1PR12MB5827:EE_ X-MS-Office365-Filtering-Correlation-Id: 4fbf16c2-6da3-4815-fae5-08dcfdc09e3e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: tJvI2SwHMfaKqgnGeC1/cAdMHN/bA/+dFffMLU+au9dqGF/xm6PRDDMl8wA3pE0iBX6rMERI+4Z2gZA0i9R/5UQAfExKFTh5gzwhT8uuJSeVGFcBILS3SmDd9U4zdMmSZT82f4h5/6K6JiaiWm5LKGCQABEdvwnZZoOaIEWPRCafAFXDEsVFAfkeucj+u2qC74JrNANCCwJTi0TWhI+8Mpr4IaVexEVNL5ItUESNXUg2xpAgtgp3hV0sBzdsYWvbbCAg08E7uaRjytoHDURyYxvcgJxyteSRTCWwcnuj2pGCJNlFjd1ku1k89bh3riNw6zVM4qd7+WpnSm5MpiLqHOaAHgh8/cg1fmXL0GWWEN3wSyfgAOcL6jr+tENFp7SflzB+m+64RyJw4EQVDig+ZfaiWcqIkwLdN2zNtUHMAa60zazheBLb0+vXBiYCrrfVOh10MdhkdIsjmVUNoKOo7G5G8ddwUaxgj0HDn9Z5guJaJC64E0WqU89TS+d5MwRZQz2411PorK7vXakkT0LKsxo+Q5ixuxOTYm4mXh10sMWRYOo77/+FE4S0SGAcBpfzDb3fZC29icHOlGMn/fbaX4ZYskTRw+p87AyJyy49j16pso2U5w8QL38MkaWq/WVYlilLzf2pCJiOOek23YeZyNmsBgMtKlpbgNXaV3A9bVDCod15R74xjfAObaiyOHSSFPdHtnw9vXXzEYryihDWKmOzkOtQqsnDWX05uanW+V5Y3UY6VnTv5sDj1+LhpITMUCSst2TIKyANXHC0dteaCRTQnbispROAN5gvIRiL3cTc1Ix+xRERo3QjnQrb6IwywAGBTlia68EwP3yWujJvY+V4WLfCsIGIwAlFuReTZXs8Ba72kpaM7tl31Mje0Jhl8br8oWW7b5hUqM8ZbFk+ACheDMhUfxONbuP+wwNlTN8Q84uYctHqFzjEJ6DEt6TH7cceTWygxC4B0Hfh35BzxHQl7w9Oa9G/5finlgLwIe3gbyLG8ba38I8dC+t8NP7KZgv68AY7DedV8/xCTDjYr/VzcwqmxegZMeXecMypKi4jeGbaDViigD8IuwaUkMUJ+PYOzy4nW7qm0s3otBQWZOiSPnBt2eQ5oOooMlpqvNNiY0mWopWnqEaxNeFsuFjbodtpS9aTAlEjlpiw3yOOtBnnsjfF0DK6nylNanQDzU9De4++4xEKqJF1fFmuBu9NgKnc6cTvbYq86Koann6YeO2m3VmUJVN08BArN4x/J2HrW1x5/oxdLVDmKQXylAqx2Pd3HAIhoeJH6r+yeliYcBsfR8YaSrGSZJBEkVfKqKMgWPD41q6FNxakyi2+Xatv6UWAuNOFlpkcvN42ZBtbp87iChjQ5XMWnIalcEbFFBB9GYn2utWKxDpoUeKxPSP5UJP5quDWX18vHj3ZNPOVVA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 17:38:10.8681 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fbf16c2-6da3-4815-fae5-08dcfdc09e3e 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: SJ1PEPF00002311.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5827 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