sonic-buildimage/platform/mellanox/hw-management/0002-Disable-hw-mgmt-on-SimX-platforms.patch

82 lines
1.9 KiB
Diff
Raw Normal View History

From 79dadd5b0d2f5e860b525c12d4d3843607b03a9f Mon Sep 17 00:00:00 2001
From: Alexander Allen <arallen@nvidia.com>
Date: Fri, 21 Jan 2022 16:47:19 +0000
Subject: [PATCH] Disable hw-mgmt on SimX platforms
---
usr/usr/bin/hw-management-ready.sh | 31 ++++++++++++++++--------------
usr/usr/bin/hw-management.sh | 9 +++++++++
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/usr/usr/bin/hw-management-ready.sh b/usr/usr/bin/hw-management-ready.sh
index 5a9698c..364f906 100755
--- a/usr/usr/bin/hw-management-ready.sh
+++ b/usr/usr/bin/hw-management-ready.sh
@@ -51,19 +51,22 @@ if [ -d /var/run/hw-management ]; then
rm -fr /var/run/hw-management
fi
-case $board_type in
-VMOD0014)
- while [ ! -d /sys/devices/pci0000:00/0000:00:1f.0/NVSN2201:00/mlxreg-hotplug/hwmon ]
- do
- sleep 1
- done
- ;;
-*)
- while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ]
- do
- sleep 1
- done
- ;;
-esac
+if [ -z "$(lspci -vvv | grep SimX)" ]; then
+ case $board_type in
+ VMOD0014)
+ while [ ! -d /sys/devices/pci0000:00/0000:00:1f.0/NVSN2201:00/mlxreg-hotplug/hwmon ]
+ do
+ sleep 1
+ done
+ ;;
+ *)
+ while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ]
+ do
+ sleep 1
+ done
+ ;;
+ esac
+fi
+
echo "Start Chassis HW management service."
logger -t hw-management -p daemon.notice "Start Chassis HW management service."
diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh
index ebfabb0..c0c038e 100755
--- a/usr/usr/bin/hw-management.sh
+++ b/usr/usr/bin/hw-management.sh
@@ -1495,6 +1495,13 @@ do_chip_down()
/usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p
}
+check_simx()
+{
+ if [ -n "$(lspci -vvv | grep SimX)" ]; then
+ exit 0
+ fi
+}
+
__usage="
Usage: $(basename "$0") [Options]
@@ -1520,6 +1527,8 @@ Options:
force-reload Performs hw-management 'stop' and the 'start.
"
+check_simx
+
case $ACTION in
start)
if [ -d /var/run/hw-management ]; then
--
2.17.1