[LinuxPPS] pps stops when ntpd starts?

William S. Brasher billb958 at door.net
Wed Jun 10 12:57:13 CEST 2009


On Wed, 10 Jun 2009, Rodolfo Giometti wrote:

> On Tue, Jun 09, 2009 at 01:04:50PM -0500, William S. Brasher wrote:
> > On Tue, 9 Jun 2009, Rodolfo Giometti wrote:
> > 
> > > 
> > > As you can see ldattach calls ioctl() while pps does not.
> > > 
> > > The problem can be in serial8250_set_termios() if CTS flow control is
> > > disabled...
> > > 
> > > Can you please add a printk() into serial8250_set_ldisc() and into
> > > serial8250_enable_ms() in drivers/serial/8250.c in order to see if the
> > > functions are called or not and with which parameters' value?
> > > 
> > > Ciao,
> > > 
> > > Rodolfo
> > > 
> > 
> > I stuck a printk in the two functions and neither function was called.
> 
> That's quite strange... =:-o can I see the code you added (just send
> diff output).
> 
> Function serial8250_set_ldisc() should be cale each time the ldisc is
> changed.
> 


Ok:  Since I'm playing in a place I haven't been, I rebuilt the kernel and 
tried again.  And, of course, the functions are being called:

First, the diff:

--- drivers/serial/8250.c.org   2009-05-20 19:11:06.000000000 -0500
+++ drivers/serial/8250.c       2009-06-10 05:18:41.000000000 -0500
@@ -1360,6 +1360,10 @@
 {
        struct uart_8250_port *up = (struct uart_8250_port *)port;
 
+
+printk("serial8250_enable_ms %p\n",port);
+
+
        /* no MSR capabilities */
        if (up->bugs & UART_BUG_NOMSR)
                return;
@@ -2401,6 +2405,9 @@
 {
        int line = port->line;
 
+printk("serial8250_set_ldisc %p  line = %d",port,line);
+
+
        if (line >= port->info->port.tty->driver->num)
                return;
 

Generates this:

The first time is from running "/usr/sbin/ppsldisc /dev/ttyS0" and the 
second time is from running "ldattach 18 /dev/ttyS0".

ppstest works after ntpd was started in the first case, and timed out 
after ntpd was started in the second case.


Jun 10 05:37:36 tara kernel: PPS source #0 "/dev/ttyS0" added
Jun 10 05:37:36 tara kernel: serial8250_set_ldisc c04688d4  line = 0serial8250_enable_ms c04688d4
Jun 10 05:39:34 tara kernel: PPS source #0 removed
Jun 10 05:40:02 tara kernel: new PPS source serial0 at ID 0
Jun 10 05:40:02 tara kernel: PPS source #0 "/dev/ttyS0" added
Jun 10 05:40:02 tara kernel: serial8250_set_ldisc c04688d4  line = 0serial8250_enable_ms c04688d4


Bill.




More information about the LinuxPPS mailing list