Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: [MIPS] Probe for usability of cp0 compare interrupt.
Date: Wed, 17 Oct 2007 17:46:36 +0100	[thread overview]
Message-ID: <20071017164636.GC5491@linux-mips.org> (raw)
In-Reply-To: <20071018.011033.115643462.anemo@mba.ocn.ne.jp>

On Thu, Oct 18, 2007 at 01:10:33AM +0900, Atsushi Nemoto wrote:

> > Some processors offer the option of using the interrupt on which
> > normally the count / compare interrupt would be signaled as a normal
> > interupt pin.  Previously this required some ugly hackery for each
> > system which is much easier done by a quick and simple probe.
> 
> It seems write_c0_compare(0) will not work as expected if c0_count was
> near 0xffffffff.  How about write_c0_compare(read_c0_compare()) (or
> c0_timer_ack()) ?

The two things are a know lose end.  There is a bug in some old MIPS
processors where reading one of the compare or count registers in exactly
the moment when both have identical values in the interrupt getting lost.

Will have to dig up the details on that one again before I can implement
a proper workaround ...

> Also something calculated from mips_hpt_frequency would be better than
> the magic number 0x300000.

Well, we just don't care how long it really takes - but it has to be
slow enough to work even for stuff like qemu.  Then busy wait for a
number of cycles long enough to ensure the timer will have expired to
avoid the interrupt bug.

  Ralf

  reply	other threads:[~2007-10-17 16:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <S20022491AbXJQLKE/20071017111004Z+82239@ftp.linux-mips.org>
2007-10-17 16:10 ` [MIPS] Probe for usability of cp0 compare interrupt Atsushi Nemoto
2007-10-17 16:46   ` Ralf Baechle [this message]
2007-10-17 17:03     ` Maciej W. Rozycki
2007-10-17 17:23       ` Ralf Baechle
2007-10-17 17:44         ` Maciej W. Rozycki
2007-10-17 18:14       ` Ralf Baechle

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=20071017164636.GC5491@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.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