From patchwork Fri Jan 13 20:54:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Lanka X-Patchwork-Id: 1726400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=fwHF/Kpu; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nttvv2FDDz23gW for ; Sat, 14 Jan 2023 07:54:50 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pGR4M-0007hX-Fx; Fri, 13 Jan 2023 20:54:34 +0000 Received: from mail-mw2nam10on2066.outbound.protection.outlook.com ([40.107.94.66] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pGR4I-0007hA-TF for kernel-team@lists.ubuntu.com; Fri, 13 Jan 2023 20:54:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k81yPjHc5onEDpBrwtWvRi011lwwp3tc0HlDjwFWIogxs0m2lH2gp31RqevN100VOxZWtGaNWQV1pnaRlhIUZQEErSEOL80rUigI3+9P7S9sHr+GB9b0TuAnITvK4A8E+CLErIRNL+XOcRWeHcy8HSTyBwXHZM6/r/9NA+kpC+lay+3HoUj8nQG0tq/zQOL1WV4Q9jyqkZrjJ1XLIT+cPZ29s/8I3HBehq/Y9TXMdfvJxSeIoafTl1zeNAY/kNsQMfiqECU6ZPuDDNJathUrYW1tTFevvgCHy+oJ372dhabW8i9A7uLXmdRTUROB20qPllZZY2rGNj1HE/GNqieFtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hbPINGQyavrm3g+aplmvmC1edhSwErJy5FOLEk1xUzc=; b=mpw3Fi4DINCZVLRW+MYyU/3LhgecXReapasF5/a7CHMAUhFxBeAHzilYzS39XYRnJuZYnPXzjgfUpnDtY+26nTYtoDE6rNydg+6YC9XhPgyjw7+r6VEPpwAP/LYvRwO+nFRpNdkQKco66mrANB0UlW6ZkAPuJbThOA0H03/IG43AW07x6oNxLOndNAsDfp+u9+SbsuxROuwlGl5SvGyms7NagKzPm0qr/KZoS8EwXYueTfs/MG727cjNExl49wDPNo68MfCGrhiRqhhtf9uO/JadfW0PSyhzFfAx8G1tWg4lw3AfJfNVeGDu7O+YTI4LFBKfe4R5fUZswW3w5wdrPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=lists.ubuntu.com smtp.mailfrom=mellanox.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hbPINGQyavrm3g+aplmvmC1edhSwErJy5FOLEk1xUzc=; b=fwHF/Kpu5diuxfk2Uva38q49Xcc6CzyLpxPe0EX0JyHDPPz5QKQWecJrvn27rMGpIVxFM6hMxFrJUgVJQdEkqazV1e5A+wTwEeM896BBWexg6FwYscWQ0dmR5nLbpeS8fTIaOHMYDzvav4x924IXGZn6gdU+7fomLXNFfw/kOZAlwMYJ9ThoXbd9+iqH9HSM55Zom2q1OSxSZlm24j4Mgxfp2YwIlQwQhk+eFHkuMNwbktnUMJ1OfnGDh9B17hNI03+FNgH5rLHSiAvPkz/9rH98/4o5RKgDVYiO4ezylLM2saDiebQtXk1PESM+kXVLl3OteUC75LTbhVimrn1EcA== Received: from DS7PR03CA0261.namprd03.prod.outlook.com (2603:10b6:5:3b3::26) by SJ0PR12MB7474.namprd12.prod.outlook.com (2603:10b6:a03:48d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 20:54:27 +0000 Received: from DM6NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::8d) by DS7PR03CA0261.outlook.office365.com (2603:10b6:5:3b3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 20:54:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=mellanox.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of mellanox.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT081.mail.protection.outlook.com (10.13.172.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 20:54:27 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 13 Jan 2023 12:54:18 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 13 Jan 2023 12:54:18 -0800 Received: from mtl123.mtl.labs.mlnx (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36 via Frontend Transport; Fri, 13 Jan 2023 12:54:17 -0800 Received: from mtbu-labmailer.labs.mlnx ([10.15.2.12]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 30DKsF5S022181; Fri, 13 Jan 2023 22:54:15 +0200 Received: from bu-vnc02.mtbu.labs.mlnx (bu-vnc02.mtbu.labs.mlnx [10.15.2.65]) by mtbu-labmailer.labs.mlnx (8.14.4/8.14.4) with ESMTP id 30DKsE98022666; Fri, 13 Jan 2023 15:54:14 -0500 Received: (from jlanka@localhost) by bu-vnc02.mtbu.labs.mlnx (8.14.7/8.13.8/Submit) id 30DKsErn027192; Fri, 13 Jan 2023 15:54:14 -0500 From: Jitendra Lanka To: Subject: [SRU][J:linux-bluefield][PATCH 1/1] UBUNTU: SAUCE: mlxbf-ptm: power and thermal management debugfs interface Date: Fri, 13 Jan 2023 15:54:14 -0500 Message-ID: <980b6012f49dfb536266f5d1b86b7d05fdd95c39.1673642351.git.jlanka@nvidia.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT081:EE_|SJ0PR12MB7474:EE_ X-MS-Office365-Filtering-Correlation-Id: eaab3521-841a-4076-0660-08daf5a85c17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GxY29sMdRw8P0s83htwXC+5WY0VG2zropeNp+rgark8YsGkrgu+7wT9UkTAwvBEUB+tdiz47VxcFb7BtXE8w9tTlaO5mfvNsEq8oBLDE0J1A+2Q0prm2ljTko+xoQgf5nR+xdskCCZ72TS7rTZLsGXMwQeycwQN/Nqxf80Wb0WGTS7F3F0ePgS9JoPdvNtmJ60e5EHaRrVwgnCq2NS5ul49opkslyLXxJawq5fB5u4YDFetXfeLYuyDukjn33hlGg4l2yGAqioewFd6kHJTwXgNvPaeTwzOsiL1AopoVvvUlbkNOXRqTETZU6d/1KPe4Dhf/220TPC+rSN6tLge4XUItBx5rLtFSBhupJufSu/vvFtX8NxKDdKFiaG5gaPEGVBn9Qy10C3u+C4txBv86Twgj2t+KzhEC16jkFcz6jC4DEFupwuTQfjh6NymHBlCzEn6NnRpdKWCk+VUlS62M2BUwgGPSk12nDSmHp9Hascq11pEXqewJC87lsU2mbA31eLJzSuL/9KBtQm8H7o4LELo5YnpN2NGKewxo6LQV9PXkIgbHhC6SSe8kjx5GZLJJf2/ZrHnBdxAh7mkaLABUKb1oly9IVGXNWFqYaeeIrwEcYuZefZxD2mUxmHjY8aMxPrkOLuwAt3YhTaW1YDfJ6SXKO8Q48a/xXAkp1mNjRPi7ozgIwctlR7gU40cznU3DGB1MTfpLIodAmxb96iLQzBIbG3xS5qTJKVUbJNNaWAGO3IBUhJ1feSfwObrdea4gg64S8WIwbJxojNsheeFGxUoHCAbuNk9SzPWpSfZKVmE= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(376002)(346002)(396003)(451199015)(46966006)(36840700001)(40470700004)(2906002)(83380400001)(356005)(5660300002)(47076005)(336012)(83170400001)(82740400003)(2616005)(7636003)(41300700001)(82310400005)(36756003)(8936002)(26005)(40460700003)(186003)(54906003)(316002)(42186006)(40480700001)(42882007)(966005)(107886003)(70206006)(6916009)(478600001)(70586007)(8676002)(36860700001)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 20:54:27.3264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eaab3521-841a-4076-0660-08daf5a85c17 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7474 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: meriton@nvidia.com, khoav@nvidia.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2002852 mlxbf-ptm driver implements debugfs interface for Bluefield devices power and thermal management. It provides some parameters that can be monitored by system software. Signed-off-by: Jitendra Lanka --- debian.bluefield/config/config.common.ubuntu | 1 + drivers/platform/mellanox/Kconfig | 10 + drivers/platform/mellanox/Makefile | 1 + drivers/platform/mellanox/mlxbf-ptm.c | 215 +++++++++++++++++++ 4 files changed, 227 insertions(+) create mode 100644 drivers/platform/mellanox/mlxbf-ptm.c diff --git a/debian.bluefield/config/config.common.ubuntu b/debian.bluefield/config/config.common.ubuntu index 4d051e58dabd..c6e60a9dce5c 100644 --- a/debian.bluefield/config/config.common.ubuntu +++ b/debian.bluefield/config/config.common.ubuntu @@ -5250,6 +5250,7 @@ CONFIG_MLXBF_PKA=m CONFIG_MLXBF_PMC=m CONFIG_MLXBF_TMFIFO=m CONFIG_MLXBF_TRIO=m +CONFIG_MLXBF_PTM=m CONFIG_MLXFW=m CONFIG_MLXREG_HOTPLUG=m CONFIG_MLXREG_IO=m diff --git a/drivers/platform/mellanox/Kconfig b/drivers/platform/mellanox/Kconfig index 1339fbd0d8a0..7d7391d5d293 100644 --- a/drivers/platform/mellanox/Kconfig +++ b/drivers/platform/mellanox/Kconfig @@ -82,6 +82,16 @@ config MLXBF_TRIO This driver supports the TRIO PCIe root complex interface on Mellanox BlueField SoCs. +config MLXBF_PTM + tristate "BlueField Power and Thermal Management debugfs interface" + depends on ARM64 + depends on DEBUG_FS + help + If you say yes to this option, support will added for the + mlxbf-ptm driver. This driver provides debugfs interface + to userspace with information related to power and thermal + management of the Bluefield device. + source "drivers/platform/mellanox/mlxbf_pka/Kconfig" endif # MELLANOX_PLATFORM diff --git a/drivers/platform/mellanox/Makefile b/drivers/platform/mellanox/Makefile index 7f67389f5a6c..40d1202de9ea 100644 --- a/drivers/platform/mellanox/Makefile +++ b/drivers/platform/mellanox/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_MLXBF_PMC) += mlxbf-pmc.o obj-$(CONFIG_MLXBF_TMFIFO) += mlxbf-tmfifo.o obj-$(CONFIG_MLXBF_TRIO) += mlx-trio.o obj-$(CONFIG_MLXBF_LIVEFISH) += mlxbf-livefish.o +obj-$(CONFIG_MLXBF_PTM) += mlxbf-ptm.o obj-$(CONFIG_MLXREG_HOTPLUG) += mlxreg-hotplug.o obj-$(CONFIG_MLXREG_IO) += mlxreg-io.o obj-$(CONFIG_MLXBF_PKA) += mlxbf_pka/ diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c new file mode 100644 index 000000000000..4c7533cddc17 --- /dev/null +++ b/drivers/platform/mellanox/mlxbf-ptm.c @@ -0,0 +1,215 @@ +// SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause +/* + * Nvidia Bluefield power and thermal debugfs driver + * This driver provides a debugfs interface for systems management + * software to monitor power and thermal actions. + * + * Copyright (C) 2023 NVIDIA Corporation. All rights reserved. + * This Software is licensed under one of the following licenses: + * + * 1) under the terms of the "Common Public License 1.0" a copy of which is + * available from the Open Source Initiative, see + * http://www.opensource.org/licenses/cpl.php. + * + * 2) under the terms of the "The BSD License" a copy of which is + * available from the Open Source Initiative, see + * http://www.opensource.org/licenses/bsd-license.php. + * + * 3) under the terms of the "GNU General Public License (GPL) Version 2" a + * copy of which is available from the Open Source Initiative, see + * http://www.opensource.org/licenses/gpl-license.php. + * + * Licensee has the right to choose one of the above licenses. + * + * Redistributions of source code must retain the above copyright + * notice and one of the license notices. + * + * Redistributions in binary form must reproduce both the above copyright + * notice, one of the license notices in the documentation + * and/or other materials provided with the distribution. + */ + +#include +#include +#include +#include + +/* SMC IDs */ +#define MLNX_PTM_GET_VR0_POWER 0x82000101 +#define MLNX_PTM_GET_VR1_POWER 0x82000102 +#define MLNX_PTM_GET_THROTTLE_STATE 0x82000103 +#define MLNX_PTM_GET_DDR_THLD 0x82000104 +#define MLNX_PTM_GET_STATUS_REG 0x82000105 +#define MLNX_PTM_GET_PTHROTTLE 0x82000106 +#define MLNX_PTM_GET_TTHROTTLE 0x82000107 +#define MLNX_PTM_GET_MAX_TEMP 0x82000108 +#define MLNX_PTM_GET_PWR_EVT_CNT 0x82000109 +#define MLNX_PTM_GET_TEMP_EVT_CNT 0x8200010A + +#define MLNX_POWER_ERROR 300 + +struct dentry *monitors; + +static int smc_call1(unsigned int smc_op, int smc_arg) +{ + struct arm_smccc_res res; + + arm_smccc_smc(smc_op, smc_arg, 0, 0, 0, 0, 0, 0, &res); + + return res.a0; +} + +#define smc_call0(smc_op) smc_call1(smc_op, 0) + +static int throttling_state_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_THROTTLE_STATE); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(throttling_state_fops, + throttling_state_show, NULL, "%llu\n"); + +static int pthrottling_state_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_PTHROTTLE); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(pthrottling_state_fops, + pthrottling_state_show, NULL, "%llu\n"); + +static int tthrottling_state_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_TTHROTTLE); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(tthrottling_state_fops, + tthrottling_state_show, NULL, "%llu\n"); + +static int core_temp_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_MAX_TEMP); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(core_temp_fops, + core_temp_show, NULL, "%lld\n"); + +static int pwr_evt_counter_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_PWR_EVT_CNT); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(pwr_evt_counter_fops, + pwr_evt_counter_show, NULL, "%llu\n"); + +static int temp_evt_counter_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_TEMP_EVT_CNT); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(temp_evt_counter_fops, + temp_evt_counter_show, NULL, "%llu\n"); + +static int vr0_power_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_VR0_POWER); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(vr0_power_fops, vr0_power_show, NULL, "%llu\n"); + +static int vr1_power_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_VR1_POWER); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(vr1_power_fops, vr1_power_show, NULL, "%llu\n"); + +static int total_power_show(void *data, u64 *val) +{ + u64 v0, v1; + v0 = smc_call0(MLNX_PTM_GET_VR0_POWER); + if (v0 > MLNX_POWER_ERROR) + v0 = 0; + v1 = smc_call0(MLNX_PTM_GET_VR1_POWER); + if (v1 > MLNX_POWER_ERROR) + v1 = 0; + *val = (v0 + v1); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(total_power_fops, total_power_show, NULL, "%llu\n"); + +static int ddr_thld_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_DDR_THLD); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(ddr_thld_fops, ddr_thld_show, NULL, "%llu\n"); + +static int error_status_show(void *data, u64 *val) +{ + *val = smc_call0(MLNX_PTM_GET_STATUS_REG); + + return 0; +} +DEFINE_SIMPLE_ATTRIBUTE(error_status_fops, + error_status_show, NULL, "%llu\n"); + + +static int __init mlxbf_ptm_init(void) +{ + struct dentry *ptm_root, *status; + + ptm_root = debugfs_lookup("mlxbf-ptm", NULL); + if (!ptm_root) + ptm_root = debugfs_create_dir("mlxbf-ptm", NULL); + + monitors = debugfs_create_dir("monitors", ptm_root); + status = debugfs_create_dir("status", monitors); + + debugfs_create_file("vr0_power", S_IRUGO, status, NULL, + &vr0_power_fops); + debugfs_create_file("vr1_power", S_IRUGO, status, NULL, + &vr1_power_fops); + debugfs_create_file("total_power", S_IRUGO, status, NULL, + &total_power_fops); + debugfs_create_file("ddr_temp", S_IRUGO, status, + NULL, &ddr_thld_fops); + debugfs_create_file("core_temp", S_IRUGO, status, + NULL, &core_temp_fops); + debugfs_create_file("power_throttling_event_count", S_IRUGO, status, + NULL, &pwr_evt_counter_fops); + debugfs_create_file("thermal_throttling_event_count", S_IRUGO, status, + NULL, &temp_evt_counter_fops); + debugfs_create_file("throttling_state", S_IRUGO, status, + NULL, &throttling_state_fops); + debugfs_create_file("power_throttling_state", S_IRUGO, status, + NULL, &pthrottling_state_fops); + debugfs_create_file("thermal_throttling_state", S_IRUGO, status, + NULL, &tthrottling_state_fops); + debugfs_create_file("error_state", S_IRUGO, status, + NULL, &error_status_fops); + + return 0; +} + +static void __exit mlxbf_ptm_exit(void) +{ + debugfs_remove_recursive(monitors); +} + +module_init(mlxbf_ptm_init); +module_exit(mlxbf_ptm_exit); + +MODULE_AUTHOR("Jitendra Lanka "); +MODULE_DESCRIPTION("Nvidia Bluefield power and thermal debugfs driver"); +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_VERSION("1.0");