public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Gordeev <lasaine@lvk.cs.msu.su>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
	"Nikita V\\. Youshchenko" <yoush@cs.msu.su>,
	linuxpps@ml.enneenne.com,
	Rodolfo Giometti <giometti@enneenne.com>,
	John Stultz <johnstul@us.ibm.com>,
	David Howells <dhowells@redhat.com>,
	"H\\. Peter Anvin" <hpa@zytor.com>,
	Magnus Damm <damm@opensource.se>,
	Jason Wessel <jason.wessel@windriver.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCHv5 14/17] pps: capture MONOTONIC_RAW timestamps as well
Date: Thu, 25 Nov 2010 12:55:28 +0300	[thread overview]
Message-ID: <20101125125528.38f84c81@apollo.gnet> (raw)
In-Reply-To: <alpine.LFD.2.00.1011241746500.2900@localhost6.localdomain6>

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

В Wed, 24 Nov 2010 17:49:44 +0100 (CET)
Thomas Gleixner <tglx@linutronix.de> пишет:

> On Wed, 24 Nov 2010, Alexander Gordeev wrote:
> >  /**
> > + * getnstime_raw_and_real - Returns both the time of day an raw
> > + * monotonic time in a timespec format
> 
> IIRC then kerneldoc does not handle multiline comments for the
> function name

Ah, I see, fixed that.

> > + * @ts_mono_raw:	pointer to the timespec to be set to raw
> > + *			monotonic time
> > + * @ts_real:		pointer to the timespec to be set to the time
> > + *			of day
> > + */
> > +void getnstime_raw_and_real(struct timespec *ts_raw, struct timespec *ts_real)
> > +{
> > +	unsigned long seq;
> > +	s64 nsecs_raw, nsecs_real;
> > +
> > +	WARN_ON_ONCE(timekeeping_suspended);
> 
>   Shouldn't this just return an error code instead of reading some
>   stale or random value ?

Sorry, I don't know if it should, just copied it from getnstimofday().
BTW what is the bad value for timespec or you mean returning int
instead of void? I think this function should be handled the same way as
getnstimeofday() and no one currently expects that the latter can return
some bad value.

> > +	do {
> > +		u32 arch_offset;
> > +
> > +		seq = read_seqbegin(&xtime_lock);
> > +
> > +		*ts_raw = raw_time;
> > +		*ts_real = xtime;
> > +
> > +		nsecs_raw = timekeeping_get_ns_raw();
> > +		nsecs_real = timekeeping_get_ns();
> > +
> > +		/* If arch requires, add in gettimeoffset() */
> > +		arch_offset = arch_gettimeoffset();
> > +		nsecs_raw += arch_offset;
> > +		nsecs_real += arch_offset;
> > +
> > +	} while (read_seqretry(&xtime_lock, seq));
> > +
> > +	timespec_add_ns(ts_raw, nsecs_raw);
> > +	timespec_add_ns(ts_real, nsecs_real);
> > +}
> > +EXPORT_SYMBOL(getnstime_raw_and_real);
> 
> Otherwise, I'm fine with that.
> 
> Thanks,
> 
> 	tglx


-- 
  Alexander

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2010-11-25  9:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 16:15 [PATCHv5 00/17] pps: several fixes and improvements Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 01/17] pps: trivial fixes Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 02/17] pps: declare variables where they are used in switch Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 03/17] pps: fix race in PPS_FETCH handler Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 04/17] pps: unify timestamp gathering Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 05/17] tty: don't allow ldisc dcd_change() after ldisc halt Alexander Gordeev
2010-11-24 16:43   ` Alan Cox
2010-11-24 22:38     ` Alexander Gordeev
2010-11-24 22:36       ` Alan Cox
2010-11-25 13:30         ` Alexander Gordeev
2010-11-25 14:03           ` Alan Cox
2010-12-15 16:13             ` Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 06/17] pps: access pps device by direct pointer Alexander Gordeev
2010-12-16 15:52   ` Rodolfo Giometti
2010-12-16 21:58     ` Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 07/17] pps: convert printk/pr_* to dev_* Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 08/17] pps: move idr stuff to pps.c Alexander Gordeev
2010-12-16 15:53   ` Rodolfo Giometti
2010-11-24 16:15 ` [PATCHv5 09/17] pps: do not disable interrupts for idr operations Alexander Gordeev
2010-12-16 15:53   ` Rodolfo Giometti
2010-11-24 16:15 ` [PATCHv5 10/17] pps: use BUG_ON for kernel API safety checks Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 11/17] pps: simplify conditions a bit Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 12/17] pps: timestamp is always passed to dcd_change() Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 13/17] ntp: add hardpps implementation Alexander Gordeev
2010-11-24 16:15 ` [PATCHv5 14/17] pps: capture MONOTONIC_RAW timestamps as well Alexander Gordeev
2010-11-24 16:49   ` Thomas Gleixner
2010-11-25  9:55     ` Alexander Gordeev [this message]
2010-11-24 16:15 ` [PATCHv5 15/17] pps: add kernel consumer support Alexander Gordeev
2010-12-16 15:55   ` Rodolfo Giometti
2010-11-24 16:15 ` [PATCHv5 16/17] pps: add parallel port PPS client Alexander Gordeev
2010-12-16 15:58   ` Rodolfo Giometti
2010-11-24 16:15 ` [PATCHv5 17/17] pps: add parallel port PPS signal generator Alexander Gordeev
2010-12-16 16:02   ` Rodolfo Giometti

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=20101125125528.38f84c81@apollo.gnet \
    --to=lasaine@lvk.cs.msu.su \
    --cc=akpm@linux-foundation.org \
    --cc=damm@opensource.se \
    --cc=dhowells@redhat.com \
    --cc=giometti@enneenne.com \
    --cc=hpa@zytor.com \
    --cc=jason.wessel@windriver.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxpps@ml.enneenne.com \
    --cc=tglx@linutronix.de \
    --cc=yoush@cs.msu.su \
    /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