<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi,</p>
<p>We have chassis power policy that users configure so that the
Host power can be recovered via the setting. In
phosphor-state-manager, there is
<a class="moz-txt-link-abbreviated" href="mailto:phosphor-discover-system-state@.service">phosphor-discover-system-state@.service</a> service to check the power
restore policy and recover the Host via the policy users
configured (always-on, always-off, previous). The problem is that
when BMC is rebooted, the service should not be executed as Host
power status should not be changed in this case.<br>
</p>
<p>Previously, we added a patch in u-boot to add reboot cause to the
command line, like:</p>
<blockquote>
<p># cat /proc/cmdline<br>
console=ttyS4,115200n8 root=/dev/ram rw resetreason=power</p>
</blockquote>
<p>Then, add condition to the service to just execute when
resetreason=power:</p>
<blockquote>
<p>[Unit]<br>
ConditionKernelCommandLine=resetreason=power</p>
</blockquote>
<p>as now no u-boot patch inside meta-<vendor> is permitted,
this approach is no longer applicable.</p>
<p>Since the BMC reboot cause feature by Tim Lee at
<a class="moz-txt-link-freetext" href="https://github.com/openbmc/phosphor-state-manager/commit/2bfb1efc4bc7e781224e19c05b51e6675f13a488">https://github.com/openbmc/phosphor-state-manager/commit/2bfb1efc4bc7e781224e19c05b51e6675f13a488</a>
and with the watchdog driver support, we have the reset cause
information via both dbus and kernel /sys:</p>
<blockquote>
<p># cat /sys/class/watchdog/watchdog0/bootstatus<br>
32</p>
<p># busctl get-property xyz.openbmc_project.State.BMC
/xyz/openbmc_project/state/bmc0 xyz.openbmc_project.State.BMC
LastRebootCause</p>
<p>s "xyz.openbmc_project.State.BMC.RebootCause.POR"</p>
</blockquote>
<p>I would like to check if you have any idea on how to use the
above information to prevent the power restore policy executed in
case of BMC reboot.</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Thang Q. Nguyen <br>
</p>
</body>
</html>