From: Miroslav Lichvar <mlichvar@redhat.com>
To: John Stultz <john.stultz@linaro.org>
Cc: "Nuno Gonçalves" <nunojpg@gmail.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"Günter Köllner" <dl4mea@yahoo.de>,
stable <stable@vger.kernel.org>
Subject: Re: Regression: can't apply frequency offsets above 1000ppm.
Date: Thu, 3 Sep 2015 13:26:47 +0200 [thread overview]
Message-ID: <20150903112647.GD29274@localhost> (raw)
In-Reply-To: <CALAqxLXPkf1KAO=qt92LT2mOo4FqhcOrvC0P9Sq8QxQ14Y+ueA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]
On Wed, Sep 02, 2015 at 04:16:00PM -0700, John Stultz wrote:
> On Tue, Sep 1, 2015 at 6:14 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote:
> > And just installing chrony from the feeds. With any kernel from 3.17
> > you'll have wrong estimates at chronyc sourcestats.
>
> Wrong estimates? Could you be more specific about what the failure
> you're seeing is here? The
>
> I installed the image above, which comes with a 4.1.6 kernel, and
> chrony seems to have gotten my BBB into ~1ms sync w/ servers over the
> internet fairly quickly (at least according to chronyc tracking).
To see the bug with chronyd the initial offset shouldn't be very close
to zero, so it's forced to correct the offset by adjusting the
frequency in a larger step.
I'm attaching a simple C program that prints the frequency offset
as measured between the REALTIME and MONOTONIC_RAW clocks when the
adjtimex tick is set to 9000. It should show values close to -100000
ppm and I suspect on the BBB it will be much smaller.
--
Miroslav Lichvar
[-- Attachment #2: rawfreqoff.c --]
[-- Type: text/plain, Size: 579 bytes --]
#include <stdio.h>
#include <sys/timex.h>
#include <time.h>
#include <unistd.h>
#define DIFFTS(a, b) ((a.tv_sec - b.tv_sec) + 1e-9 * (a.tv_nsec - b.tv_nsec))
int main() {
struct timespec ts1, ts2, ts3, ts4 = {0};
struct timex t;
t.modes = ADJ_TICK;
t.tick = 9000;
if (adjtimex(&t) < 0)
return 1;
while (1) {
clock_gettime(CLOCK_REALTIME, &ts1);
clock_gettime(CLOCK_MONOTONIC_RAW, &ts2);
if (ts4.tv_sec)
printf("freq offset = %.0f ppm\n",
(DIFFTS(ts1, ts3) / DIFFTS(ts2, ts4) - 1.0) * 1e6);
ts3 = ts1;
ts4 = ts2;
usleep(1000000);
}
return 0;
}
next prev parent reply other threads:[~2015-09-03 11:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-01 20:02 Regression: can't apply frequency offsets above 1000ppm Nuno Gonçalves
2015-09-01 20:25 ` Thomas Gleixner
2015-09-01 20:30 ` John Stultz
2015-09-01 20:45 ` Thomas Gleixner
2015-09-02 0:36 ` Nuno Gonçalves
2015-09-02 1:03 ` John Stultz
2015-09-02 1:14 ` Nuno Gonçalves
2015-09-02 7:39 ` Miroslav Lichvar
2015-09-02 23:16 ` John Stultz
2015-09-03 10:10 ` Nuno Gonçalves
2015-09-03 11:26 ` Miroslav Lichvar [this message]
2015-09-05 0:57 ` John Stultz
2015-09-05 1:00 ` John Stultz
2015-09-05 1:39 ` defects for uses of abs(u64) (was: Re: Regression: can't apply frequency offsets above 1000ppm) Joe Perches
2015-09-23 7:21 ` Neil Brown
2015-09-05 13:41 ` Regression: can't apply frequency offsets above 1000ppm Nuno Gonçalves
2015-09-09 0:52 ` John Stultz
2015-09-09 1:00 ` Nuno Gonçalves
2015-09-01 20:28 ` John Stultz
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=20150903112647.GD29274@localhost \
--to=mlichvar@redhat.com \
--cc=dl4mea@yahoo.de \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nunojpg@gmail.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
/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