From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Prevent decrementer clockevents from firing early
Date: Tue, 09 Oct 2007 10:34:16 +1000 [thread overview]
Message-ID: <1191890056.6355.40.camel@pasglop> (raw)
In-Reply-To: <18186.50261.275896.847277@cargo.ozlabs.ibm.com>
On Tue, 2007-10-09 at 09:59 +1000, Paul Mackerras wrote:
> On old powermacs, we sometimes set the decrementer to 1 in order to
> trigger a decrementer interrupt, which we use to handle an interrupt
> that was pending at the time when it was re-enabled. This was causing
> the decrementer clock event device to call the event function for the
> next event early, which was causing problems when high-res timers were
> not enabled.
>
> This fixes the problem by recording the timebase value at which the
> next event should occur, and checking the current timebase against the
> recorded value in timer_interrupt. If it isn't time for the next
> event, it just reprograms the decrementer and returns.
>
> This also subtracts 1 from the value stored into the decrementer,
> which is appropriate because the decrementer interrupts on the
> transition from 0 to -1, not when the decrementer reaches 0.
>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
> ---
Do we also need to handle lost ticks ? That is loop & do multiple events
like we used to do with the previous implementation ?
Cheers,
Ben.
prev parent reply other threads:[~2007-10-09 0:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 23:59 [PATCH] Prevent decrementer clockevents from firing early Paul Mackerras
2007-10-09 0:34 ` Benjamin Herrenschmidt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1191890056.6355.40.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).