ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

eBMC State Management - Timed Power On #869

Closed geissonator closed 3 years ago

geissonator commented 5 years ago

Need PLDM message defined for host to call and code on OpenBMC side to support it..

vishwabmc commented 5 years ago

Went through the existing implementation and had the discussion with Paul on the PHYP time management algorithm. We don't have the legacy RTIM implementation for time keeping now so need to get onto the new xyz/openbmc_project/Time.

Since we are dealing with Host Time here, we need to use xyz/openbmc_project/time/host/


The implementation MUST cater to these:

My current approach to this is ( good path ):

The new standalone daemon:

[-] Case 1

[-] Case 2:

[-] Case 3:

vishwabmc commented 5 years ago

In discussion with PLDM folks, sending the "seconds since epoch" from PHYP is still possible and would be part of a PLDM numeric effector.. But such a code does not exist today and we need to implement.

@mine260309 is this something that your team would be interested in ?

mine260309 commented 5 years ago

@vishwabmc Yes. However, it requires the hardware which is not available yet, so we could not really work on this task for now.

vishwabmc commented 5 years ago

Some reference materials for PLDM / MCTP:

https://github.com/openbmc/libmctp https://github.com/openbmc/pldm

vishwabmc commented 5 years ago

Could break each one of these into multiple stories:

mine260309 commented 4 years ago

Based on @vishwabmc 's detailed description, the tasks are divided into two parts:

Several questions to @vishwabmc:

  1. Should the TPO feature has a setting to enable/disable (e.g. in /xyz/openbmc_project/settings)? E.g. when it is disabled, the daemon will report error on setting TPO timer, and getting the TPO timer will return 0;
  2. If the above answer is yes, will the host be able to set the above setting? E.g. host could first enable the TPO and then set the TPO timer, both via PLDM.
  3. When the TPO is enabled and the timer is set, and when the time is going to fire, what should BMC do if BMC is not ready to boot host? E.g. when TPO is going to boot host at 9:00 am, and BMC is rebooted during this period, should BMC boot host after it goes to ready state (e.g. at 9:02 am)?
vishwabmc commented 4 years ago

Several questions to @vishwabmc:

1. Should the TPO feature has a setting to enable/disable (e.g. in `/xyz/openbmc_project/settings`)?
   E.g. when it is disabled, the daemon will report error on setting TPO timer, and getting the TPO timer will return 0;
2. If the above answer is yes, will the host be able to set the above setting?
   E.g. host could first enable the TPO and then set the TPO timer, both via PLDM.
3. When the TPO is enabled and the timer is set, and when the time is going to fire, what should BMC do if BMC is not ready to boot host?

   E.g. when TPO is going to boot host at 9:00 am, and BMC is rebooted during this period, should BMC boot host after it goes to ready state (e.g. at 9:02 am)?
vishwabmc commented 4 years ago

The first thing is to have the PLDM back-end ready to carry the policy and the time since epoch We would also need to have a PLDM response indicating the SUCCESS or FAILURE ( with corresponding integer return codes )

mine260309 commented 4 years ago

Since this being a feature used by host, it may not be a user settable entity. Is there a way we can gate the external writes to this and allow internal writes only ?

What do you mean by "internal writes"? Do you mean this setting is not settable by BMC's sysadmin , but only by Host firmware?

Irrespective of a setting in /xyz, host should be able to send a command to enable / disable. So this is anyway needed

The reason why I ask if there should be such a setting is because host is able to set the TPO without enable/disable setting. E.g.

Do we really need a separated setting for the feature's enable/disable state? Especially you mentioned that the setting is only set internally (which I interpret as Host firmware could enable/disable it)

Correct. BMC needs to check if there was a TPO that had to be serviced and do so.

OK, sounds reasonable.

vishwabmc commented 4 years ago

Since this being a feature used by host, it may not be a user settable entity. Is there a way we can gate the external writes to this and allow internal writes only ?

What do you mean by "internal writes"? Do you mean this setting is not settable by BMC's sysadmin , but only by Host firmware?

Correct. This is an InBand mechanism only. So nothing needed in /xyz/openbmc

Irrespective of a setting in /xyz, host should be able to send a command to enable / disable. So this is anyway needed

The reason why I ask if there should be such a setting is because host is able to set the TPO without enable/disable setting. E.g.

* Host sets TPO to 0 indicates that TPO is disabled;

* Host set TOP to a valid date indicates that TPO is enabled and the timer is set

I agree with this. A value of [0] indicates no TPO.

Do we really need a separated setting for the feature's enable/disable state? Especially you mentioned that the setting is only set internally (which I interpret as Host firmware could enable/disable it)

Correct. BMC needs to check if there was a TPO that had to be serviced and do so.

OK, sounds reasonable.

mine260309 commented 4 years ago

Good, so a summary:

vishwabmc commented 4 years ago

@mine260309 just want to add that "PowerOn must only be attempted if the system is in Normal Mode". Normal / Manual is a policy settable by user. But I believe, we could bake checking that into some systemd target and not needed part of any code

mine260309 commented 4 years ago

@vishwabmc Could you elaborate on what the "Normal/Manual" mode is? Is it a property on D-Bus, or something else?

vishwabmc commented 4 years ago

@mine260309 This would be a setting in /xyz/openbmc, But we still need to see what is the best way to implement such a setting. For now, please ignore that setting. When we device such a setting, it would be a matter of checking that in some systemd target.. so no code changes would be needed.

wangkair commented 4 years ago

Where can we implement the interface? In phospher-state-manager or in a new built project? @vishwabmc @geissonator

vishwabmc commented 4 years ago

Where can we implement the interface? In phospher-state-manager or in a new built project? @vishwabmc @geissonator

@wangkair it will not be as part of phosphor-state-manager. it would be a different one.

To start with, could you help with PLDM changes ?

wangkair commented 4 years ago

Where can we implement the interface? In phospher-state-manager or in a new built project? @vishwabmc @geissonator

@wangkair it will not be as part of phosphor-state-manager. it would be a different one.

To start with, could you help with PLDM changes ?

Oh, I assigned the sub-issue to implement the interface, since I have no experience on interface coding and I want to learn it. :-)

vishwabmc commented 4 years ago

Oh, I assigned the sub-issue to implement the interface, since I have no experience on interface coding and I want to learn it. :-)

Sure.. We can implement this as a separate daemon inside phosphor-state-manager repo. Not sure if this is what you asked me before.

mzipse commented 4 years ago

Removing @wangkair as the owner as I don't believe she will be finishing this work. Let me know if anyone disagrees. Carol, if you are able, can you document what is completed and what is left to be done here?

lxwinspur commented 3 years ago

Hi, @mzipse Could we close this epic?

mzipse commented 3 years ago

We cannot close this yet. We confirmed that there is more work to do from a PLDM perspective. This function can be initiated from the Host OS. So the Host will need to communicate via PLDM to the BMC to set this timed power on function. This design topic has been identified but not clear how soon we will get to this. We will create a new PLDM story and link to this Epic once we understand the details of the PLDM design.

mzipse commented 3 years ago

Timed Power on work is now closed. Confirmed this with the PLDM team and Andrew.