[LinuxPPS] Bug in LinuxPPS startup

David djch-pps at whabbit.demon.co.uk
Tue Oct 28 00:07:03 CET 2008


I took the patches from LKML (resubmit 7), and applied to the gentoo version of
2.6.27 - all fine apart from creating linux/pps.h

When the pps is working, it's holding within 10us (says ntpdc), which for a machine
in an unheated building is pretty good. (Source is an old Trimble SV6 into the serial port DCD, with the TSIP parse clock in NTP)

I have found one bug - sometimes, when I run ppsldisc to set my serial
port to pps, I get a kernel oops. Looking at the code, I think I can see
what happens, but I don't understand the line discipline stuff well
enough to write a bug fix.

The kernel crashes in uart_handle_dcd_change() (inlined into
check_modem_status()), in the fourth line 

if (ld->ops->dcd_change)

I believe ld is returning 0 from tty_ldisc_ref().

The attached backtrace (sorry, I haven't the equipment to debug
remotely, hence the screen photo) shows the ioctl to enable dcd being
processed. What I think is the problem is that uart_set_ldisc() calls
serial8250_set_ldisc() which calls serial_out(), which enables the
interrupt on the 8250 (actually a 16550 in my case). If a pps interrupt
occurs before the pps discipline is fully installed, then tty_ldisc_ref
returns 0, and the machine crashes.

Not sure how the ldisc code is meant to deal with disciplines that can
be invoked as soon as they are enabled at the hardware level

Happy to gather more data if you can tell me what you'd need. My machine
is an AMD Athlon 1300 MHz single core, 512M of RAM.

--David Hutchinson






-------------- next part --------------
A non-text attachment was scrubbed...
Name: trace.JPG
Type: image/jpeg
Size: 63810 bytes
Desc: not available
Url : http://ml.enneenne.com/pipermail/linuxpps/attachments/20081027/e188eb05/attachment-0001.jpeg 


More information about the LinuxPPS mailing list