Skip to content

Commit 9fba98c

Browse files
[syncd.sh] Clear semaphore before updating firmware (#15818)
Why I did it The hw resources should be released before updating firmware. How I did it Added logic to release hw resources in syncd.sh script Signed-off-by: Vadym Hlushko <[email protected]>
1 parent 642350c commit 9fba98c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

files/scripts/syncd.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
. /usr/local/bin/syncd_common.sh
44

5+
declare -r UNKN_MST="unknown"
6+
7+
function GetMstDevice() {
8+
local _MST_DEVICE="$(ls /dev/mst/*_pci_cr0 2>&1)"
9+
10+
if [[ ! -c "${_MST_DEVICE}" ]]; then
11+
echo "${UNKN_MST}"
12+
else
13+
echo "${_MST_DEVICE}"
14+
fi
15+
}
16+
517
function startplatform() {
618

719
# platform specific tasks
@@ -23,6 +35,12 @@ function startplatform() {
2335

2436
debug "Starting Firmware update procedure"
2537
/usr/bin/mst start --with_i2cdev
38+
39+
local -r _MST_DEVICE="$(GetMstDevice)"
40+
if [[ "${_MST_DEVICE}" != "${UNKN_MST}" ]]; then
41+
/usr/bin/flint -d $_MST_DEVICE --clear_semaphore
42+
fi
43+
2644
/usr/bin/mlnx-fw-upgrade.sh
2745
/etc/init.d/sxdkernel restart
2846
debug "Firmware update procedure ended"

0 commit comments

Comments
 (0)