[LinuxPPS] PPS - problem identified and ugly solution

clemens at dwf.com clemens at dwf.com
Thu Jun 26 23:42:27 CEST 2008


OK, I previously mentioned some strangeness in only being able to 
open the pps device O_RDONLY in the same process as the 
change of the line discipline, but could open it O_RDWR in a
separate process.

Today I went back from testing the non-IRQ kernel to the IRQ
kernel and I couldnt get ntpd to start, not even with the O_RDONLY.
The code there (in ntpd) had been unchanged.
I set the line discipline with the ttyctrl program and it would start.

On a hunch, I went in and put a sleep(5) after the set of the line discipline
and before the open in ntpd.

With this change, it runs, and it works when I change back to O_RDWR.
I tried several restarts of ntpd, and it worked every time.

So, there seems to be some timing issue in the kernel.
Is there some place you need to wait for the line discipline to actually
get set?  The 5second delay in userland is hardly a 'solution' but
at least it points to where the problem is...

-- 
                                        Reg.Clemens
                                        reg at dwf.com





More information about the LinuxPPS mailing list