public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Pihet <jpihet@mvista.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk,
	oprofile-list@lists.sourceforge.net
Subject: Re: get_irq_regs() from soft IRQ
Date: Mon, 29 Jun 2009 17:35:37 +0200	[thread overview]
Message-ID: <200906291735.38290.jpihet@mvista.com> (raw)
In-Reply-To: <20090629151931.GA9042@n2100.arm.linux.org.uk>

On Monday 29 June 2009 17:19:31 Russell King - ARM Linux wrote:
> On Mon, Jun 29, 2009 at 04:31:18PM +0200, Jean Pihet wrote:
> > I am trying to get the latest IRQ registers from a timer or a work queue
> > but I am running into problems:
> > - get_irq_regs() returns NULL in some cases,
>
> It will always return NULL outside of IRQ context - and only returns valid
> pointers when used inside IRQ context.
Ok got it.

> It's one of these things that nests itself - when you have several IRQs
> being processed on one CPU, there are several register contexts saved,
> and get_irq_regs() returns the most recent one.
>
> > The use case is that the performance unit (PMNC) of the Cortex A8 has
> > some serious bug, in short the performance counters overflow IRQ is to be
> > avoided.
>
> I don't follow.  None of the PMNC support code in the mainline kernel
> uses get_irq_regs() outside of IRQ context.
That is correct. The Cortex A8 needs some special treatment.
The errata says that if the counters are overflowing at the same time as a 
coprocessor access is performed, the perf unit gets reset and/or locks up. In 
short the counters overflow is to be avoided and so the PMNC IRQ.

> > Some questions:
> > - is there a way to get the last 'real' IRQ registers from a timer or
> > work queue handler?
>
> No.  Outside of IRQ events, the saved IRQ context does not exist.
Ok. I wonder how to implement it correctly from here.
The ultimate goal is to feed the registers to oprofile for statistics 
gathering (mostly the PC). I do not see much benefit from oprofile without 
the PC statistics.

Thanks,
Jean

  reply	other threads:[~2009-06-29 15:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29 14:31 get_irq_regs() from soft IRQ Jean Pihet
2009-06-29 15:19 ` Russell King - ARM Linux
2009-06-29 15:35   ` Jean Pihet [this message]
2009-06-29 16:07     ` Russell King - ARM Linux
2009-06-29 16:12       ` Jean Pihet
2009-06-29 16:36 ` Siarhei Siamashka
2009-06-29 16:58   ` Jean Pihet
2009-06-29 17:46     ` Russell King - ARM Linux
2009-06-29 17:57       ` Jean Pihet
2009-06-29 17:54     ` Siarhei Siamashka
2009-06-29 18:08       ` Jean Pihet
2009-06-29 17:37   ` Russell King - ARM Linux
2009-06-29 17:52     ` Jean Pihet
2009-06-29 18:38     ` Siarhei Siamashka
2009-06-29 18:49       ` Jean Pihet
2009-06-29 19:45         ` Siarhei Siamashka

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=200906291735.38290.jpihet@mvista.com \
    --to=jpihet@mvista.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=oprofile-list@lists.sourceforge.net \
    /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