[RFC] Event timers on MIPS

Neel Natu neelnatu at gmail.com
Thu Jul 22 16:01:39 UTC 2010


Hi Alexander,

On Thu, Jul 22, 2010 at 2:00 AM, Alexander Motin <mav at freebsd.org> wrote:
> Neel Natu wrote:
>> On Wed, Jul 21, 2010 at 10:36 PM, Alexander Motin <mav at freebsd.org> wrote:
>>> New patch: http://people.freebsd.org/~mav/timers_mips3.patch
>>
>> In clock_intr() it would seem that the last 'et_event_cb()' should be
>> called conditionally only if (cycles_per_tick > 0). Of course, this is
>> necessary only if my explanation about spurious clock_intr()
>> invocations is correct.
>
> cycles_per_tick == 0 except spurious interrupt may also mean one-shot
> timer operation mode. In such case callback should be called on
> interrupt, but timer should be stopped after that. To protect from
> counter still running after stop (if needed) - probably we need one more
> variable, or define some specific cycles_per_tick value.
>
> I am not actually sure if writing 0xffffffff stops timer. I've just seen
> it somewhere else. What is the proper way there to really stop the timer
> to avoid spurious interrupt?
>

Writing 0xffffffff to compare register does not stop the timer nor the
timer compare interrupt.The only way to stop the timer interrupt is to
mask it in the status register.

Having said that I cannot see why we would ever call clock_stop() for
the mips timer.

I think you should commit the code you have right now and then we can
work offline to see if the spurious clock interrupt is really a
problem in practice or just a theoretical possibility.

best
Neel

>> I have tested the latest patch on the Sibyte as well and it works correctly.
>
> Thanks.
>
> --
> Alexander Motin
>


More information about the freebsd-mips mailing list