Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1581356

[PATCH 2/8] ntp/pps: ignore pps_valid decreasing if there is no pps signal.

From Andrey Drobyshev <immortalguardian1@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/8] ntp/pps: ignore pps_valid decreasing if there is no pps signal.
Date 2017-02-15 15:40 +0100
Message-ID <tb8Uq-1ae-17@gated-at.bofh.it> (permalink)
References <tb8Up-1ae-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Alexander GQ Gerasiov <gq@cs.msu.su>

In case pps_dec_valid() is called from second_overflow() in the
absence of pps signal, there is no need to decrease pps_valid.

Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
---
 kernel/time/ntp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index d20891e..22f2235 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -154,6 +154,10 @@ static inline void pps_clear(void)
  */
 static inline void pps_dec_valid(void)
 {
+	/* Silently ignore if PPS was not turned on */
+	if (!(time_status & STA_PPSSIGNAL))
+		return;
+
 	if (pps_valid > 0)
 		pps_valid--;
 	else {
-- 
2.1.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] LinuxPPS: some minor fixes and improvements. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 6/8] LinuxPPS: pps_parport: Ignore interrupt invoked less than 0.5sec after previous. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 2/8] ntp/pps: ignore pps_valid decreasing if there is no pps signal. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 8/8] LinuxPPS: pps_gen_parport: Add check for bad clocksource. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 4/8] LinuxPPS: kapi: Unlock before waking up events queue in pps_event(). Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 5/8] LinuxPPS: pps_parport: Do not generate assert in case of lost signal. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 7/8] LinuxPPS: pps_gen_parport: Add polarity parameter for inverted signal. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100
  [PATCH 3/8] hardpps: fix some pps_jitter issues. Andrey Drobyshev <immortalguardian1@gmail.com> - 2017-02-15 15:40 +0100

csiph-web