http://bugzilla.novell.com/show_bug.cgi?id=557716 http://bugzilla.novell.com/show_bug.cgi?id=557716#c0 Summary: NTP PLL does not converge Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: x86-64 OS/Version: openSUSE 11.2 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: passport@solo-germany.com QAContact: qa@suse.de Found By: --- Blocker: --- Created an attachment (id=328959) --> (http://bugzilla.novell.com/attachment.cgi?id=328959) Use correct constants from sys/timex.h User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) The NTP PLL does not converge and I can see a lot of time resets in ntp.log. 0 Nov 01:29:16 ntpd[2996]: offset 0.033937 sec freq -41.912 ppm error 0.064179 poll 8 20 Nov 02:15:14 ntpd[2996]: time reset +0.213438 s 20 Nov 02:29:16 ntpd[2996]: offset -0.025795 sec freq -40.861 ppm error 0.014490 poll 6 20 Nov 03:29:16 ntpd[2996]: offset 0.029457 sec freq -38.088 ppm error 0.060577 poll 7 20 Nov 04:29:16 ntpd[2996]: offset -0.106376 sec freq -34.027 ppm error 0.061192 poll 8 20 Nov 05:29:16 ntpd[2996]: offset -0.096337 sec freq -33.554 ppm error 0.034059 poll 9 20 Nov 06:29:16 ntpd[2996]: offset -0.027996 sec freq -98.380 ppm error 0.069589 poll 10 20 Nov 06:51:49 ntpd[2996]: time reset +0.291485 s 20 Nov 07:29:17 ntpd[2996]: offset -0.008367 sec freq -99.583 ppm error 0.080983 poll 7 20 Nov 07:35:45 ntpd[2996]: time reset +0.167091 s 20 Nov 08:29:17 ntpd[2996]: offset 0.024549 sec freq -94.342 ppm error 0.019068 poll 7 20 Nov 09:06:18 ntpd[2996]: time reset +0.268558 s 20 Nov 09:29:17 ntpd[2996]: offset 0.034551 sec freq -87.901 ppm error 0.007853 poll 6 Reproducible: Always Steps to Reproduce: 1. 2. 3. Expected Results: 23 Nov 01:23:02 ntpd[18035]: offset 0.000874 sec freq -17.626 ppm error 0.000064 poll 9 23 Nov 02:23:02 ntpd[18035]: offset 0.000769 sec freq -17.594 ppm error 0.000031 poll 9 23 Nov 03:23:02 ntpd[18035]: offset 0.000849 sec freq -17.568 ppm error 0.000065 poll 10 23 Nov 04:23:02 ntpd[18035]: offset 0.000951 sec freq -17.428 ppm error 0.000062 poll 10 23 Nov 05:23:02 ntpd[18035]: offset 0.000589 sec freq -17.349 ppm error 0.000069 poll 10 The patch MOD_NANO.diff in package 4.2.4p7-6.3.src.rpm is simply wrong. With this patch NTP calculates with nanoseconds but sets microseconds. If you replace the patch with my patch NTP works as expected. --- ntpd.orig/ntp_loopfilter.c +++ ntpd/ntp_loopfilter.c @@ -169,8 +169,8 @@ static double sys_mindly; /* huff-n'-puf #if defined(KERNEL_PLL) /* Emacs cc-mode goes nuts if we split the next line... */ -#define MOD_BITS (MOD_OFFSET | MOD_MAXERROR | MOD_ESTERROR | \ - MOD_STATUS | MOD_TIMECONST) +#define ADJ_BITS (ADJ_OFFSET | ADJ_MAXERROR | ADJ_ESTERROR | \ + ADJ_STATUS | ADJ_TIMECONST) #ifdef SIGSYS static void pll_trap P((int)); /* configuration trap */ static struct sigaction sigsys; /* current sigaction status */ @@ -523,7 +523,7 @@ local_clock( #if defined(STA_NANO) && NTP_API == 4 if (pll_control && kern_enable && sys_tai == 0) { memset(&ntv, 0, sizeof(ntv)); - ntv.modes = MOD_TAI; + ntv.modes = ADJ_TAI; ntv.constant = i + TAI_1972 - 1; ntp_adjtime(&ntv); } @@ -562,15 +562,15 @@ local_clock( */ memset(&ntv, 0, sizeof(ntv)); if (ext_enable) { - ntv.modes = MOD_STATUS; + ntv.modes = ADJ_STATUS; } else { struct tm *tm = NULL; time_t tstamp; #ifdef STA_NANO - ntv.modes = MOD_BITS | MOD_NANO; + ntv.modes = ADJ_BITS | ADJ_NANO; #else /* STA_NANO */ - ntv.modes = MOD_BITS; + ntv.modes = ADJ_BITS; #endif /* STA_NANO */ if (clock_offset < 0) dtemp = -.5; @@ -592,7 +592,7 @@ local_clock( * state. */ if (clock_frequency != 0) { - ntv.modes |= MOD_FREQUENCY; + ntv.modes |= ADJ_FREQUENCY; ntv.freq = (int32)((clock_frequency + drift_comp) * 65536e6); } @@ -894,9 +894,9 @@ loop_config( pll_control = 1; memset(&ntv, 0, sizeof(ntv)); #ifdef STA_NANO - ntv.modes = MOD_BITS | MOD_NANO; + ntv.modes = ADJ_BITS | ADJ_NANO; #else /* STA_NANO */ - ntv.modes = MOD_BITS; + ntv.modes = ADJ_BITS; #endif /* STA_NANO */ ntv.maxerror = MAXDISPERSE; ntv.esterror = MAXDISPERSE; @@ -971,7 +971,7 @@ loop_config( */ if (pll_control && kern_enable) { memset((char *)&ntv, 0, sizeof(ntv)); - ntv.modes = MOD_OFFSET | MOD_FREQUENCY; + ntv.modes = ADJ_OFFSET | ADJ_FREQUENCY; ntv.freq = (int32)(drift_comp * 65536e6); ntp_adjtime(&ntv); } @@ -985,7 +985,7 @@ loop_config( /* Completely turn off the kernel time adjustments. */ if (pll_control) { memset((char *)&ntv, 0, sizeof(ntv)); - ntv.modes = MOD_BITS | MOD_OFFSET | MOD_FREQUENCY; + ntv.modes = ADJ_BITS | ADJ_OFFSET | ADJ_FREQUENCY; ntv.status = STA_UNSYNC; ntp_adjtime(&ntv); NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT) --- util.orig/ntptime.c +++ util/ntptime.c @@ -37,7 +37,7 @@ #endif -#define TIMEX_MOD_BITS \ +#define TIMEX_ADJ_BITS \ "\20\1OFFSET\2FREQUENCY\3MAXERROR\4ESTERROR\5STATUS\6TIMECONST\ \13PLL\14FLL\15MICRO\16NANO\17CLKB\20CLKA" @@ -99,20 +99,20 @@ main( memset((char *)&ntx, 0, sizeof(ntx)); progname = argv[0]; while ((c = ntp_getopt(argc, argv, optargs)) != EOF) switch (c) { -#ifdef MOD_MICRO +#ifdef ADJ_MICRO case 'M': - ntx.modes |= MOD_MICRO; + ntx.modes |= ADJ_MICRO; break; #endif -#ifdef MOD_NANO +#ifdef ADJ_NANO case 'N': - ntx.modes |= MOD_NANO; + ntx.modes |= ADJ_NANO; break; #endif #ifdef NTP_API # if NTP_API > 3 case 'T': - ntx.modes = MOD_TAI; + ntx.modes = ADJ_TAI; ntx.constant = atoi(ntp_optarg); break; # endif @@ -121,31 +121,31 @@ main( cost++; break; case 'e': - ntx.modes |= MOD_ESTERROR; + ntx.modes |= ADJ_ESTERROR; ntx.esterror = atoi(ntp_optarg); break; case 'f': - ntx.modes |= MOD_FREQUENCY; + ntx.modes |= ADJ_FREQUENCY; ntx.freq = (long)(atof(ntp_optarg) * SCALE_FREQ); break; case 'm': - ntx.modes |= MOD_MAXERROR; + ntx.modes |= ADJ_MAXERROR; ntx.maxerror = atoi(ntp_optarg); break; case 'o': - ntx.modes |= MOD_OFFSET; + ntx.modes |= ADJ_OFFSET; ntx.offset = atoi(ntp_optarg); break; case 'r': rawtime++; break; case 's': - ntx.modes |= MOD_STATUS; + ntx.modes |= ADJ_STATUS; ntx.status = atoi(ntp_optarg); if (ntx.status < 0 || ntx.status >= 0x100) errflg++; break; case 't': - ntx.modes |= MOD_TIMECONST; + ntx.modes |= ADJ_TIMECONST; ntx.constant = atoi(ntp_optarg); break; default: @@ -165,12 +165,12 @@ main( -s status Set the status bits\n\ -t timeconstant log2 of PLL time constant (0 .. %d)\n", progname, optargs, -#ifdef MOD_MICRO +#ifdef ADJ_MICRO "-M switch to microsecond mode\n", #else "", #endif -#ifdef MOD_NANO +#ifdef ADJ_NANO "-N switch to nanosecond mode\n", #else "", @@ -315,7 +315,7 @@ main( flash = ntx.status; printf("ntp_adjtime() returns code %d (%s)\n", status, timex_state(status)); - printf(" modes %s,\n", sprintb(ntx.modes, TIMEX_MOD_BITS)); + printf(" modes %s,\n", sprintb(ntx.modes, TIMEX_ADJ_BITS)); ftemp = (double)ntx.offset; #ifdef STA_NANO if (flash & STA_NANO) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.