Thread (15 messages) 15 messages, 4 authors, 2012-07-01

Re: [PATCH -stable] ntp: Correct TAI offset during leap second

From: Richard Cochran <richardcochran@gmail.com>
Date: 2012-06-17 17:35:10
Also in: lkml
Subsystem: the rest, timekeeping, clocksource core, ntp, alarmtimer · Maintainers: Linus Torvalds, John Stultz, Thomas Gleixner

On Sun, Jun 17, 2012 at 11:47:51AM -0500, Jonathan Nieder wrote:
Ben Hutchings wrote:
quoted
On Fri, 2012-06-15 at 11:56 -0700, John Stultz wrote:
quoted
quoted
commit dd48d708ff3e917f6d6b6c2b696c3f18c019feed upstream.
[...]
quoted
This doesn't apply to 3.2.y, unsurprisingly.  Let me know if there are
any urgent leap second fixes that will be needed there.
6b43ae8a619d (ntp: Fix leap-second hrtimer livelock) sounds important,
but the patch depends on bd3312681f69 (ntp: Add ntp_lock to replace
xtime_locking) which does not have a commit message explaining its
purpose (and that patch in turn depends on ea7cf49a7633).

John, is that bug present in 3.2.y and 3.0.y, too?  Any hints for
fixing it?
It looks like incrementing the TAI offset was wrong even before 

   6b43ae8a ntp: Fix leap-second hrtimer livelock  v3.4-rc1~44^2~9

The offset should change upon entering state OOP, so something like
the following (untested) patch should fix it for 3.2.9.

Thanks,
Richard

---
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index f6117a4..d7bd953 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -365,6 +365,7 @@ static enum hrtimer_restart ntp_leap_second(struct hrtimer *timer)
 		break;
 	case TIME_INS:
 		timekeeping_leap_insert(-1);
+		time_tai++;
 		time_state = TIME_OOP;
 		printk(KERN_NOTICE
 			"Clock: inserting leap second 23:59:60 UTC\n");
@@ -379,7 +380,6 @@ static enum hrtimer_restart ntp_leap_second(struct hrtimer *timer)
 			"Clock: deleting leap second 23:59:59 UTC\n");
 		break;
 	case TIME_OOP:
-		time_tai++;
 		time_state = TIME_WAIT;
 		/* fall through */
 	case TIME_WAIT:
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help