I am writing a device driver to monitor mains inputs (50 or 60Hz a.c) . Ideally I need
an interrupt every 2mS.
The Clock tick on the standard timer wheel in picomod is 200HZ or 5mS.
This is just a bit too slow.
I have been trying to use hrtimers, a relatively new feature in the kernel.
I have a callback function which works when returning HR_NORESTART for the first
call. IF I return HR_RESTART from the callback, the linux system simply hangs.
I placed a guard variable on this and allowed it to return HR_RESTART a few times,
and then to send back HR_NORESTART.
It did this, but the first interrupt took the designated time.
The next ones all happened very very quickly.
Obviously the linux lock up was due to the fact that the kernel was in a cyclic interrupt loop.
Does anyone know how to retrigger the hrtimers while in the call back function ?
Do they need to be re-triggered ?