From fbd986616964f67f7d2aaf9b73f8305fa8355257 Mon Sep 17 00:00:00 2001 From: Raptor Engineering Development Team Date: Sat, 14 Apr 2018 21:46:35 -0500 Subject: Enhance OCC communication failure error recovery --- .../occ/openpower-occ-control/occ-active.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh index 08d1813bd..9be4e807e 100755 --- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/occ-active.sh @@ -49,6 +49,12 @@ if [ "$value" == "true" ]; then # Wait 5 seconds before restarting fan controller sleep 5 systemctl restart phosphor-fan-control@0.service +else + # Unbind all OCC drivers to avoid bus contention on next IPL + 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 fi if [ "$1" == "watchdog" ]; then @@ -81,6 +87,13 @@ 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 openpower-proc-control scanFSI -- cgit v1.2.1