still no reliable assert, was Re: [LinuxPPS] debug output

Rodolfo Giometti giometti at enneenne.com
Mon Feb 26 00:11:49 CET 2007


On Sun, Feb 25, 2007 at 09:14:30AM -0800, gnu not unix wrote:

> Uuh let me reboot the test unit...
> 
> Hm interesting. Steps:
> 
> boot. setserial hardpps. ppstest.
> 
> The ppstest worked fine!

Good.

> Cool.
> 
> Uuh however---
> 
> I then did cat</sys/class/pps/00/assert
> 
> ...and now ppstest no longer increments on assert. No Joy.
> 
> (cuts/pastes):
> 
> root at boomer.wraith.sf.ca.us[519] ./ppstest 
> found PPS source #0 "serial0" on "/dev/ttyS0"
> assert 1172423250.912159778, sequence: 13 - clear  1172423250.912287332, sequence: 13
> assert 1172423251.912196654, sequence: 14 - clear  1172423251.912290684, sequence: 14
> assert 1172423252.912205034, sequence: 15 - clear  1172423252.912294035, sequence: 15
> 
> 
> root at boomer.wraith.sf.ca.us[521] cat</sys/class/pps/00/assert 
> 1172423252.912205034#15
> root at boomer.wraith.sf.ca.us[522] cat</sys/class/pps/00/assert 
> 1172423252.912205034#15
> 
> 
> root at boomer.wraith.sf.ca.us[524] ./ppstest 
> found PPS source #0 "serial0" on "/dev/ttyS0"
> assert 1172423252.912205034, sequence: 15 - clear  1172423278.912597407, sequence: 16
> assert 1172423252.912205034, sequence: 15 - clear  1172423279.912604949, sequence: 17
> assert 1172423252.912205034, sequence: 15 - clear  1172423280.912613329, sequence: 18

??? =:-o

Let me understand... first run of ppstest everything works ok. Then
you run cat and when rerun ppstest you got the old behaviour?

What about the kernel messages? The IRQ settings has been changed
after first ppstest run and the second one?

> UUhh another "gotcha" is if you:
> 
> root at boomer.wraith.sf.ca.us[528] echo "1" > /sys/class/pps/00/echo
> 
> I had to blow the ssh session away to get out of that!

Try this patch:

diff --git a/drivers/pps/sysfs.c b/drivers/pps/sysfs.c
index 136cdbc..4206450 100644
--- a/drivers/pps/sysfs.c
+++ b/drivers/pps/sysfs.c
@@ -91,12 +91,12 @@ static ssize_t pps_show_path(struct class_device *cdev, char }
 
 static struct class_device_attribute pps_class_device_attributes[] = {
-       DECLARE_INFO_ATTR(assert, 0644, pps_show_assert, NULL),
-       DECLARE_INFO_ATTR(clear, 0644, pps_show_clear, NULL),
-       DECLARE_INFO_ATTR(mode, 0644, pps_show_mode, NULL),
-       DECLARE_INFO_ATTR(echo, 0644, pps_show_echo, NULL),
-       DECLARE_INFO_ATTR(name, 0644, pps_show_name, NULL),
-       DECLARE_INFO_ATTR(path, 0644, pps_show_path, NULL),
+       DECLARE_INFO_ATTR(assert, 0444, pps_show_assert, NULL),
+       DECLARE_INFO_ATTR(clear, 0444, pps_show_clear, NULL),
+       DECLARE_INFO_ATTR(mode, 0444, pps_show_mode, NULL),
+       DECLARE_INFO_ATTR(echo, 0444, pps_show_echo, NULL),
+       DECLARE_INFO_ATTR(name, 0444, pps_show_name, NULL),
+       DECLARE_INFO_ATTR(path, 0444, pps_show_path, NULL),
 };
 
 /* ----- Class definitions -------------------------------------------- */

Ciao,

Rodolfo

-- 

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



More information about the LinuxPPS mailing list