use-reset: listen to the chassis signal instead of host
Inherited from the dbus-sensors, the `powerMatch` for PowerState::on was
incorrectly pointed to the Host status.
That is a mismatch for the definition of x86-power-control:
https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L515-L537
More specifically, `PowerState::checkForWarmReset` should be considered
as part of PowerState::On, instead of PowerState::Off.
The ChassisState of x86-power-control is more close to reflect the
desired hardware signal (PowerOk signal).
https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L538-L559
The only delta is the `waitForSIOPowerGood` which is still considered as
Chassis.PowerState.Off, which happens after the `Event::powerOKAssert`.
https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L1781
However, the SIO is not enabled on the target platform
Google-Bug-Id: 316465377
Tested: tested against a warmreboot machine and confirmed no usb reset
Change-Id: If441bdfb79f5262bbbc60235f3447ab3e0aae816
Signed-off-by: Hao Jiang <jianghao@google.com>
diff --git a/usb_reset/main.cpp b/usb_reset/main.cpp
index e14129d..d3ad2a6 100644
--- a/usb_reset/main.cpp
+++ b/usb_reset/main.cpp
@@ -138,7 +138,7 @@
auto getter = std::make_shared<GetSensorConfiguration>(
bus, [](const ManagedObjectType &configurations)
{
- if (!readingStateGood(PowerState::on))
+ if (!readingStateGood(PowerState::chassisOn))
{
return;
}
@@ -179,12 +179,12 @@
[[maybe_unused]] auto powerCb =
setupPowerMatchCallback(systemBus, [&](PowerState type, bool state) {
- if (type != PowerState::on)
+ if (type != PowerState::chassisOn)
{
return;
}
- // clear the initSet when the Host power is done
+ // clear the initSet when the PowerState of the Host transit to off
if (!state)
{
initSet.clear();