[LinuxPPS] Experience with current linuxPPS kernel patch.

clemens at dwf.com clemens at dwf.com
Thu Mar 4 04:03:55 CET 2010


Alexander Gordeev has released a merged version of his and Rodolfo's patches
as patch-2.6.33-pps536-ts12.tar.gz .

It is not obvious to me what version of Rodolfo's patch this incorporates,
but I will assume it is one of the more recent.  (I tried diff'ing various
pieces w/o success)

In any case, this includes his kernel patch and his paralell port patch.
I cant test the parallel port patch, but have been running the kernel patch
and a serial PPS source.

And let me start by saying that this seems to work well with/without
the kernel code tuned on, and on 32/64bit machines running Fedora11.
I am not getting quite the accuracy I would expect (see below).

[[ I did have problems with previous versions, so if you are trying to
run a previous version, you want this one. ]]

OK, (minor) patch errors:

Patching the file Documentation/ioctl/ioctl-number.txt fails
its looking for an upper case A1-A4 and its a1-a4 in the file.

(thats it, nothing that will affect the compile).

OK, Compile errors:

In the file common.c (you dont have to know where it is) the include
file pps_kernel.h is included TWICE, with lots of errors generated
by gcc about 'error: redefinition of ...'

I didnt bother to find HOW it was being included twice, but just
went to pps_kernel.h and put a

        #ifndef PPS_DEFINES
        #define PPS_DEFINES

        ...

        #endif

arround the text in the file.

On the 64 bit machine there are the following compile errors
(tho the code works)

drivers/pps/clients/pps-ldisc.c: In function 'pps_tty_dcd_change':
drivers/pps/clients/pps-ldisc.c:32: warning: cast from pointer to integer of 
different size
drivers/pps/clients/pps-ldisc.c: In function 'pps_tty_open':
drivers/pps/clients/pps-ldisc.c:73: warning: cast to pointer from integer of 
different size
drivers/pps/clients/pps-ldisc.c:78: warning: cast from pointer to integer of 
different size
drivers/pps/clients/pps-ldisc.c: In function 'pps_tty_close':
drivers/pps/clients/pps-ldisc.c:89: warning: cast from pointer to integer of 
different size

This is going to take more effort on Rodolfo's part, since there is
an implicit implication in the code that pointers and integers are
equivalent.  Pointers are first converted to integers, then the integer
is passed as the argument to a function.  Mumph.

Changing the integers to long's would be a start, but it would be cleaner
to treat pointers as pointers throughout.  This would be more work since it 
requires
changes not only to pps-ldisc.c but to the include files (but the int -> long 
requires
that anyway).

>>> Thats about it <<<

Its running.

I still have the feeling that something is not quite right (but mabe elsewhere 
in
the kernel code) since the accuracy is just about 1us.  That is, the 'fuzz' of
the timestamps around the mean is just about 1us.  I would expect a factor
of x10 better than that, and would not be surprised if there is not still some
bad ns <-> us conversions in the kernel.

                                                Reg.Clemens
                                                reg at dwf.com





More information about the LinuxPPS mailing list