summaryrefslogtreecommitdiffstats
path: root/meta-openpower
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-01-21 21:15:13 -0600
committerTimothy Pearson <tpearson@raptorengineering.com>2019-04-25 08:01:52 +0000
commite7670708696244c69cde1f5890580807c34fb248 (patch)
tree139cb93ec856d4ad937dd44ec9ccea9ccb765e1c /meta-openpower
parent86fd528d9354efc5a161ccf3535cf0dc7ef05634 (diff)
downloadtalos-openbmc-e7670708696244c69cde1f5890580807c34fb248.tar.gz
talos-openbmc-e7670708696244c69cde1f5890580807c34fb248.zip
Restart OCC service before restarting fan controller
This fixes fan control failing on boot due to offline OCC services
Diffstat (limited to 'meta-openpower')
-rwxr-xr-xmeta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh19
1 files changed, 17 insertions, 2 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 c4c791f85..9e4c4bec2 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
@@ -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
OpenPOWER on IntegriCloud