From: Giovambattista Pulcini Date: Sat, 16 Apr 2005 22:24:24 +0000 (-0700) Subject: [PATCH] ppc32: Fix a problem with NTP on !(chrp||gemini) X-Git-Tag: MMI-PSA29.97-13-9~57759 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54095a6ec7b11a008c07c5016b025206a051f560;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [PATCH] ppc32: Fix a problem with NTP on !(chrp||gemini) The following problem was found by Giovambattista Pulcini , who also provided a partial patch, and this has been verified by our time guru Gabriel Paubert . The problem is that in do_settimeofday() we always set time_state to TIME_ERROR and except on two platforms, never re-set it. This meant that ntp_gettime() and ntp_adjtime() always returned TIME_ERROR, incorrectly. Based on Gabriel's analysis, time_state is used for leap-second processing, and ppc shouldn't be mucking with it. Signed-off-by: Tom Rini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c index 50724139402c..b3cee6b01454 100644 --- a/arch/ppc/kernel/time.c +++ b/arch/ppc/kernel/time.c @@ -272,7 +272,6 @@ int do_settimeofday(struct timespec *tv) time_adjust = 0; /* stop active adjtime() */ time_status |= STA_UNSYNC; - time_state = TIME_ERROR; /* p. 24, (a) */ time_maxerror = NTP_PHASE_LIMIT; time_esterror = NTP_PHASE_LIMIT; write_sequnlock_irqrestore(&xtime_lock, flags); diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c index e2be0c838d8a..4864a7de3daa 100644 --- a/arch/ppc/platforms/chrp_time.c +++ b/arch/ppc/platforms/chrp_time.c @@ -115,8 +115,6 @@ int __chrp chrp_set_rtc_time(unsigned long nowtime) chrp_cmos_clock_write(save_control, RTC_CONTROL); chrp_cmos_clock_write(save_freq_select, RTC_FREQ_SELECT); - if ( (time_state == TIME_ERROR) || (time_state == TIME_BAD) ) - time_state = TIME_OK; spin_unlock(&rtc_lock); return 0; } diff --git a/arch/ppc/platforms/gemini_setup.c b/arch/ppc/platforms/gemini_setup.c index 1a42cb9b1134..e391e52383c7 100644 --- a/arch/ppc/platforms/gemini_setup.c +++ b/arch/ppc/platforms/gemini_setup.c @@ -433,9 +433,6 @@ gemini_set_rtc_time( unsigned long now ) /* done writing */ gemini_rtc_write(reg, M48T35_RTC_CONTROL); - if ((time_state == TIME_ERROR) || (time_state == TIME_BAD)) - time_state = TIME_OK; - return 0; }