[SRU][J:linux-bluefield][PATCH v1 1/5] Revert "UBUNTU: SAUCE: mlxbf-bootctl supports RTC battery status read and clear"

David Thompson davthompson at nvidia.com
Fri May 2 18:41:57 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2109804

This reverts commit 68b117753ed5ebf49b0fc4a8a69be49aed2abc05.

Signed-off-by: David Thompson <davthompson at nvidia.com>
Reviewed-by: Shravan Kumar Ramani <shravankr at nvidia.com>
---
 drivers/platform/mellanox/mlxbf-bootctl.c | 20 --------------------
 drivers/platform/mellanox/mlxbf-bootctl.h |  5 -----
 2 files changed, 25 deletions(-)

diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c
index 4a1f1a0e48b5..99924b0b149f 100644
--- a/drivers/platform/mellanox/mlxbf-bootctl.c
+++ b/drivers/platform/mellanox/mlxbf-bootctl.c
@@ -253,7 +253,6 @@ static const char * const mlxbf_rsh_log_level[] = {
 static DEFINE_MUTEX(icm_ops_lock);
 static DEFINE_MUTEX(os_up_lock);
 static DEFINE_MUTEX(mfg_ops_lock);
-static DEFINE_MUTEX(rtc_ops_lock);
 
 /*
  * Objects are stored within the MFG partition per type.
@@ -652,23 +651,6 @@ static ssize_t large_icm_store(struct device *dev,
 	return res.a0 ? -EPERM : count;
 }
 
-static ssize_t rtc_battery_show(struct device *dev,
-			       struct device_attribute *attr,
-			       char *buf)
-{
-	struct arm_smccc_res res;
-
-	mutex_lock(&rtc_ops_lock);
-	arm_smccc_smc(MLNX_HANDLE_GET_RTC_LOW_BATT, 0, 0, 0, 0,
-		      0, 0, 0, &res);
-	mutex_unlock(&rtc_ops_lock);
-
-	if (res.a0)
-		return -EPERM;
-
-	return snprintf(buf, PAGE_SIZE, "0x%lx", res.a1);
-}
-
 static ssize_t os_up_store(struct device *dev,
 			   struct device_attribute *attr,
 			   const char *buf, size_t count)
@@ -1271,7 +1253,6 @@ static DEVICE_ATTR_RW(sn);
 static DEVICE_ATTR_RW(uuid);
 static DEVICE_ATTR_RW(rev);
 static DEVICE_ATTR_WO(mfg_lock);
-static DEVICE_ATTR_RO(rtc_battery);
 
 static struct attribute *mlxbf_bootctl_attrs[] = {
 	&dev_attr_post_reset_wdog.attr,
@@ -1291,7 +1272,6 @@ static struct attribute *mlxbf_bootctl_attrs[] = {
 	&dev_attr_uuid.attr,
 	&dev_attr_rev.attr,
 	&dev_attr_mfg_lock.attr,
-	&dev_attr_rtc_battery.attr,
 	NULL
 };
 
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.h b/drivers/platform/mellanox/mlxbf-bootctl.h
index 1207e638180e..1299750a8661 100644
--- a/drivers/platform/mellanox/mlxbf-bootctl.h
+++ b/drivers/platform/mellanox/mlxbf-bootctl.h
@@ -103,11 +103,6 @@
  */
 #define MLNX_HANDLE_OS_UP    0x82000014
 
-/*
- * SMC function ID to get and clear the RTC low voltage bit
- */
-#define MLNX_HANDLE_GET_RTC_LOW_BATT	0x82000023
-
 /* SMC function IDs for SiP Service queries */
 #define MLXBF_BOOTCTL_SIP_SVC_CALL_COUNT	0x8200ff00
 #define MLXBF_BOOTCTL_SIP_SVC_UID		0x8200ff01
-- 
2.43.2




More information about the kernel-team mailing list