adding sync method in phosphor-time-manager

Ed Tanous ed at tanous.net
Fri Apr 9 05:36:36 AEST 2021


On Thu, Apr 8, 2021 at 11:17 AM Alexander Amelkin <a.amelkin at yadro.com> wrote:
>
> Hi Patrick, everybody!
>
> As far as I can see, this discussion has had no development, to our regret.
> We would really like to read some clarification on what is the proposed
> method
> of timekeeping for x86 systems nowadays, because with TimeOwner interface
> removed, it's not clear to me anymore.
>
> Do you allow the users to set time/date on the BMC side?

Yes.

> If so, how do you
> propagate those changes on to the host, which in x86 is the owner of RTC?

Check your PCH specification, there are generally commands for doing
this over i2c.  I don't believe anyone has implemented them in OpenBMC
mainline yet, although the not-finished-mainlining tyan s7106 patches
had a python script to do this that you might use as a model.

> What if the BMC is rebooted before the time settings are propagated?

Presumably you would block the return of the set time calls until
they've been persisted into the RTC in the PCH to avoid this race
condition, but that will depend on what you implement for this case.

>
> If you don't allow setting the time in BMC, then what are the options
> for the user?
> Do you allow a choice between NTP and Host time only?

Don't set an NTP server, which is the default.  If an NTP server is
set, the BMC will use it.  Whether or not that goes to your PCH would
be a detail you'd need to implement.

>
> How and when is the time synced from the host? Is there a method to
> force a sync?

IMO, no, there shouldn't be a way to force it, it should be
periodically polled (once a minute maybe?).  Make sure to watch out
for skid, and only update the BMC time if the difference is > 2
seconds apart, because the PCH only gives 1 second resolution.

>
> Is there maybe some document that covers this topic?
>
> WBR, Alexander Amelkin
> YADRO
>
> 07.10.2020 04:34, Patrick Williams пишет:
> > On Tue, Oct 06, 2020 at 05:38:13PM +0000, Velumani T-ERS,HCLTech wrote:
> >> Classification:
> >> Hi Team,
> >>
> >> We wanted to add another time sync method in phosphor-time-manager to get the time from the host and set it to BMC. To have this option configurable I propose a dbus property in the time interface(given below). Please provide your feedback/comments.
> >>
> >> https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Time/Synchronization.interface.yaml
> >> enumerations:
> >>      - name: Method
> >>        description: >
> >>          Possible methods of time synchronization.
> >>        values:
> >>          - name: NTP
> >>            description: >
> >>              Sync by using the Network Time Protocol.
> >>          - name: Manual
> >>            description: >
> >>              Sync time manually.
> >>           - name: HostSync
> >>            description: >
> >>              Sync the time from host.
> >>
> > Hopefully Vishwa can weigh in here.
> >
> > It is my understanding that the default implementation allows the host
> > to synchronize the time down already.  There use to be an interface that
> > determined the "TimeOwner" to specify if the BMC or the Host were in
> > charge of the time.  That was removed not too long ago.
> >
> > https://github.com/openbmc/phosphor-dbus-interfaces/commit/70c76a29b898f05e28c803808bd57a2b6c3f7a6f
> >
> > I think you should look through the history on this commit (it
> > references a discussion related to the mailing list) and check with the
> > people in that chain as to why it was removed before we add back in
> > something very similar.
> >


More information about the openbmc mailing list