[LinuxPPS] LinuxPPS for kernel 2.6.26

Cirilo Bernardo cirilo.bernardo at gmail.com
Tue Jul 15 13:21:03 CEST 2008


On Tue, Jul 15, 2008 at 5:32 AM, Remco den Besten <besten at gmail.com> wrote:
> Ciao Rodolfo,
>
>>>looking at your messages it seems to me that the flaying patches can
>>>be merged into main tree, is that right? Can I published a new patch
>>>against new 2.6.26? :)
>
> That would be great, but is the '&' issue to be solved? Why do I have to
> fork ttyctrl or
> ppsldisc into the 'background' here? Perhaps it would be
>  an idea that 'ttySx'-activation can be selected within the PPS driver menu.
> Then an additional tool like ppsldisc or ttyctrl will be unnecessary?.
> Perhaps also the
>  low_latency can be set automagically when selecting PPS for a ttySx  port.
>
> Something like this:
>
> (x) PPS support
>   (x) ttyS0
>   (x) ttyS1
> (m) low level IRQ stamping
>
> would be very convenient :-)
>

Well, the previous version of LinuxPPS was more convenient in that
respect, but the Linux kernel hackers made it clear they weren't happy
with the design.  Basically, LinuxPPS must not interfere with the rest
of the kernel or make parts of the kernel difficult to maintain.  The
previous patches to the serial core were thought to disturb the kernel
too much, so using a "line discipline" was suggested.  Now the kernel
code looks more beautiful, but anyone who wants to use the PPS with
the serial code has to suffer the horrible hacks.  The NTPD people
have made it clear that they will not accept any patches which only
serve a purpose for Linux and make the NTPD maintenance more
difficult.  So both the kernel and ntp people are essentially saying
"don't touch our code - do something else".

So the simplest solution is to run 'ppsldisc' from the ntp startup
script (pretend it's another daemon) and also stop it from the ntp
script.  The challenge here: how does 'ppsldisc' know which ports to
open?  It's annoying to always edit the ntpd script.  Well, we can
propose these sorts of changes to the ntpd script:

- check for a file /etc/pps/has_serial_ldisc
- if the file exists, run 'ppsldisc'
- ppsldisc should read the file /etc/pps/ppsldisc.conf (or alternative
specified on command line) which contains a list of serial ports to
open; ppsldisc can even create the 'gps*' symlink, for example:

#ppsldisc.conf
ttyS3
ttyS0

The response of ppsldisc:
1. open ttyS3, set the pps line discipline, create the symlink gps0->ttyS3
2. open ttyS0, set the pps line discipline, create the symlink gps1->ttyS0

Of course if there are other non-ttyS* GPS devices or other PPS
devices, things can get weird - but that's the exception rather than
the rule, and in such cases the admin can always arrange for those
strange PPS or GPS devices to have their drivers loaded later so that
the relation of gpsN to ppsN remains sensible.

- Cirilo



More information about the LinuxPPS mailing list