regulators: Host reboot should not redo operations
While powering on the host, a "warm reboot" of the host may occur one or
more times. For example, the host boot process may update hardware in a
way that requires a host reboot.
During a "warm reboot" of the host, power to the chassis remains on. As
a result, the following regulator operations should *not* be performed:
* Configuring the regulators again.
* Disabling and then re-enabling regulator monitoring for sensors and
redundant phase faults.
Modify several regulator systemd service files so that those regulator
operations are not performed during a "warm reboot" of the host.
Test Plan:
* https://gist.github.com/smccarney/c2eea054b7439b84b55f4fb89f474413
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I5e4c97168f0f7cdd5d7d6bfed227c5769a86d5a8
diff --git a/services/phosphor-regulators-config.service b/services/phosphor-regulators-config.service
index 3da3cd6..8ef5763 100644
--- a/services/phosphor-regulators-config.service
+++ b/services/phosphor-regulators-config.service
@@ -6,11 +6,12 @@
Before=obmc-power-start-pre@0.target
Before=op-power-start@0.service
Conflicts=obmc-chassis-poweroff@0.target
-# No need to run again if BMC reboots at runtime
+# Should not run again if BMC reboots while host is running
ConditionPathExists=!/run/openbmc/chassis@0-on
[Service]
Type=oneshot
+RemainAfterExit=yes
ExecStart=/usr/bin/regsctl config
[Install]
diff --git a/services/phosphor-regulators-monitor-disable.service b/services/phosphor-regulators-monitor-disable.service
index cf8e750..a108548 100644
--- a/services/phosphor-regulators-monitor-disable.service
+++ b/services/phosphor-regulators-monitor-disable.service
@@ -2,9 +2,9 @@
Description=Phosphor Power Regulators Disable Monitoring
Requires=phosphor-regulators.service
After=phosphor-regulators.service
-Wants=obmc-host-stop-pre@0.target
-Before=obmc-host-stop-pre@0.target
-Conflicts=phosphor-regulators-monitor-enable.service
+Wants=obmc-power-stop-pre@0.target
+Before=obmc-power-stop-pre@0.target
+Conflicts=obmc-chassis-poweron@0.target
[Service]
Type=oneshot
@@ -12,4 +12,4 @@
ExecStart=/usr/bin/regsctl monitor --disable
[Install]
-WantedBy=obmc-host-stop@0.target
+WantedBy=obmc-chassis-poweroff@0.target
diff --git a/services/phosphor-regulators-monitor-enable.service b/services/phosphor-regulators-monitor-enable.service
index 033ebea..8173557 100644
--- a/services/phosphor-regulators-monitor-enable.service
+++ b/services/phosphor-regulators-monitor-enable.service
@@ -7,6 +7,7 @@
Conflicts=obmc-chassis-poweroff@0.target
[Service]
+Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/regsctl monitor --enable