how softpoweroff works for openbmc

Lei YU mine260309 at
Fri Feb 14 13:40:11 AEDT 2020

I had a summary of how the soft-off works, please see below.


On OpenPOWER systems, the soft-off is implemented by
phosphor-softpoweroff in phosphor-host-ipmid/softoff.
The whole steps are described as below:

1. To power off the host gracefully, BMC sets  RequestedHostTransition
to Off implemented by phosphor-host-state-manager.
2. phosphor-host-state-manager starts obmc-host-shutdown at
3. The target depends on
xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service, and it comes
to phosphor-softpoweroff.
4. phosphor-softpoweroff invokes sendHostShutDownCmd(), that calls the
"Execute" method of "xyz.openbmc_project.Control.Host".
5. The host control service (implemented in host-cmd-manager.cpp) puts
the command in a queue and invokes checkQueueAndAlertHost(), which
invokes "setAttention" method of "org.openbmc.HostIpmi".
6. btbridged implements setAttention(), and it sends SMS ATN message
to host via IPMI BT.
7. Then the Host received the attention, so it reads messages from BMC.
8. BMC's ipmid's ipmi_app_read_event() is invoked, and the queued SOFT
OFF command is sent to the Host, and sends a CommandComplete signal on
9. phosphor-softpoweroff registers the signal, so the callback
hostControlEvent() is invoked, which starts a timer (configurable by
   When it times out, the BMC will shutdown the chassis power.
10. When the Host OS is shutdown, it sends the chassis control's
CMD_POWER_OFF message via IPMI.
11. The ipmid invokes stop_soft_off_timer(),and sets the property
"ResponseReceived" to "SoftPowerOff.HostResponse.HostShutdown".
12. In phosphor-softpoweroff, responseReceived() is invoked, stops the
timer, and the process exits normally.
13. Then systemd will execute the other dependent
obmc-chassis-poweroff at .target, which shutdowns the chassis power.

On Thu, Feb 13, 2020 at 11:20 PM 南野ムルシエラゴ <1181052146 at> wrote:
> Greetings:
> I am learning how power control works in openbmc system. It comes to poweroff sequence. I found that for poweroff there are "poweroff" and "softpoweroff".
> 1. for "poweroff", I found the call path:
> ipmiChassisControl()             //phosphor-host-ipmid
> initiate_state_transition()
> ...
> d-bus
> ...
> requestedHostTransition()   //phosphor-state-manager
> ...
> dbus
> ...
> on_set_power_state()            //skeleton
> and finally write some gpio pin to power down.
> 2. for "softpoweroff", I found the call path:
> ipmiChassisControl()             //phosphor-host-ipmid
> stop_soft_off_timer()
> sendHostShutDownCmd()
> ipmid_send_cmd_to_host()
> checkQueueAndAlertHost()
> ...
> d-bus(setAttention)
> ...
> method_send_sms_atn()      //btbridge
> and finally send some message to host via BT, or in case of KCS via KCS.
> My question is:
> 1. In case of softpoweroff I found in code that the openbmc system just send setAttention to host and return? Does that mean letting the host system to powerdown and openbmc system does not write any power related gpio anymore?
> 2. If host system can handle the softpoweroff request sent by openbmc, How can host system handle it? I know there is a module called ipmi_si.ko which may communicate with openbmc. But I do not find and code in ipmi_si related with softpoweroff, or any other module in host system to control softpoweroff?
> 3. I am a learner of openbmc, I know there must be errors in my mail.
> Can anyone help tell me?
> Best Regards!
> Liu Hongwei

More information about the openbmc mailing list