[LinuxPPS] delay through the irq code

Rodolfo Giometti giometti at enneenne.com
Fri Apr 11 10:41:25 CEST 2008


On Fri, Apr 11, 2008 at 03:17:45PM +1000, James Boddington wrote:
> I have been using my own time stamp which I am slowly moving lower in the irq 
> code. I have the 1pps connected to the DCD.
> 
> +127.127.20.0    .GPS.            0 l    -   16  377    0.000   -0.007   0.001
> o127.127.22.1    .PPS.            0 l   11   16  377    0.000    0.000   0.001
> 
> 127.127.20.0 is the linuxpps time stamp and 127.127.22.1 is my time stamp.
> 
> 1. signal hits DCD
> 2. unknown delay
> 3. handle_level_irq() in kernel/irq/chip.c
> 4. handle_IRQ_event() in kernel/irq/handle.c
> 5. serial8250_interrupt()in drivers/serial/8250.c
> 6. serial8250_handle_port() in drivers/serial/8250.c
> 7. check_modem_status() in drivers/serial/8250.c
> 8. uart_handle_dcd_change() defined in include/linux/serial_core.h
> 9. pps_event() in drivers/pps/kapi.c
> 
> The time stamp for 127.127.22.1 is taken at the start of handle_level_irq(). 
> There is a 7us delay from there to when the time stamp is taken in pps_event(). 
> This is with a p3-600 coppermine. Just from handle_level_irq() to 
> handle_IRQ_event() is 2us.
> 
> A 10 minute plot is at http://aiken.dnsalias.org/irq-pps.png
> 
> With the data for that plot the handle_level_irq() time stamp has an average of 
>    466ns and standard deviation of 183 and the pps_event() time stamp has an 
> average of 7598ns and standard deviation of 474.
> 
> With my hardware and to use the serial linuxpps time stamp I would want fudge 
> time1 0.000007 to compensate for the delay through the irq code. This just 
> leaves the unknown delay from the signal hitting dcd to handle_level_irq() 
> being called to be determined.

This is the new issue about LinuxPPS!

First of all let's see this message:

   http://lkml.org/lkml/2008/4/10/312

then we should consider that Linux is a complex system and we cannot
put our code where we wish... your solution is better then current
one, I agree, but we should find a good way to implement it into Linux
code, otherwise PPS support will remain a patch forever. :'(

Can you please show us your modifications?

However consider the fact that all these problems arise because the
DCD pin is just a weak solution. Better hardware solution is using a
dedicated CPU pin for PPS signal... in this case you can provide a
special PPS client which can be directly executed by
handle_IRQ_event() (or better, I'm just thinking at Fast IRQ on ARM
systems - see linux/arch/arm/kernel/fiq.c).

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at linux.it
Embedded Systems                     phone:	+39 349 2432127
UNIX programming                     skype:     rodolfo.giometti



More information about the LinuxPPS mailing list