diff options
author | Raptor Engineering Development Team <support@raptorengineering.com> | 2018-05-13 00:28:33 -0500 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-04-25 08:02:01 +0000 |
commit | 3ee9821df9b71a27cbd59917886946a734783ca5 (patch) | |
tree | 239010b3016348f80eafdfaa178cb8e92d186308 | |
parent | 9a3cb8f25bd0af6684f0d595b1a96da88e5b7574 (diff) | |
download | talos-openbmc-3ee9821df9b71a27cbd59917886946a734783ca5.tar.gz talos-openbmc-3ee9821df9b71a27cbd59917886946a734783ca5.zip |
Attempt to detect host power down if watchdog fails
-rwxr-xr-x | meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh index 1a7b19b14..f378b566b 100755 --- a/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh +++ b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh @@ -70,6 +70,11 @@ if [ "$1" == "watchdog" ]; then while [ 1 == 1 ]; do sleep 5 + if [ ! -e /run/openbmc/host@0-ipl-complete ]; then + echo "Exiting due to missing IPL complete flag file" + exit 0 + fi + OCC_FAULT=0 if [ ! -e /sys/bus/platform/drivers/occ/sbefifo1-dev0/occ1-dev0/occ_error ]; then OCC_FAULT=1 @@ -95,22 +100,35 @@ if [ "$1" == "watchdog" ]; then busctl tree $OCC_CONTROL_SERVICE --list | grep occ | xargs -r -n1 -I{} \ busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \ OccActive b 'false' + # Give enough time for the OCC control service to attempt unload before forcible unbind sleep 5 + # Unbind all OCC drivers echo occ1-dev0 > /sys/bus/platform/drivers/occ-hwmon/unbind || true echo occ2-dev0 > /sys/bus/platform/drivers/occ-hwmon/unbind || true echo sbefifo1-dev0 > /sys/bus/platform/drivers/occ/unbind || true echo sbefifo2-dev0 > /sys/bus/platform/drivers/occ/unbind || true + # Wait 10 seconds for OCC to figure out something has happened / bus contention to stop sleep 10 + + # Make sure system hasn't gone down in the interim + if [ ! -e /run/openbmc/host@0-ipl-complete ]; then + echo "Exiting due to missing IPL complete flag file" + exit 0 + fi + openpower-proc-control scanFSI + # Re-enable OCC service busctl tree $OCC_CONTROL_SERVICE --list | grep occ | xargs -r -n1 -I{} \ busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \ OccActive b 'true' + # Give the OCC service time to start sleep 5 + # Restart fan controller systemctl restart phosphor-fan-control@0.service fi |