Commit 5ddcfa87 authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[PATCH] remove pps support

This removes the support for pps.  It's completely unused within the kernel
and is basically in the way for further cleanups.  It should be easier to
readd proper support for it after the rest has been converted to NTP4
(where the pps mechanisms are quite different from NTP3 anyway).
Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e4294b3e
...@@ -97,37 +97,10 @@ ...@@ -97,37 +97,10 @@
#define MAXPHASE 512000L /* max phase error (us) */ #define MAXPHASE 512000L /* max phase error (us) */
#define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */
#define MAXTIME (200L << PPS_AVG) /* max PPS error (jitter) (200 us) */
#define MINSEC 16L /* min interval between updates (s) */ #define MINSEC 16L /* min interval between updates (s) */
#define MAXSEC 1200L /* max interval between updates (s) */ #define MAXSEC 1200L /* max interval between updates (s) */
#define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */
/*
* The following defines are used only if a pulse-per-second (PPS)
* signal is available and connected via a modem control lead, such as
* produced by the optional ppsclock feature incorporated in the Sun
* asynch driver. They establish the design parameters of the frequency-
* lock loop used to discipline the CPU clock oscillator to the PPS
* signal.
*
* PPS_AVG is the averaging factor for the frequency loop, as well as
* the time and frequency dispersion.
*
* PPS_SHIFT and PPS_SHIFTMAX specify the minimum and maximum
* calibration intervals, respectively, in seconds as a power of two.
*
* PPS_VALID is the maximum interval before the PPS signal is considered
* invalid and protocol updates used directly instead.
*
* MAXGLITCH is the maximum interval before a time offset of more than
* MAXTIME is believed.
*/
#define PPS_AVG 2 /* pps averaging constant (shift) */
#define PPS_SHIFT 2 /* min interval duration (s) (shift) */
#define PPS_SHIFTMAX 8 /* max interval duration (s) (shift) */
#define PPS_VALID 120 /* pps signal watchdog max (s) */
#define MAXGLITCH 30 /* pps signal glitch max (s) */
/* /*
* syscall interface - used (mainly by NTP daemon) * syscall interface - used (mainly by NTP daemon)
* to discipline kernel clock oscillator * to discipline kernel clock oscillator
...@@ -246,20 +219,6 @@ extern long time_reftime; /* time at last adjustment (s) */ ...@@ -246,20 +219,6 @@ extern long time_reftime; /* time at last adjustment (s) */
extern long time_adjust; /* The amount of adjtime left */ extern long time_adjust; /* The amount of adjtime left */
extern long time_next_adjust; /* Value for time_adjust at next tick */ extern long time_next_adjust; /* Value for time_adjust at next tick */
/* interface variables pps->timer interrupt */
extern long pps_offset; /* pps time offset (us) */
extern long pps_jitter; /* time dispersion (jitter) (us) */
extern long pps_freq; /* frequency offset (scaled ppm) */
extern long pps_stabil; /* frequency dispersion (scaled ppm) */
extern long pps_valid; /* pps signal watchdog counter */
/* interface variables pps->adjtimex */
extern int pps_shift; /* interval duration (s) (shift) */
extern long pps_jitcnt; /* jitter limit exceeded */
extern long pps_calcnt; /* calibration intervals */
extern long pps_errcnt; /* calibration errors */
extern long pps_stbcnt; /* stability limit exceeded */
/** /**
* ntp_clear - Clears the NTP state variables * ntp_clear - Clears the NTP state variables
* *
......
...@@ -202,24 +202,6 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv, ...@@ -202,24 +202,6 @@ asmlinkage long sys_settimeofday(struct timeval __user *tv,
return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL); return do_sys_settimeofday(tv ? &new_ts : NULL, tz ? &new_tz : NULL);
} }
long pps_offset; /* pps time offset (us) */
long pps_jitter = MAXTIME; /* time dispersion (jitter) (us) */
long pps_freq; /* frequency offset (scaled ppm) */
long pps_stabil = MAXFREQ; /* frequency dispersion (scaled ppm) */
long pps_valid = PPS_VALID; /* pps signal watchdog counter */
int pps_shift = PPS_SHIFT; /* interval duration (s) (shift) */
long pps_jitcnt; /* jitter limit exceeded */
long pps_calcnt; /* calibration intervals */
long pps_errcnt; /* calibration errors */
long pps_stbcnt; /* stability limit exceeded */
/* hook for a loadable hardpps kernel module */
void (*hardpps_ptr)(struct timeval *);
/* we call this to notify the arch when the clock is being /* we call this to notify the arch when the clock is being
* controlled. If no such arch routine, do nothing. * controlled. If no such arch routine, do nothing.
*/ */
...@@ -279,7 +261,7 @@ int do_adjtimex(struct timex *txc) ...@@ -279,7 +261,7 @@ int do_adjtimex(struct timex *txc)
result = -EINVAL; result = -EINVAL;
goto leave; goto leave;
} }
time_freq = txc->freq - pps_freq; time_freq = txc->freq;
} }
if (txc->modes & ADJ_MAXERROR) { if (txc->modes & ADJ_MAXERROR) {
...@@ -312,10 +294,8 @@ int do_adjtimex(struct timex *txc) ...@@ -312,10 +294,8 @@ int do_adjtimex(struct timex *txc)
if ((time_next_adjust = txc->offset) == 0) if ((time_next_adjust = txc->offset) == 0)
time_adjust = 0; time_adjust = 0;
} }
else if ( time_status & (STA_PLL | STA_PPSTIME) ) { else if (time_status & STA_PLL) {
ltemp = (time_status & (STA_PPSTIME | STA_PPSSIGNAL)) == ltemp = txc->offset;
(STA_PPSTIME | STA_PPSSIGNAL) ?
pps_offset : txc->offset;
/* /*
* Scale the phase adjustment and * Scale the phase adjustment and
...@@ -356,23 +336,14 @@ int do_adjtimex(struct timex *txc) ...@@ -356,23 +336,14 @@ int do_adjtimex(struct timex *txc)
} }
time_freq = min(time_freq, time_tolerance); time_freq = min(time_freq, time_tolerance);
time_freq = max(time_freq, -time_tolerance); time_freq = max(time_freq, -time_tolerance);
} /* STA_PLL || STA_PPSTIME */ } /* STA_PLL */
} /* txc->modes & ADJ_OFFSET */ } /* txc->modes & ADJ_OFFSET */
if (txc->modes & ADJ_TICK) { if (txc->modes & ADJ_TICK) {
tick_usec = txc->tick; tick_usec = txc->tick;
tick_nsec = TICK_USEC_TO_NSEC(tick_usec); tick_nsec = TICK_USEC_TO_NSEC(tick_usec);
} }
} /* txc->modes */ } /* txc->modes */
leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0)
|| ((time_status & (STA_PPSFREQ|STA_PPSTIME)) != 0
&& (time_status & STA_PPSSIGNAL) == 0)
/* p. 24, (b) */
|| ((time_status & (STA_PPSTIME|STA_PPSJITTER))
== (STA_PPSTIME|STA_PPSJITTER))
/* p. 24, (c) */
|| ((time_status & STA_PPSFREQ) != 0
&& (time_status & (STA_PPSWANDER|STA_PPSERROR)) != 0))
/* p. 24, (d) */
result = TIME_ERROR; result = TIME_ERROR;
if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT)
...@@ -380,7 +351,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 ...@@ -380,7 +351,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0
else { else {
txc->offset = shift_right(time_offset, SHIFT_UPDATE); txc->offset = shift_right(time_offset, SHIFT_UPDATE);
} }
txc->freq = time_freq + pps_freq; txc->freq = time_freq;
txc->maxerror = time_maxerror; txc->maxerror = time_maxerror;
txc->esterror = time_esterror; txc->esterror = time_esterror;
txc->status = time_status; txc->status = time_status;
...@@ -388,14 +359,16 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 ...@@ -388,14 +359,16 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0
txc->precision = time_precision; txc->precision = time_precision;
txc->tolerance = time_tolerance; txc->tolerance = time_tolerance;
txc->tick = tick_usec; txc->tick = tick_usec;
txc->ppsfreq = pps_freq;
txc->jitter = pps_jitter >> PPS_AVG; /* PPS is not implemented, so these are zero */
txc->shift = pps_shift; txc->ppsfreq = 0;
txc->stabil = pps_stabil; txc->jitter = 0;
txc->jitcnt = pps_jitcnt; txc->shift = 0;
txc->calcnt = pps_calcnt; txc->stabil = 0;
txc->errcnt = pps_errcnt; txc->jitcnt = 0;
txc->stbcnt = pps_stbcnt; txc->calcnt = 0;
txc->errcnt = 0;
txc->stbcnt = 0;
write_sequnlock_irq(&xtime_lock); write_sequnlock_irq(&xtime_lock);
do_gettimeofday(&txc->time); do_gettimeofday(&txc->time);
notify_arch_cmos_timer(); notify_arch_cmos_timer();
......
...@@ -697,18 +697,9 @@ static void second_overflow(void) ...@@ -697,18 +697,9 @@ static void second_overflow(void)
/* /*
* Compute the frequency estimate and additional phase adjustment due * Compute the frequency estimate and additional phase adjustment due
* to frequency error for the next second. When the PPS signal is * to frequency error for the next second.
* engaged, gnaw on the watchdog counter and update the frequency */
* computed by the pll and the PPS signal. ltemp = time_freq;
*/
pps_valid++;
if (pps_valid == PPS_VALID) { /* PPS signal lost */
pps_jitter = MAXTIME;
pps_stabil = MAXFREQ;
time_status &= ~(STA_PPSSIGNAL | STA_PPSJITTER |
STA_PPSWANDER | STA_PPSERROR);
}
ltemp = time_freq + pps_freq;
time_adj += shift_right(ltemp,(SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE)); time_adj += shift_right(ltemp,(SHIFT_USEC + SHIFT_HZ - SHIFT_SCALE));
#if HZ == 100 #if HZ == 100
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment