Polling Host state

Zehra Ozdemir zehra.ozdemir at inventron.com.tr
Sat Jul 15 02:01:32 AEST 2023


Hello to all,

When we try to shutdown the host over its operationg system, we saw that 
host-state-manager does not detect the pin signal and does not change 
the CurrentHostState property of xyz.openbmc_project.State.Host dbus 
interface. As far as we have looked through the source code of state 
manager, we have not been able to find a polling method for host state. 
There is just only one method called by scanGpioPin in 
host_condition_main.cpp which controls host pin signal by using 
gpio-line in dtb to write host's situation to CurrentFirmwareCondition 
value of xyz.openbmc_project.State.HostCondition.Gpio dbus interface. 
However, there is no polling to change host state for this 
CurrentFirmwareCondition value,  that can be triggered without using 
bmcweb or buttons .

Also there is obmc-op-control-power project to for polling pgood pin 
which is defined in  gpio_defs.json to  controls the pgood property of 
org.openbmc.control.Power interface for chassis-state-manager. If host 
is off, pgood is also 0. So we patched this project in poll_pgood method 
by using sd_bus methods of libsystemd-dev. When poll_pgood method 
detects pgood value as off, we control the the current state value of 
the host and if they are not parallel with each other, we set the host 
state and it seems to work correctly.

Could you please give us some information about if there is any proper 
implementation which we missed to detect host state by polling host pin 
signal or not?



More information about the openbmc mailing list