public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Rodolfo Giometti <giometti@enneenne.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: LinuxPPS low-level IRQs timestamps & ldisc
Date: Mon, 2 Jun 2008 07:51:13 +0100	[thread overview]
Message-ID: <20080602075113.60d0fdf8@core> (raw)
In-Reply-To: <20080601161510.GA26854@enneenne.com>

> First I added a new dcd_change() ldisc method which can be used as
> follow:

This looks good.
> 
> static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status)
> {
>        int id = (int) tty->disc_data;
>        struct timespec __ts;
>        struct pps_ktime ts;
> 
>        /* First of all we get the time stamp... */
>        getnstimeofday(&__ts);
> 
>        /* ... and translate it to PPS time data struct */
>        ts.sec = __ts.tv_sec;
>        ts.nsec = __ts.tv_nsec;
> 
>        /* Now do the PPS event report */
>        pps_event(id, &ts,
>                        status ? PPS_CAPTUREASSERT : PPS_CAPTURECLEAR, tty);
> 
>        pr_debug("[STDev] PPS %s at %lu on source #%d\n",
>                        status ? "assert" : "clear", jiffies, id);
> }
> 
> However this solution gives very low precision timestamps so that's

Where are you calling it from, and how ?

> 2) The new dcd_change() method is well implemented? Can I add the
> "irq" parameter or I can find it somewhere?

Not all tty devices have an IRQ (I suspect those which do not are useless
for PPS reporting however). 

Do you get decent reports if you change the tty driver to do

	getnstimeofday(&ts);
	[blah blah lots of serial port I/O code]
	if (dcd ^ old_dcd)
		ld->dcd_change(tty, dcd, &ts);

??

Alan

  parent reply	other threads:[~2008-06-02  7:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-01 16:15 LinuxPPS low-level IRQs timestamps & ldisc Rodolfo Giometti
2008-06-01 19:26 ` Lennart Sorensen
2008-06-02  6:51 ` Alan Cox [this message]
2008-06-02  9:25   ` Rodolfo Giometti
2008-06-02 14:02     ` Alan Cox
2008-06-02 14:56       ` Rodolfo Giometti
2008-06-02 15:48         ` Alan Cox
2008-06-02 17:22           ` Rodolfo Giometti
2008-06-02 19:35             ` Alan Cox
2008-06-02 20:21             ` Matti Aarnio
2008-06-03 13:40               ` Alan Cox
2008-06-02 17:09         ` Lennart Sorensen
2008-06-02 16:59           ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080602075113.60d0fdf8@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=giometti@enneenne.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox