Skip to content

Commit

Permalink
[syncd.sh] Clear semaphore before updating firmware (#15818) (#16067)
Browse files Browse the repository at this point in the history
  • Loading branch information
mssonicbld authored Aug 7, 2023
1 parent 30f935c commit 4ca01a7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions files/scripts/syncd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

. /usr/local/bin/syncd_common.sh

declare -r UNKN_MST="unknown"

function GetMstDevice() {
local _MST_DEVICE="$(ls /dev/mst/*_pci_cr0 2>&1)"

if [[ ! -c "${_MST_DEVICE}" ]]; then
echo "${UNKN_MST}"
else
echo "${_MST_DEVICE}"
fi
}

function startplatform() {

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

debug "Starting Firmware update procedure"
/usr/bin/mst start --with_i2cdev

local -r _MST_DEVICE="$(GetMstDevice)"
if [[ "${_MST_DEVICE}" != "${UNKN_MST}" ]]; then
/usr/bin/flint -d $_MST_DEVICE --clear_semaphore
fi

/usr/bin/mlnx-fw-upgrade.sh
/etc/init.d/sxdkernel restart
debug "Firmware update procedure ended"
Expand Down

0 comments on commit 4ca01a7

Please sign in to comment.