Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH 1/3] plugins: Implementation of Network Time plugin
Date: Tue, 07 Dec 2010 09:58:37 +0100	[thread overview]
Message-ID: <1291712317.4795.131.camel@aeonflux> (raw)
In-Reply-To: <201012070156.06941.remi.denis-courmont@nokia.com>

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

Hi Remi,

> > > > where is this timed running? I prefer the plugin just send a D-Bus
> > > > message to the timed directly instead of a Get/Changed API kind of
> > > > thing.
> > > 
> > > AFAIK, Get/Changed is the simplest functional way to avoid races, where
> > > say oFono would receive the time before timed can process it. The getter
> > > also enables implementing trivial a tool à la ntpdate.
> > 
> > then please answer my questions from my other email. If we receive the
> > time before timed (or any other time daemon) is running, who does ensure
> > the current timestamp of this received time and what it correlates to.
> 
> The answer is in the patch. It makes me wonder if you even read it? When we 
> receive NITZ from the modem, we take a timestamp from the monotonic clock.
> 
> From there, we have plenty of options, mostly boiling down to:
> 
> (1) Give an estimate of the current wall time:
>    nitz + (now(CLOCK_MONOTONIC) - timestamp)
> This induces avoidable imprecision, but it is easiest to understand.
> 
> (2) Give both the NITZ time and the monotonic timestamp, and let the time 
> daemon do all the maths. IIRC, that's what timed would like, although I find it 
> needlessly complicated.
> 
> (3) Give an estimate of the time of day of the monotonic clock origin, which 
> is to say the time of day of the system boot:
>   nitz - timestamp.
> The time daemon can then add the current monotonic time. This is a bit more 
> precise than (1), and a bit simpler than (2), which is why I was suggesting 
> that.
> 
> > If no time daemon is running it is safer to just set this time as system
> > time right away and then let the time daemon adjust it later.
> 
> Either oFono maintains the time (may be a configuration option), or it does 
> not. I would really hate to have oFono set the system time depending on the 
> effect of the phase of moon on the ordering of the boot sequence.
> 
> > But just
> > handing out a random time from a random time before is not helping. And
> > oFono is not suppose to track time and it corelation to it.
> 
> Antti's patch returns an extrapolation of the _current_ wall time by adding 
> the time since the NITZ was received to the NITZ. This is not at all random. 
> Obviously, we need a working monotonic clock - but I think a mobile device 
> without a working timer is about as useful as a brick.

I have seen a bunch of devices where we have not a proper clock value to
begin with. And in that case there is nothing really useful we can do
with it, except just set the system clock right away.

So the other problem with the timestamp and NITZ and the time daemon not
running is that we have no idea what happens in between. While this
might be short time and could potentially work, I still don't see this
as a good solution at all.

Right now, I still think that either we set the system clock right away
if no time daemon is running and if time daemon is running, then we send
a D-Bus method to that time daemon. And we can easily track this D-Bus
name owner notifications.

Regards

Marcel




  reply	other threads:[~2010-12-07  8:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03  9:47 [PATCH 1/3] plugins: Implementation of Network Time plugin Antti Paila
2010-12-03  9:47 ` [PATCH 2/3] plugins: Enabling nettime plugin in Makefile.am Antti Paila
2010-12-03  9:47 ` [PATCH 3/3] plugins: Test scripts for nettime plugin Antti Paila
2010-12-03 14:07 ` [PATCH 1/3] plugins: Implementation of Network Time plugin Aki Niemi
2010-12-04  0:02   ` Marcel Holtmann
2010-12-04 12:03     ` Aki Niemi
2010-12-05 12:40       ` Marcel Holtmann
2010-12-08  8:44         ` Marcel Holtmann
2010-12-08  9:19           ` Aki Niemi
2010-12-06 16:33     ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2010-12-06 23:29       ` Marcel Holtmann
2010-12-06 23:56         ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2010-12-07  8:58           ` Marcel Holtmann [this message]
2010-12-07 11:00             ` Antti Paila
2010-12-07 16:05             ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2010-12-06 17:00 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2010-12-07  7:51   ` Aki Niemi
2010-12-07  9:12     ` Antti Paila
2010-12-07 16:12     ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2010-12-08  8:13       ` Aki Niemi
2010-12-08 16:49         ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291712317.4795.131.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox