tree 42837313a716175b11e6d5f8141b947354e11752
parent 545e78d594fe3ce9fd69f09b28d1514c64396121
author Giovambattista Pulcini <[EMAIL PROTECTED]> Tue Apr 12 08:24:58 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:24:58 2005

[PATCH] ppc32: Fix a problem with NTP on !(chrp||gemini)

The following problem was found by Giovambattista Pulcini
<[EMAIL PROTECTED]>, who also provided a partial patch, and this has been
verified by our time guru Gabriel Paubert <[EMAIL PROTECTED]>.

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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 kernel/time.c            |    1 -
 platforms/chrp_time.c    |    2 --
 platforms/gemini_setup.c |    3 ---
 3 files changed, 6 deletions(-)

Index: arch/ppc/kernel/time.c
===================================================================
--- ef20e02e4aacb3c09805559982579d1f48e4dd88/arch/ppc/kernel/time.c  
(mode:100644 sha1:785d3ee12ccf8506cf179a7ea1476fba39cb71f5)
+++ 42837313a716175b11e6d5f8141b947354e11752/arch/ppc/kernel/time.c  
(mode:100644 sha1:6a3fc3692f2e1b96ee6d83cf2be4143085c23cb5)
@@ -272,7 +272,6 @@
 
        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);
Index: arch/ppc/platforms/chrp_time.c
===================================================================
--- ef20e02e4aacb3c09805559982579d1f48e4dd88/arch/ppc/platforms/chrp_time.c  
(mode:100644 sha1:055060ed40a7ad247aff311698baf098ba014088)
+++ 42837313a716175b11e6d5f8141b947354e11752/arch/ppc/platforms/chrp_time.c  
(mode:100644 sha1:f31b3028ac741266faf8e8b066db09b7f7e03c79)
@@ -115,8 +115,6 @@
        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;
 }
Index: arch/ppc/platforms/gemini_setup.c
===================================================================
--- ef20e02e4aacb3c09805559982579d1f48e4dd88/arch/ppc/platforms/gemini_setup.c  
(mode:100644 sha1:f21f07f99c2249faea73f66074bfd7c8b2e58dbe)
+++ 42837313a716175b11e6d5f8141b947354e11752/arch/ppc/platforms/gemini_setup.c  
(mode:100644 sha1:329ba2ea84b027637d66db607cfccfc6e5cdc9ab)
@@ -433,9 +433,6 @@
        /* done writing */
        gemini_rtc_write(reg, M48T35_RTC_CONTROL);
 
-       if ((time_state == TIME_ERROR) || (time_state == TIME_BAD))
-               time_state = TIME_OK;
-
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to