[time-nuts] Designing an embedded precision GPS time

Attila Kinali attila at kinali.ch
Sun Nov 12 10:23:53 EST 2017

On Wed, 1 Nov 2017 10:15:43 -0700
Denny Page <denny at cococafe.com> wrote:

> > 6-10µs is the interrupt latency of linux on ARM SoC. I guess, to get
> > below that you'd have to tweak the kernel a bit. Which should not
> > be that difficult. Definitly simpler than writing your own IP and NTP
> > stack from scratch.
> Just tweak the Linux kernel a bit? No. You would have to a rewrite 
> substantial chunks of it. A tremendous effort. Low latency and accurate 
> timing is not what Linux is designed for. This has been discussed 
> extensively for years.

Not really. The kernel has already quite a few low-latency network paths.
You just need to enable them and then cut out the biggest timing uncertainty:
the user-space to kernel context switch. If you write a small stub driver
that takes from user space the required data to build a NTP packet, you
can cut out quite a bit of the latency. You could even get a decent estimate
on when the packet will be send out in case of conguestion, if you check
the buffer fill marks. My guess, for someone who knows his way around
the kernel network stack, that would be 1-4 weeks of effort.

> > Spread spectrum can usually be switched off, though requires at least a
> > custom DTB or even patching of the kernel. There are a few boards, though
> > that do not allow spread spectrum to be switched off.
> Unfortunately is usually has to be done in the bios. The control space that 
> would allow spread spectrum to be turned off is usually disabled prior to 
> kernel load. For compliance, most bios implementations have removed spread 
> spectrum as an option so you have to build a custom one. I can’t begin to 
> tell you what kind of a chill comes over the conversation with a vendor 
> (even a maker oriented one) when you tell them you want to create a custom 
> bios to disable spread spectrum.

Ah.. sorry for the confusion. I was specifically talking about embedded
systems. On a PC all bets are off, while on a embedded system you have
quite a high level of control of what's going on. At most you have to
tweak the DT file a bit, or set some initialization values a bit differently.

				Attila Kinali
You know, the very powerful and the very stupid have one thing in common.
They don't alters their views to fit the facts, they alter the facts to
fit the views, which can be uncomfortable if you happen to be one of the
facts that needs altering.  -- The Doctor

More information about the time-nuts mailing list