summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/fans
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2017-05-16 10:49:57 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-05-22 23:13:35 +0000
commitbde651bb18ca73fd6240ae0400f016c76c547a45 (patch)
tree58d425f78224e742cc39854fd3d86533169f5573 /meta-phosphor/common/recipes-phosphor/fans
parent6a3b4bef5ebb5e32d0bdca2405eb56ea9056c9c2 (diff)
downloadtalos-openbmc-bde651bb18ca73fd6240ae0400f016c76c547a45.tar.gz
talos-openbmc-bde651bb18ca73fd6240ae0400f016c76c547a45.zip
Make use of obmc-fan-control-ready@.target
This involves the following: * Start the fan-control-init@.service on a power on. * That service will set fans to full speed, delay for a bit, and then start the obmc-fan-control-ready target. * This target will start the fan monitor and real fan control services. * On a power off, the target and these services will be deactivated. Doing it this way ensures the fans will have had time to ramp up from a cold start before applications start looking at them. Currently, on a reboot at runtime the same thing will occur. The watchdog would have already brought the fans to high speed, so this will extend that time at full speed by another 20 (or similar, it's configurable) seconds, ensuring we know what speed the fans are at. Resolves openbmc/openbmc#1567 Change-Id: I73a1f91f0efaf319df97b59334073116d45f40c3 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/fans')
-rw-r--r--meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb17
-rw-r--r--meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service12
-rw-r--r--meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service6
-rw-r--r--meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service6
4 files changed, 29 insertions, 12 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb
index 19eb4db0a..f0514040e 100644
--- a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb
+++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb
@@ -46,8 +46,8 @@ RDEPENDS_${PN}-presence-tach += "sdbusplus"
# Needed to install into the obmc-chassis-poweron target
TMPL_TACH = "phosphor-fan-presence-tach@.service"
INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
-TGTFMT = "obmc-chassis-poweron@{0}.target"
-FMT_TACH = "../${TMPL_TACH}:${TGTFMT}.requires/${INSTFMT_TACH}"
+POWERON_TGT = "obmc-chassis-poweron@{0}.target"
+FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
FILES_${PN}-presence-tach = "${sbindir}/phosphor-fan-presence-tach"
SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}"
@@ -67,13 +67,20 @@ PACKAGECONFIG[control] = "--enable-control \
RDEPENDS_${PN}-control += "sdbusplus"
+FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
+
TMPL_CONTROL = "phosphor-fan-control@.service"
INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
-FMT_CONTROL = "../${TMPL_CONTROL}:${TGTFMT}.requires/${INSTFMT_CONTROL}"
+FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
+
+TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
+INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
+FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.requires/${INSTFMT_CONTROL_INIT}"
FILES_${PN}-control = "${sbindir}/phosphor-fan-control"
-SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL}"
+SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
# --------------------------------------
# phosphor-chassis-cooling-type specific configuration
@@ -95,7 +102,7 @@ RDEPENDS_${PN}-monitor += "sdbusplus"
TMPL_MONITOR = "phosphor-fan-monitor@.service"
INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
-FMT_MONITOR = "../${TMPL_MONITOR}:${TGTFMT}.requires/${INSTFMT_MONITOR}"
+FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor"
SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR}"
diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service
new file mode 100644
index 000000000..96e4ef7ec
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor Fan Control Initialization
+Wants=obmc-power-on@%i.target
+After=obmc-power-on@%i.target
+Conflicts=obmc-chassis-poweroff@%i.target
+
+[Service]
+Restart=on-failure
+ExecStart={sbindir}/phosphor-fan-control --init
+
+[Install]
+RequiredBy=obmc-chassis-poweron@%i.target
diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service
index 568ff1e11..773e59ecf 100644
--- a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service
+++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service
@@ -1,12 +1,10 @@
[Unit]
Description=Phosphor Fan Control Daemon
-Wants=obmc-power-on@%i.target
-After=obmc-power-on@%i.target
Conflicts=obmc-chassis-poweroff@%i.target
[Service]
Restart=on-failure
-ExecStart={sbindir}/phosphor-fan-control
+ExecStart={sbindir}/phosphor-fan-control --control
[Install]
-RequiredBy=obmc-chassis-poweron@%i.target
+RequiredBy=obmc-fan-control-ready@%i.target
diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service
index 57b01c7aa..39faf4fe5 100644
--- a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service
+++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service
@@ -1,7 +1,7 @@
[Unit]
Description=Phosphor Fan Monitor Daemon
-Wants=obmc-power-on@%i.target
-After=obmc-power-on@%i.target
+Wants=phosphor-fan-control@%i.service
+Before=phosphor-fan-control@%i.service
Conflicts=obmc-chassis-poweroff@%i.target
[Service]
@@ -9,4 +9,4 @@ Restart=on-failure
ExecStart={sbindir}/phosphor-fan-monitor
[Install]
-RequiredBy=obmc-chassis-poweron@%i.target
+RequiredBy=obmc-fan-control-ready@%i.target
OpenPOWER on IntegriCloud