On Mon, 1 Mar 2010 09:14:59 +0100 Rodolfo Giometti wrote: > On Wed, Feb 24, 2010 at 03:28:12PM +0300, Alexander Gordeev wrote: > > This commit adds hardpps() implementation based upon the original one > > from the NTPv4 reference kernel code from David Mills. However, it is > > highly optimized towards very fast syncronization and maximum stickness > > to PPS signal. The typical error is less then a microsecond. > > To make it sync faster I had to throw away exponential phase filter so > > that the full phase offset is corrected immediately. Then I also had to > > throw away median phase filter because it gives a bigger error itself > > if used without exponential filter. > > Maybe we will find an appropriate filtering scheme in the future but > > it's not necessary if the signal quality is ok. > > > > Signed-off-by: Alexander Gordeev > > --- > > drivers/pps/Kconfig | 1 + > > include/linux/timex.h | 1 + > > kernel/time/Kconfig | 7 + > > kernel/time/ntp.c | 420 +++++++++++++++++++++++++++++++++++++++++++++++-- > > 4 files changed, 414 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/pps/Kconfig b/drivers/pps/Kconfig > > index cc2eb8e..2bd4f65 100644 > > --- a/drivers/pps/Kconfig > > +++ b/drivers/pps/Kconfig > > @@ -7,6 +7,7 @@ menu "PPS support" > > config PPS > > tristate "PPS support" > > depends on EXPERIMENTAL > > + select NTP_PPS > > ---help--- > > PPS (Pulse Per Second) is a special pulse provided by some GPS > > antennae. Userland can use it to get a high-precision time > > diff --git a/include/linux/timex.h b/include/linux/timex.h > > index e6967d1..5a93cd3 100644 > > --- a/include/linux/timex.h > > +++ b/include/linux/timex.h > > @@ -274,6 +274,7 @@ extern u64 tick_length; > > extern void second_overflow(void); > > extern void update_ntp_one_tick(void); > > extern int do_adjtimex(struct timex *); > > +extern void hardpps(const struct timespec *, const struct timespec *); > > > > /* Don't use! Compatibility define for existing users. */ > > #define tickadj (500/HZ ? : 1) > > diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig > > index 95ed429..2da4900 100644 > > --- a/kernel/time/Kconfig > > +++ b/kernel/time/Kconfig > > @@ -27,3 +27,10 @@ config GENERIC_CLOCKEVENTS_BUILD > > default y > > depends on GENERIC_CLOCKEVENTS || GENERIC_CLOCKEVENTS_MIGR > > > > +config NTP_PPS > > + bool "PPS kernel consumer support" > > + depends on PPS > > + help > > + This option adds support for direct in-kernel time > > + syncronization using an external PPS signal. > > + > > This patch is both PPS and NTP related but I suppose is better moving > this setting into drivers/pps directory since people whose want to use > thise supports can go into same place and find whetever they want... OK, I don't mind moving it. In fact I don't remember why I put it here. :) Thanks for the note! -- Alexander