[PATCH 1/8] hardpps: simple fixes replacing clumsy code with abs() macro.

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov Here are some trivial fixes, including: * simplify comparisons by using abs() macro * remove unnecessary variables * remove duplicate headers * fix typos Signed-off-by: Alexander GQ Gerasiov --- kernel/time/ntp.c | 16 +--- 1 file changed, 5 inse

[PATCH 8/8] LinuxPPS: pps_gen_parport: Add check for bad clocksource.

2017-02-15 Thread Andrey Drobyshev
From: Nikita Edward Baruzdin This commit is supposed to resolve the issue with hard lockups on systems using jiffies as their clock source. Namely, it sets limits on number of iterations clock source may remain unchanged (i. e. not being updated for one reason or another, as it is with jiffies cl

[PATCH 4/8] LinuxPPS: kapi: Unlock before waking up events queue in pps_event().

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov Otherwise we get "scheduling while atomic" problem. Signed-off-by: Alexander GQ Gerasiov --- drivers/pps/kapi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c index 805c749..a9a111d 100644 --- a/driv

[PATCH 7/8] LinuxPPS: pps_gen_parport: Add polarity parameter for inverted signal.

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov On some devices it may be necessary to transmit inverted data. This commit simply adds polarity parameter to define which state represents presence of signal: it equals 0 if signal is on the low level (default), or 1 if signal is on the high level (inverted signal). S

[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/kern

[PATCH 5/8] LinuxPPS: pps_parport: Do not generate assert in case of lost signal.

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov Since clear timeout is non-zero, some clear event capture is requested. Therefore, if signal is lost we shouldn't generate assert event alone. Signed-off-by: Alexander GQ Gerasiov --- drivers/pps/clients/pps_parport.c | 5 - 1 file changed, 4 insertions(+), 1 de

[PATCH 6/8] LinuxPPS: pps_parport: Ignore interrupt invoked less than 0.5sec after previous.

2017-02-15 Thread Andrey Drobyshev
From: Alexander GQ Gerasiov On some devices interrupt may be invoked by parasitic assert event produced while switching from high to low. Such interrupt should be ignored. Signed-off-by: Alexander GQ Gerasiov --- drivers/pps/clients/pps_parport.c | 9 - 1 file changed, 8 insertions(+),

[PATCH 0/8] LinuxPPS: some minor fixes and improvements.

2017-02-15 Thread Andrey Drobyshev
Hello folks, We are using PPS subsystem with kernel consumer in our long-lasting project. (To be precise, kernel consumer and most of PPS drivers was included in vanilla kernel by one of our employee Alexander Gordeev). During the last years we have fixed dozen of issues and made some improvement

[PATCH 3/8] hardpps: fix some pps_jitter issues.

2017-02-15 Thread Andrey Drobyshev
Handle possible overflow, implementation-defined result of signed right shift and replace unsuitable constant. Signed-off-by: Andrey Drobyshev Signed-off-by: Alexander GQ Gerasiov --- kernel/time/ntp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/time/ntp.c b