From patchwork Mon Jan 16 15:12:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Lanka X-Patchwork-Id: 1727109 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=H4IY9R+8; 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 4NwbBT1fG2z23g6 for ; Tue, 17 Jan 2023 02:13:21 +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 1pHRAf-000827-1F; Mon, 16 Jan 2023 15:13:13 +0000 Received: from mail-dm6nam11on2059.outbound.protection.outlook.com ([40.107.223.59] helo=NAM11-DM6-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 1pHRAa-000811-7p for kernel-team@lists.ubuntu.com; Mon, 16 Jan 2023 15:13:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ah/TeDv8nopguLP9J7WxWUR7VAkHRb+45+bm3gcK+djjmG0NouKm0iWiVcVqgnWXJM/zAxDH6QB/EPhpyhxFaHlzilCMtYZE22WOx79V8nPmGWa0uB3/KYSUVpC/g0wjq9AWj6mDMEiVVOvP/sK5aHAWUkEGJgJsO1Jk0IDBtHwB2NNSRY4ezoiMNL7WS3Oshw+FwbEF+3LHEYk+mmmJYM347N333l6CTF51tPBW3cJU/wCr29QzcFxNQxGkq1NcaQ9srSR+ZuhICzGQCMq4PdJi60tdnQtnfhSrh50DThpuJN+PD+4XiVbL6oOQWcZy8J+qObTVwP6XIDIPnVjgHg== 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=cmETa1GWiWdLsw26fMjGQutzyEJDYYkXlNrDNbLsucI=; b=jb8i1LjYIfHMOEdKTCBgDzNl3YnvXaywkfcs45Zb6uqRc3wLCL+BMaXJ1ifln7soRAssRDjKdVHORh+YWs4hVSYYX4TYdv/wMrsdxEZQICz0s3DSlbcpx8pbriFrC6sx9s+0GFwdK9Mpx1FS2hfdxqjLuxYPRlOzP1M/uR6+z52SCFi6dvogbDgRUrbd/yB6BO2aWiwc88iOK++dd4DRGkedA7AvXxEBK8kSaMkF4ahrxKyHopYc9yKGSwrKQMGlYlLfgl7qPOfi6yBmJiYmeVJeT/EhjmNrtZlOMif+IFav8neYoJp4AYPfDKxtAsLWyhytathX3f4FGe9rC+Po/g== 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=cmETa1GWiWdLsw26fMjGQutzyEJDYYkXlNrDNbLsucI=; b=H4IY9R+8ruENxBicXAapx7Yl/0/x/gkdCsmFxOfYl/IucGr6OPkLCYojiHN/2DgEJdEkXSz5HQ9zjxR32lm3ii01Qv7WQNt3tR5UcvE/nY52POXamSyLc367yfISzq4Zh+0/aQhCJdJFDcTtr1bLeLJnZT/CTHFyfK3k+WBQn2i2y0D4QSys/nPfDuNQQ6NKYexC38inkIS8tiBHJwilfPC9fwrk6/MposseV5c9JlEcGaKw4fA0gpDg2T3SdMSxIqUeKoZeisRpyGFa2WGEHOJPInhIOcZbjIxfoZfMVvDz0FrsM1qbMQ2Z+WXBIF7KYQmI1NQgSjhbouefrz3y+A== Received: from MW4P223CA0013.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::18) by SJ2PR12MB8158.namprd12.prod.outlook.com (2603:10b6:a03:4f7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Mon, 16 Jan 2023 15:13:05 +0000 Received: from CO1NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::4b) by MW4P223CA0013.outlook.office365.com (2603:10b6:303:80::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Mon, 16 Jan 2023 15:13:05 +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 CO1NAM11FT029.mail.protection.outlook.com (10.13.174.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Mon, 16 Jan 2023 15:13:05 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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; Mon, 16 Jan 2023 07:12:57 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 16 Jan 2023 07:12:56 -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; Mon, 16 Jan 2023 07:12:56 -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 30GFCsrH011565; Mon, 16 Jan 2023 17:12:54 +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 30GFCsRh004011; Mon, 16 Jan 2023 10:12:54 -0500 Received: (from jlanka@localhost) by bu-vnc02.mtbu.labs.mlnx (8.14.7/8.13.8/Submit) id 30GFCs9M000501; Mon, 16 Jan 2023 10:12:54 -0500 From: Jitendra Lanka To: Subject: [SRU][J:linux-bluefield][PATCH 1/1] UBUNTU: SAUCE: mlxbf-ptm: power and thermal management debugfs driver Date: Mon, 16 Jan 2023 10:12:51 -0500 Message-ID: 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: CO1NAM11FT029:EE_|SJ2PR12MB8158:EE_ X-MS-Office365-Filtering-Correlation-Id: afd90a9a-6085-41f2-9942-08daf7d42af2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zMBdFhRlGtLR0a99M0lbI3yCId9hKLW4pcavZffZH2vIQGaQS21MbRst6tumT7fGE1qhgFchURwFiy4ptj03cDYGTp+jI/Dl0dkdqsiSjb0tIIVNMj0N+sibE10rtSfebKKDwHlDOlTDCfXrngO2td9xFEtMuAfIUW5Lq5oMiel/CWaofdL/bOztrEcrzAK7Zxvu4MiFk2rvvHaQAI15u8eIrInxd8ATm/tw5UF1n9zgeG0uQFpfgeTCP8X8lEuROlt+4pjMKF2MgHaxm0WbaQM9oBREcDFxNB40zefcZjtK8Cu6LGC4E2wCQM6ATm0cCpIZT5SZdycmhpTfAz4csoTJyRSOhIHf68pvRHZIafK2bhbUhuCYvdy8csQjRe8REUY+wfcfPhiDi6UOY8l9KrffiHs8o70oogoULsyfGFMcklr5sZxQVn5vmflA3tzx/WDE4Sk3hZ//5rmwdNWllTmMrH0ogAwiR8mG01fRVqeh+EaY1Ivu2Up98YEc7th5I7V0UqXHUYLJFYyUV6l+aFeLBGkfXQIs9+/JFJa91fexquo743blNxsiIVJIpB5tLwJSQGKIYJXmAtXzFl1byMXYB0CE06s9xxWLr5yODDrNdfYsOdgKbOTyiAXfOTW0uGyqVMvM/rszwuv7yRMxH+dtAq2IaUn/PlCZDEgAEWbOPs0ESfU6djzBRLK/YGCRb6VY+ywMy9XKwOJAuWAqmqtec/hVY29hAUGPXnUfVnkKhrHruqvoQf9Sj/VUhIIYpS8C7IESPBlHmeoD90mWp4Yg9gVbTBAhFzYZI2IYoRo= 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)(396003)(376002)(39860400002)(346002)(451199015)(46966006)(36840700001)(40470700004)(36756003)(6916009)(82310400005)(186003)(4326008)(8676002)(26005)(70206006)(70586007)(2616005)(47076005)(42882007)(41300700001)(316002)(40480700001)(42186006)(54906003)(6666004)(478600001)(40460700003)(83170400001)(2906002)(966005)(7636003)(356005)(82740400003)(83380400001)(36860700001)(107886003)(5660300002)(8936002)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 15:13:05.1078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: afd90a9a-6085-41f2-9942-08daf7d42af2 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: CO1NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8158 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. Change-Id: I241e1406962548cef9b33c4b3dea925e675c3c88 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");