All of lore.kernel.org
 help / color / mirror / Atom feed
* unreliable time function inside IRQ?
@ 2014-03-25 21:56 Ge Gao
  2014-03-29 11:05 ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Ge Gao @ 2014-03-25 21:56 UTC (permalink / raw)
  To: Lars-Peter Clausen, Jonathan Cameron; +Cc: linux-iio@vger.kernel.org

Dear all,
	Had to bring this question again to see whether anyone see the same problem. IIO fetches the timestamp inside IRQ using iio_get_time_ns(), which in turn call ktime_get_real_ts(&ts). However, I notice that the clock taken during interrupt is not always reliable. Sometimes the clock does not update. It is updated after one or more interrupts. It is very easy to reproduce. First find a hardware generating fixed interval of interrupts and using IIO driver to run it. Print out the timestamp. You could find that the timestamp distance is not always correct. For example, if you run a 5 Hz interrupt, most of time you will interrupt timestamp interval is around 200ms. However, sometimes, you could see interval sequence like ...200, 192, 208, 200, 200, 182, 218, 200.......
I searched online and only found one result, which is exactly the same as I observed. Below is the link:
http://stackoverflow.com/questions/17080516/unable-unreliable-to-use-clock-gettime-in-hard-irq-context
But no one answer the question.
	Is there anyone see the same problem? Thanks.

Best Regards,

Ge GAO


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-31 21:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-03-31 21:25       ` Ge Gao

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.