openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* adding sync method in phosphor-time-manager
@ 2020-10-06 17:38 Velumani T-ERS,HCLTech
  2020-10-06 21:41 ` Richard Hanley
  2020-10-07  1:34 ` Patrick Williams
  0 siblings, 2 replies; 8+ messages in thread
From: Velumani T-ERS,HCLTech @ 2020-10-06 17:38 UTC (permalink / raw)
  To: openbmc; +Cc: Patrick Williams

[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]

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.

Regards,
Velu
::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________

[-- Attachment #2: Type: text/html, Size: 5127 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: adding sync method in phosphor-time-manager
  2020-10-06 17:38 adding sync method in phosphor-time-manager Velumani T-ERS,HCLTech
@ 2020-10-06 21:41 ` Richard Hanley
  2020-10-07  1:38   ` Patrick Williams
  2020-10-07  1:34 ` Patrick Williams
  1 sibling, 1 reply; 8+ messages in thread
From: Richard Hanley @ 2020-10-06 21:41 UTC (permalink / raw)
  To: Velumani T-ERS,HCLTech; +Cc: openbmc, Patrick Williams

[-- Attachment #1: Type: text/plain, Size: 2647 bytes --]

I think it makes a lot of sense to make this configurable. However, I
wonder if we should consider making it a collection with a priority levels
instead of a single enum. I can envision a need for someone to say, "Use
NTP when it's available, but if the network is down then use the host."

While we're on the subject, has anyone ever taken a look at using roughtime
on a BMC? I imagine it could a really valuable extension to
phosphor-time-manager some time in the future.
https://blog.cloudflare.com/roughtime/

Regards,
Richard

On Tue, Oct 6, 2020 at 10:40 AM Velumani T-ERS,HCLTech <velumanit@hcl.com>
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.
>
>
>
> Regards,
>
> Velu
> ::DISCLAIMER::
> ------------------------------
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only. E-mail transmission is not
> guaranteed to be secure or error-free as information could be intercepted,
> corrupted, lost, destroyed, arrive late or incomplete, or may contain
> viruses in transmission. The e mail and its contents (with or without
> referred errors) shall therefore not attach any liability on the originator
> or HCL or its affiliates. Views or opinions, if any, presented in this
> email are solely those of the author and may not necessarily reflect the
> views or opinions of HCL or its affiliates. Any form of reproduction,
> dissemination, copying, disclosure, modification, distribution and / or
> publication of this message without the prior written consent of authorized
> representative of HCL is strictly prohibited. If you have received this
> email in error please delete it and notify the sender immediately. Before
> opening any email and/or attachments, please check them for viruses and
> other defects.
> ------------------------------
>

[-- Attachment #2: Type: text/html, Size: 4328 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: adding sync method in phosphor-time-manager
  2020-10-06 17:38 adding sync method in phosphor-time-manager Velumani T-ERS,HCLTech
  2020-10-06 21:41 ` Richard Hanley
@ 2020-10-07  1:34 ` Patrick Williams
  2021-04-08 18:08   ` Alexander Amelkin
  1 sibling, 1 reply; 8+ messages in thread
From: Patrick Williams @ 2020-10-07  1:34 UTC (permalink / raw)
  To: Velumani T-ERS,HCLTech; +Cc: openbmc, Patrick Williams

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

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.

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: adding sync method in phosphor-time-manager
  2020-10-06 21:41 ` Richard Hanley
@ 2020-10-07  1:38   ` Patrick Williams
  2020-10-07 17:18     ` Velumani T-ERS,HCLTech
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick Williams @ 2020-10-07  1:38 UTC (permalink / raw)
  To: Richard Hanley; +Cc: openbmc, Velumani T-ERS, HCLTech, Patrick Williams

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

On Tue, Oct 06, 2020 at 02:41:29PM -0700, Richard Hanley wrote:
> While we're on the subject, has anyone ever taken a look at using roughtime
> on a BMC? I imagine it could a really valuable extension to
> phosphor-time-manager some time in the future.
> https://blog.cloudflare.com/roughtime/

One of the problems I see is that there are a few different proposals
for "next generation time" protocols beyond NTP.  Unless a project
member has an explicit requirement for one of them, it doesn't seem like
we should go out of our way to pick one of them.  If someone is
especially interested in implementing one of them in their spare time
though, they're more than welcome.

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: adding sync method in phosphor-time-manager
  2020-10-07  1:38   ` Patrick Williams
@ 2020-10-07 17:18     ` Velumani T-ERS,HCLTech
  0 siblings, 0 replies; 8+ messages in thread
From: Velumani T-ERS,HCLTech @ 2020-10-07 17:18 UTC (permalink / raw)
  To: Patrick Williams, Richard Hanley; +Cc: openbmc, Patrick Williams

Classification: HCL Internal

Time owner module was a different module which decides who owns the time BMC/host and set the time using NTP mode or Manual Mode.
in Time owner module ,user set the host time using the below command manually by providing  the time.
busctl set-property xyz.openbmc_project.Time.Manager \
       /xyz/openbmc_project/time/host xyz.openbmc_project.Time.EpochTime \
                   Elapsed t <value-in-microseconds>

we are now actually not repeating the time owner implementation instead we are adding one more mode(HostSync) to time manager setting.
    a.NTP
    b.Manual
    c.HostSync

    How HostSync intent to work:
                1.host sync mode will get time from the host.
                   1.1 Add an empty system service file in this repo and spawn this service when HostSync enabled
                   1.2 This service file can be override by the platform machine layer.
                   1.3 The platform machine layer install the service file and the shell script to get the time from host.
                 2.it will set the time to BMC using the shell script.
Regards,
Velu
-----Original Message-----
From: Patrick Williams <patrick@stwcx.xyz>
Sent: Wednesday, October 7, 2020 7:08 AM
To: Richard Hanley <rhanley@google.com>
Cc: Velumani T-ERS,HCLTech <velumanit@hcl.com>; openbmc@lists.ozlabs.org; Patrick Williams <patrickw3@fb.com>
Subject: Re: adding sync method in phosphor-time-manager

On Tue, Oct 06, 2020 at 02:41:29PM -0700, Richard Hanley wrote:
> While we're on the subject, has anyone ever taken a look at using
> roughtime on a BMC? I imagine it could a really valuable extension to
> phosphor-time-manager some time in the future.
> https://blog.cloudflare.com/roughtime/

One of the problems I see is that there are a few different proposals for "next generation time" protocols beyond NTP.  Unless a project member has an explicit requirement for one of them, it doesn't seem like we should go out of our way to pick one of them.  If someone is especially interested in implementing one of them in their spare time though, they're more than welcome.

--
Patrick Williams
::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: adding sync method in phosphor-time-manager
  2020-10-07  1:34 ` Patrick Williams
@ 2021-04-08 18:08   ` Alexander Amelkin
  2021-04-08 19:36     ` Ed Tanous
  2021-04-09  7:26     ` Lei Yu
  0 siblings, 2 replies; 8+ messages in thread
From: Alexander Amelkin @ 2021-04-08 18:08 UTC (permalink / raw)
  To: openbmc

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? If so, how do you
propagate those changes on to the host, which in x86 is the owner of RTC?
What if the BMC is rebooted before the time settings are propagated?

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?

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

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.
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: adding sync method in phosphor-time-manager
  2021-04-08 18:08   ` Alexander Amelkin
@ 2021-04-08 19:36     ` Ed Tanous
  2021-04-09  7:26     ` Lei Yu
  1 sibling, 0 replies; 8+ messages in thread
From: Ed Tanous @ 2021-04-08 19:36 UTC (permalink / raw)
  To: Alexander Amelkin; +Cc: OpenBMC Maillist

On Thu, Apr 8, 2021 at 11:17 AM Alexander Amelkin <a.amelkin@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.
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: adding sync method in phosphor-time-manager
  2021-04-08 18:08   ` Alexander Amelkin
  2021-04-08 19:36     ` Ed Tanous
@ 2021-04-09  7:26     ` Lei Yu
  1 sibling, 0 replies; 8+ messages in thread
From: Lei Yu @ 2021-04-09  7:26 UTC (permalink / raw)
  To: Alexander Amelkin; +Cc: openbmc

On Fri, Apr 9, 2021 at 2:17 AM Alexander Amelkin <a.amelkin@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? If so, how do you
> propagate those changes on to the host, which in x86 is the owner of RTC?
> What if the BMC is rebooted before the time settings are propagated?
>
> 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?
>
> How and when is the time synced from the host? Is there a method to
> force a sync?

In our x86 system, what we do is:
1. Sync time during BMC boot from ME;
2. Use NTP in BMC side and never sync time from host (ME) anymore.
3. Ignore time settings from host if there is any.

-- 
BRs,
Lei YU

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-09  7:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 17:38 adding sync method in phosphor-time-manager Velumani T-ERS,HCLTech
2020-10-06 21:41 ` Richard Hanley
2020-10-07  1:38   ` Patrick Williams
2020-10-07 17:18     ` Velumani T-ERS,HCLTech
2020-10-07  1:34 ` Patrick Williams
2021-04-08 18:08   ` Alexander Amelkin
2021-04-08 19:36     ` Ed Tanous
2021-04-09  7:26     ` Lei Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).