From 9b655b1942a438b6df33f9104cebca3685db5557 Mon Sep 17 00:00:00 2001 From: Mykola Faryma Date: Fri, 9 Aug 2019 14:57:58 +0300 Subject: [PATCH 1/3] [Mellanox] allign platform_reboot to use "hardware reboot" Signed-off-by: Mykola Faryma --- device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot index 58ead6402398..c9b543e2ac3f 100755 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot @@ -20,7 +20,7 @@ function ParseArguments() { ParseArguments "$@" -${FW_UPGRADE_SCRIPT} --upgrade +${FW_UPGRADE_SCRIPT} --upgrade --verbose EXIT_CODE="$?" if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then echo "Failed to burn MLNX FW: errno=${EXIT_CODE}" @@ -31,4 +31,6 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then fi fi -exec /sbin/reboot $@ +echo 1 > /bsp/system/pwr_cycle +sleep 3 +echo 0 > /bsp/system/pwr_cycle From c1d5e4b5711ffe79f40662e1e622540bec1a65c2 Mon Sep 17 00:00:00 2001 From: Mykola Faryma Date: Tue, 13 Aug 2019 16:07:22 +0300 Subject: [PATCH 2/3] use sysfs path instead of bsp symlink Signed-off-by: Mykola Faryma --- device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot index c9b543e2ac3f..bb635db2eed0 100755 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot @@ -4,6 +4,7 @@ declare -r EXIT_SUCCESS="0" declare -r EXIT_ERROR="1" declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh" +declare -r SYSFS_PWR_CYCLE="/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon1/pwr_cycle" FORCE_REBOOT="no" @@ -31,6 +32,6 @@ if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then fi fi -echo 1 > /bsp/system/pwr_cycle +echo 1 > $SYSFS_PWR_CYCLE sleep 3 -echo 0 > /bsp/system/pwr_cycle +echo 0 > $SYSFS_PWR_CYCLE From 7f69dc2d9858870a34547f82cf98356a2f02db06 Mon Sep 17 00:00:00 2001 From: Mykola F <37578614+mykolaf@users.noreply.github.com> Date: Thu, 15 Aug 2019 16:15:53 +0300 Subject: [PATCH 3/3] use an asterisk --- device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot index bb635db2eed0..6e02d011f82d 100755 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot @@ -4,7 +4,7 @@ declare -r EXIT_SUCCESS="0" declare -r EXIT_ERROR="1" declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh" -declare -r SYSFS_PWR_CYCLE="/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon1/pwr_cycle" +declare -r SYSFS_PWR_CYCLE="/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/pwr_cycle" FORCE_REBOOT="no"