-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mellanox] Add hw-mgmt patch for SimX platform adaptation (#6782)
- Why I did it System is stuck on 'starting' state on SimX platform because of infinite loop on 'hw-management-ready.sh' script . The loop is polling to check if the hw-mgmt sysfs created before proceeding with the flow, for SimX platform the sysfs will never create so the system is not starting properly. - How I did it Add a condition to poll on hw-mgmt sysfs only if the switch is real HW and not SimX platform. - How to verify it Check "systemctl status hw-management.service" output on a SimX switch with this patch, the state will be "active". Signed-off-by: Shlomi Bitton <[email protected]>
- Loading branch information
1 parent
5aee92e
commit 3de6a67
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
platform/mellanox/hw-management/0003-Make-hw-mgmt-SimX-compatiable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/usr/usr/bin/hw-management-ready.sh b/usr/usr/bin/hw-management-ready.sh | ||
index 3c9f7b6..05d143f 100755 | ||
--- a/usr/usr/bin/hw-management-ready.sh | ||
+++ b/usr/usr/bin/hw-management-ready.sh | ||
@@ -49,9 +49,12 @@ if [ -d /var/run/hw-management ]; then | ||
rm -fr /var/run/hw-management | ||
fi | ||
|
||
-while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] | ||
-do | ||
- sleep 1 | ||
-done | ||
+if [ -z "$(lspci -vvv | grep SimX)" ]; then | ||
+ while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] | ||
+ do | ||
+ sleep 1 | ||
+ done | ||
+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 70f1297..e427a3d 100755 | ||
--- a/usr/usr/bin/hw-management.sh | ||
+++ b/usr/usr/bin/hw-management.sh | ||
@@ -1110,6 +1110,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] | ||
|
||
@@ -1135,6 +1142,8 @@ Options: | ||
force-reload Performs hw-management 'stop' and the 'start. | ||
" | ||
|
||
+check_simx | ||
+ | ||
case $ACTION in | ||
start) | ||
if [ -d /var/run/hw-management ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters