[LinuxPPS] ntp-dev-4.2.5p237-RC does sync with PPS for me
Rodolfo Giometti
giometti at enneenne.com
Wed Oct 28 11:51:01 CET 2009
On Wed, Oct 28, 2009 at 03:37:37AM -0600, clemens at dwf.com wrote:
>
> A second problem is that when I do a getcap in a first process, I see 1133,
> fine.
> I set the mode 1003 with setparams.
> and a getparams returns 0x33.
>
> HOWEVER, if I do a setparam of 1011 in ntp (first process)
> and then do a setparam of 1003 in ppsapitest (second process)
> I see a getparams of 1111.
>
> Now two things, first I would expect to see the 0x1000 bit set in the
> first getparams.
>
> And more important I never set the 0x30 bits, so they should be off.
>
> On the 2nd processes getparams I have set ASSERT/CLEAR (0x3) but dont
> see it, and the offset bit is again on.
One issue is this one for surely, but I don't know if it's
risolutive...
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index fea17e7..6d35b68 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -71,9 +71,15 @@ static long pps_cdev_ioctl(struct file *file,
case PPS_GETPARAMS:
pr_debug("PPS_GETPARAMS: source %d\n", pps->id);
+ spin_lock_irq(&pps->lock);
+
+ /* Get the current parameters */
+ params = pps->params;
+
+ spin_unlock_irq(&pps->lock);
+
/* Return current parameters */
- err = copy_to_user(uarg, &pps->params,
- sizeof(struct pps_kparams));
+ err = copy_to_user(uarg, ¶ms, sizeof(struct pps_kparams));
if (err)
return -EFAULT;
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
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it
More information about the LinuxPPS
mailing list