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

2017-03-04 Thread Rodolfo Giometti

On 02/15/17 15:31, Andrey Drobyshev wrote:

From: Alexander GQ Gerasiov 

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 


Acked-by: Rodolfo Giometti 


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

2017-03-04 Thread Rodolfo Giometti

On 02/15/17 15:31, Andrey Drobyshev wrote:

From: Alexander GQ Gerasiov 

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 


Acked-by: Rodolfo Giometti 


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

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov 

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 
---
 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



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

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov 

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 
---
 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