Re: unreliable time function inside IRQ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/03/14 21:56, Ge Gao wrote:
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.
Hi Ge,

I'm afraid I don't know the cause of this.
It's also entirely possible that other interrupts are occurring that
are delaying the processing of some of your interrupts.
The slightly interesting bit is that you seem to be getting interrupts
apparently early sometimes.  I would have expected a longer delay then
a shorter one if it was something else interfering.

It might be related to the implementation of the high resolution
timers on your platform.  Perhaps they are being updated by a high
precision, low frequency source.  Mind you, in that case I think
you'd expect to see only one value being out rather than the single
early value you appear to be seeing here.  For some reason it seems
that occasionally you are handling interrupts earlier than the
majority of the time... Odd!


What is the platform you are seeing this on?

Jonathan

Best Regards,

Ge GAO

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux