[LinuxPPS] PPS - problem identified and ugly solution

Rodolfo Giometti giometti at enneenne.com
Fri Jun 27 00:01:21 CEST 2008


On Thu, Jun 26, 2008 at 03:42:27PM -0600, clemens at dwf.com wrote:
> 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...

This is quite strange... in the PPS ldisc there is nothing I can think
to...

I think is better doing some steps:

1) Now I'm releasing the new LinuxPPS version 5.3.0. Test it.

2) If 1) is ok I'll update the kernel to 2.6.26-rc8 and release
LinuxPPS version 5.3.1. Test it.

3) If 2) is ok we can verify if your problem still happen.

Then we can decide for a new patch-set for kernel inclusion. :)

What do you think about it? :)

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti at enneenne.com
Linux Device Driver                          giometti at linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti



More information about the LinuxPPS mailing list