From 6f9e50b75a4c605552252ed5d113756b51b7a51a Mon Sep 17 00:00:00 2001 From: Raptor Engineering Development Team Date: Sun, 21 Jan 2018 21:15:13 -0600 Subject: Restart OCC service before restarting fan controller This fixes fan control failing on boot due to offline OCC services --- .../occ/openpower-occ-control/occ-active.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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 c4c791f85..9e4c4bec2 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 @@ -19,11 +19,14 @@ OCC_CONTROL_SERVICE="org.open_power.OCC.Control" if [ "$value" == "true" ]; then # Rescan bus to find OCCs openpower-proc-control scanFSI + # Wait 5 seconds before restarting fan controller + sleep 5 + systemctl restart phosphor-fan-control@0.service fi 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 $value + busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \ + OccActive b $value if [ "$1" == "watchdog" ]; then # Start watchdog @@ -31,7 +34,19 @@ if [ "$1" == "watchdog" ]; then sleep 5 if [ ! -e /sys/bus/platform/drivers/occ/sbefifo1-dev0/occ1-dev0/occ_status ]; then # OCC driver failed. Rescan bus to recover. + # Disable existing 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 'false' + # Wait 10 seconds for OCC to figure out something has happened / bus contention to stop + sleep 10 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' + # Restart fan controller + systemctl restart phosphor-fan-control@0.service fi done fi -- cgit v1.2.1