[LinuxPPS] LinuxPPS 5.3.2 strange behaviour

George Spelvin linux at horizon.com
Tue Sep 30 22:00:04 CEST 2008


I've been trying to get linuxpps 5.3.2 working.

On a new quad-core amd64 system, I did the following:

- Fetch Linux kernel 2.6.27-rc7 from Linus's git tree
- Fetch linuxpps-v5.3.2 from the linuxpps git tree
  (based on v2.6.27-rc3-464-g1fca254)
- Apply a few, unrelated local patches (notably the EDAC quilt stack)
  on top of Linus's tree.
- Merge in linuxpps-v5.3. 
- Ensure /usr/include/sys/timepps.h is a symlink to
  /usr/src/linux/Documentation/pps/timepps.h, and /usr/include/linux
  is a symlink to /usr/src/linux/include/linux (and .../asm, and yes,
  that's the directory I have the current kernel in)
- Fetch ntp-dev-4.2.5p135 from the NTP development ftp
- Compile and install
- Compile the /usr/src/linux/Documentation/pps programs.
- Run ttyldisc /dev/ttyS1

Now things get peculiar...

- Running ppsldisc creates pps0, and /sys/class/pps/pps0/{assert,clear}
  start incrementing.
- Starting ntpd causes /sys/class/pps/pps0/{assert,clear} to STOP incrementing.
  ntpd assigns a reachability of 0 to the PPS peer.
- Stopping ntpd causes assert to keep incrementing, but clear rarely if
  ever increments.  (Note that it's a 10 us pulse, and this would be expected
  from 10 us interrupt latency missing the "clear" edge.)
  This produces output like:
	assert:	1222762974.001136739#219
	clear:	1222762963.001112475#112
- Restarting ntpd stops them again.

I should note that it's a PCI serial port, which shares an interrupt
with my main (motherboard chipset) AHCI SATA controller.

04:02.0 Serial controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01) (prog-if 02)
        Subsystem: LSI Logic / Symbios Logic Device 0001
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 22
        Region 0: I/O ports at e400 [size=8]
        Region 1: I/O ports at e000 [size=8]
        Region 2: I/O ports at d800 [size=8]
        Region 3: I/O ports at d400 [size=8]
        Region 4: I/O ports at d000 [size=8]
        Region 5: I/O ports at c800 [size=16]
        Kernel driver in use: serial

/dev/ttyS1, Line 1, UART: 16550A, Port: 0xe400, IRQ: 22
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test auto_irq




On another machine, a uniprocessor x86 with two PPS devices, the crashes
I was having with an earlier kernel and linuxpps 5.3.1 have disappeared,
but I still can't get both PPS sources working at once.  Running the
second ppsldisc seems to stop the first PPS source:

$ cat /sys/class/pps/pps[01]/[ac]*
1222761581.010014261#2
1222761581.011014131#2
1222803402.194941041#41817
1222803402.000020297#41816
$ cat /sys/class/pps/pps[01]/[ac]*
1222761581.010014261#2
1222761581.011014131#2
1222803404.194883652#41819
1222803404.000020748#41818

ntpd likewise reports:
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
o127.127.22.1    .PPS.            0 l    -    4  377    0.000    0.000   0.002
 127.127.22.0    .PPS.            0 l    -    4    0    0.000    0.000   0.000
+127.127.8.1     .GPS.            0 l    6   16  377    0.000   -0.087   3.468
+127.127.29.0    .PALI.           0 l    5   16  377    0.000   -0.010   0.002

.8.1 is a the GPS serial timecode corresponding to .22.1.  .29.0 is the
Trimble Acutime 2000 using the Palisade driver whose PPS output is .22.0.

Note that the Acutime 2000 has a programmable PPS pulse, which is here set
to +10 ms offset and 1 ms width in order avoid interrupt collisions with
pps0.  There's a compensating fudge in ntp.conf.



More information about the LinuxPPS mailing list