Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jul 2010 09:01:38 -0700
From:      Neel Natu <neelnatu@gmail.com>
To:        Alexander Motin <mav@freebsd.org>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: [RFC] Event timers on MIPS
Message-ID:  <AANLkTilFlZCOkvYav_OqoKC_g3wZuFdrnJ9VYrpW7e54@mail.gmail.com>
In-Reply-To: <4C48089C.1010503@FreeBSD.org>
References:  <4C41A248.8090605@FreeBSD.org> <4C4698D6.2090104@FreeBSD.org> <AANLkTinrTzPZF0NbnT2e8kf8E4KtCwXUfFH7i1nBP_kz@mail.gmail.com> <4C47D8CD.7020209@FreeBSD.org> <AANLkTinvboQiT65Nc7901uwWKUNyaNh9HbX0yuFVGpnc@mail.gmail.com> <4C48089C.1010503@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Alexander,

On Thu, Jul 22, 2010 at 2:00 AM, Alexander Motin <mav@freebsd.org> wrote:
> Neel Natu wrote:
>> On Wed, Jul 21, 2010 at 10:36 PM, Alexander Motin <mav@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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTilFlZCOkvYav_OqoKC_g3wZuFdrnJ9VYrpW7e54>