From patchwork Thu Jun 13 15:18:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Lanka X-Patchwork-Id: 1947464 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=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (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 4W0Qz86y26z1ydW for ; Fri, 14 Jun 2024 01:18:28 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sHmDS-0002lt-2j; Thu, 13 Jun 2024 15:18:18 +0000 Received: from xvfrnhpk.outbound-mail.sendgrid.net ([168.245.32.49]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sHmDR-0002lY-4V for kernel-team@lists.ubuntu.com; Thu, 13 Jun 2024 15:18:17 +0000 Received: by filterdrecv-587d9f8ffb-42sc2 with SMTP id filterdrecv-587d9f8ffb-42sc2-1-666B0DB7-D 2024-06-13 15:18:15.084305042 +0000 UTC m=+3861425.633827386 Received: from mtl123.mtl.labs.mlnx (unknown) by geopod-ismtpd-0 (SG) with ESMTP id NmLmbwuGQieFPUk4OMTS3A Thu, 13 Jun 2024 15:18:14.914 +0000 (UTC) Received: from mtbu-labmailer.labs.mlnx ([10.15.2.12]) by mtl123.mtl.labs.mlnx (8.14.4/8.14.4) with ESMTP id 45DFIDAU008385; Thu, 13 Jun 2024 18:18:13 +0300 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 45DFICHt015865; Thu, 13 Jun 2024 11:18:12 -0400 Received: (from jlanka@localhost) by bu-vnc02.mtbu.labs.mlnx (8.14.7/8.13.8/Submit) id 45DFIC0n002116; Thu, 13 Jun 2024 11:18:12 -0400 From: Jitendra Lanka Subject: [SRU][J:linux-bluefield][PATCH v1 1/1] UBUNTU: SAUCE: mlxbf-ptm: use single SMC for total power Date: Thu, 13 Jun 2024 15:18:15 +0000 (UTC) Message-Id: X-Mailer: git-send-email 2.30.1 In-Reply-To: References: MIME-Version: 1.0 X-SG-EID: u001.akKQIQDWM5U912AaLWjaiQ2YhnQFpL6RWq6J9XYTDnMI42u/zNoTYZN0MH7JxElYL4QyfN1zX/Jv2oTrX2Xb68TOE0Zaog76wV900YGWnl94So0TtOdkp7dTrXeUv1aTTDUbFuzUnKeUybHltlb856kPh7/VSJu7MxligCDVyLF+6tPV+OX03/rKy3+isJCEkqeE99hAEY35fyZpW2jTEe82tHLIV6xEolpzvbZlkuLA8UVR89X0kWKFtmFwnHkn To: kernel-team@lists.ubuntu.com X-Entity-ID: u001.9Nu+sJkq3f0LJ/tZbyfOWA== Received-SPF: pass client-ip=168.245.32.49; envelope-from=bounces+3445690-1bdd-kernel-team=lists.ubuntu.com@sendgridstats.nvidia.com; helo=xvfrnhpk.outbound-mail.sendgrid.net 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/2069303 update total power reporting to use a single secure monitor call Signed-off-by: Jitendra Lanka --- drivers/platform/mellanox/mlxbf-ptm.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/platform/mellanox/mlxbf-ptm.c b/drivers/platform/mellanox/mlxbf-ptm.c index 26f883bf71f3..ba8167c652a6 100644 --- a/drivers/platform/mellanox/mlxbf-ptm.c +++ b/drivers/platform/mellanox/mlxbf-ptm.c @@ -29,8 +29,7 @@ #define MLNX_PTM_GET_DDR_TTHROTTLE 0x8200010E #define MLNX_PTM_GET_DDR_TEMP_EVT_CTR 0x8200010F #define MLNX_PTM_GET_TEMP_ENVELOPE 0x82000110 - -#define MLNX_POWER_ERROR 300 +#define MLNX_PTM_GET_TOTAL_POWER 0x82000111 struct dentry *monitors; @@ -117,15 +116,7 @@ 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); + *val = smc_call0(MLNX_PTM_GET_TOTAL_POWER); return 0; }