[LinuxPPS] delay through the irq code

James Boddington boddingt at internode.on.net
Fri Apr 11 07:17:45 CEST 2008


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.

-- 
    James



More information about the LinuxPPS mailing list