All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Ge Gao <GGao@invensense.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: unreliable time function inside IRQ?
Date: Mon, 31 Mar 2014 21:07:08 +0200	[thread overview]
Message-ID: <5339BCDC.80609@metafoo.de> (raw)
In-Reply-To: <E7747D604FBC9F43A71AA431AFF4476225780BE2@IUSEXCH01.invcorp.invensense.com>

On 03/31/2014 07:44 PM, Ge Gao wrote:
> Dear Jonathan,
> 	Thanks for answering my question. I am using Panda board(OMAP4430). It is using a 32K counter clock as the high resolution clock(arch/arm/plat-omap/couter_32k.c). But I also observe the same thing in Nexus 7 first generation(announced in 2012), which uses Nvidia Tegra 3 platform. I suspect the data that represents the time is cached, or it is using some older value in the interrupt case.
> It could be the Linux's time function problem. Is that possible? I actually tried using Jiffy, which is the built-in software clock. The time between each interrupt also varies big. My HZ setting is 1000. I also tried a later version of Linux, which is 3.7 or later. The result is the same.
> 	The implementation of the time function is very simple. Below is the function from 32K clock counter. It is reading the hardware clock, compute the difference between a static variable and update the time. For a different clock, only the "clocksource_32k.mult", "clocksource_32k.shift", would be different.
> 	Thanks.

You have to consider that there will be other things running with IRQs off, 
which will cause some jitter for your IRQ handler. This is nothing IIO specific.

- Lars

  reply	other threads:[~2014-03-31 19:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 21:56 unreliable time function inside IRQ? Ge Gao
2014-03-29 11:05 ` Jonathan Cameron
2014-03-31 17:44   ` Ge Gao
2014-03-31 19:07     ` Lars-Peter Clausen [this message]
2014-03-31 21:25       ` Ge Gao

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=5339BCDC.80609@metafoo.de \
    --to=lars@metafoo.de \
    --cc=GGao@invensense.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.