linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Albert Cahalan" <acahalan@gmail.com>
To: "Sergei Shtylyov" <sshtylyov@ru.mvista.com>
Cc: linuxppc-dev@ozlabs.org, tglx@linutronix.de,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.21-rt2] PowerPC: decrementer clockevent driver
Date: Fri, 18 May 2007 21:45:37 -0400	[thread overview]
Message-ID: <787b0d920705181845h355eed4fk2bf93323332a9d90@mail.gmail.com> (raw)
In-Reply-To: <464DBDBA.3060801@ru.mvista.com>

On 5/18/07, Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> Albert Cahalan wrote:

> >>> Sure, but is there any utility in registering more than the
> >>> decrementer on PPC?
>
> >> Not yet. I'm not sure I know any other PPC CPU facility fitting
> >> for clockevents. In theory, FIT could be used -- but its period
> >> is measured in powers of 2, IIRC.
>
> > I'd really like to have that as an option. It would allow oprofile
> > to safely use hardware events on the MPC74xx "G4" processors.
> > Alternately it would allow thermal events. It is safe to use at
> > most one of the three (decrementer,profiling,thermal) interrupts.
> > If two were to hit at the same time, badness happens.
>
> Unfortunately, FIT exists only on Book E CPUs and MPC74xx aren't Book E, IIUC.

By the name "FIT" perhaps, but MPC74xx has essentially
the same thing.

> > It's possible to wrapper the interrupt in something that divides
> > down, calling the normal code only some of the time. I think one
> > of the FIT choices is about 4 kHz on my system, which would be OK.
>
>     Erm, are you sure you have FIT (or is your system not MPC74xx based)?

Set MMCR0[TBEE], set MMCR0[PMXE], and choose a TBL bit via MMCR0[TBSEL].
TBSEL is a 2-bit field which selects a timebase bit to use. The timebase
bits that can be chosen are numbered 15, 19, 23, and 31. In the notation
used by every other CPU vendor those would be bits 0, 8, 12, and 16.

Example: My system uses a TBL frequency of 24907667. This gives choices
of 12453833, 48648, 3040, and 190 Hz. The lowest three of those could
be useful, with 48648 only for profiling and extreme real-time.

It's also possible to trigger on the CPU cycle counter, but this would
cost one of the performance counters. MPC7400 has 4, later CPUs have 6
or more, and I think xPC7x0 had only 2. This method is a bit nicer,
since then one could trigger interrupts on arbitrary clock cycles
without needing to write the timebase register.

  reply	other threads:[~2007-05-19  1:45 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18  3:24 [PATCH 2.6.21-rt2] PowerPC: decrementer clockevent driver Albert Cahalan
2007-05-18 14:52 ` Sergei Shtylyov
2007-05-19  1:45   ` Albert Cahalan [this message]
2007-05-19 12:28     ` Segher Boessenkool
2007-05-19 18:22       ` Albert Cahalan
  -- strict thread matches above, loose matches on Subject: below --
2007-05-17 17:42 Sergei Shtylyov
2007-05-17 17:47 ` Kumar Gala
2007-05-17 18:07   ` Sergei Shtylyov
2007-05-17 18:17     ` Kumar Gala
2007-05-17 18:26       ` Sergei Shtylyov
2007-05-17 18:31         ` Kumar Gala
2007-05-17 18:42           ` Sergei Shtylyov
2007-05-18 12:39             ` Matt Sealey
2007-05-18 13:45               ` Sergei Shtylyov
2007-05-18 14:28                 ` Matt Sealey
2007-05-18 14:48                   ` Thomas Gleixner
2007-05-18 15:37                     ` Matt Sealey
2007-05-18 16:31                     ` Kumar Gala
2007-05-18 16:50                       ` Thomas Gleixner
2007-05-18 16:55                         ` Matt Sealey
2007-05-18 16:52                       ` Matt Sealey
2007-07-10 10:52                         ` Gabriel Paubert
2007-07-10 14:24                           ` Segher Boessenkool
2007-07-10 23:31                             ` Paul Mackerras
2007-07-11  0:10                               ` Segher Boessenkool
2007-05-18 20:27                       ` David Miller
2007-05-18 14:56       ` Daniel Walker
2007-05-18 15:06         ` Sergei Shtylyov
2007-05-18 15:39           ` Daniel Walker
2007-05-18 15:48             ` Sergei Shtylyov
2007-05-19  3:33             ` Paul Mackerras
2007-05-20  2:43               ` Daniel Walker
2007-05-20  3:03                 ` Benjamin Herrenschmidt
2007-05-20 15:03                   ` Matt Sealey
2007-05-20 21:25                     ` Benjamin Herrenschmidt
2007-05-20 16:02                   ` Segher Boessenkool
2007-05-20 21:26                     ` Benjamin Herrenschmidt
2007-05-17 19:27 ` Segher Boessenkool
2007-05-17 19:43   ` Sergei Shtylyov
2007-05-17 19:50     ` Segher Boessenkool
2007-05-17 20:00       ` Sergei Shtylyov
2007-05-17 20:53         ` Segher Boessenkool
2007-05-18  5:04           ` Benjamin Herrenschmidt
2007-05-18  5:39             ` Dave Liu
2007-05-18  7:08               ` Benjamin Herrenschmidt
2007-05-18 13:41                 ` Sergei Shtylyov
2007-05-18 13:48                   ` Sergei Shtylyov
2007-05-18 23:27                   ` Benjamin Herrenschmidt
2007-05-18 23:49                     ` Segher Boessenkool
2007-05-19  0:13                       ` Benjamin Herrenschmidt
2007-05-30 15:56                     ` Milton Miller
2007-05-19  3:34                   ` Paul Mackerras
2007-10-18 14:45 ` Sergei Shtylyov

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=787b0d920705181845h355eed4fk2bf93323332a9d90@mail.gmail.com \
    --to=acahalan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sshtylyov@ru.mvista.com \
    --cc=tglx@linutronix.de \
    /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).