linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ezequiel.garcia@free-electrons.com (Ezequiel Garcia)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] ARM: mvebu: Enable Performance Monitor Unit on Armada 375 SoC
Date: Fri, 31 Oct 2014 13:23:05 -0300	[thread overview]
Message-ID: <5453B769.2080601@free-electrons.com> (raw)
In-Reply-To: <20141023131840.GA14404@leverpostej>

On 10/23/2014 10:18 AM, Mark Rutland wrote:
> On Thu, Oct 23, 2014 at 01:07:31PM +0100, Thomas Petazzoni wrote:
>> Dear Ezequiel Garcia,
>>
>> On Thu, 23 Oct 2014 08:51:27 -0300, Ezequiel Garcia wrote:
>>
>>>> On Wed, 22 Oct 2014 19:16:42 -0300, Ezequiel Garcia wrote:
>>>>
>>>>> The <mpic 3> is a per CPU interrupt.
>>>>>
>>>>> Actually, the interrupt contains more than just PMU events, it contains
>>>>> a summary of several CPU events: Perf counters for each CPU, Power
>>>>> management interrupts for each CPU, L2 cache interrupt, among others.
>>>>
>>>> This is kind of a side discussion but if this <mpic 3> interrupts does
>>>> much more than PMU events, then we should implement a separate irqchip
>>>> driver for this, to "demultiplex" the events notified by this interrupt.
>>>
>>> Oh, I didn't realize this was possible.
>>
>> The only trick is that it can't be a separate DT node, because the
>> registers that contains the mask/cause informations for the events
>> notified by <mpic 3> belongs to the MPIC registers area.
>>
>> Not sure how to handle that, maybe Mark will have some suggestions.
> 
> I'm not sure I follow why you would need a separate irqchip driver. Why
> can't this live in the existing mpic driver?
> 

I've tried to add a demux interrupt controller for the CPU summary interrupts
to be able to hook to the proper interrupt. This was doable without much
pain [1].

However, due to the way the Performance counter overflow IRQ is exposed, it 
doesn't seem to meet perf's PMU irq handling requirement.

For per CPU interrupts, perf requests the interrupt and expects to get an
interrupt on each CPU, with the counter overflow event for that CPU.

This is not the case for the CPU Summary interrupt. This *is* a per CPU
interrupt, but there is a separate interrupt line for each CPU:

CPU summary per CPU interrupt 0, for the Perf counter on CPU0
CPU summary per CPU interrupt 1, for the Perf counter on CPU1

So, I thought about exposing the interrupt as a shared one and
use interrupts 0 and 1, triggering interrupts on CPU0 with the
counter overflow for CPU0 and CPU1. This doesn't work either, as
the perf code expects to set the interrupt affinity to route
each shared interrupt to the appropriate CPU.

I'm not sure how can I set the interrupt affinity for the demux controller,
being a chained interrupt controller.

At this point, due to the SoC weirdness in exposing the PMU IRQ, I'm 
starting to think we will have to live with software events for this SoC,
but I'd love to be proved wrong.

[1] http://sprunge.us/MfVN
-- 
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141031/0a53de45/attachment.sig>

  reply	other threads:[~2014-10-31 16:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 13:43 [PATCH 0/7] Armada 375/38x perf support, and a bonus irqchip driver simplification Ezequiel Garcia
2014-10-22 13:43 ` [PATCH 1/7] irqchip: armada-370-xp: Simplify interrupt map, mask and unmask Ezequiel Garcia
2014-10-31 16:36   ` Gregory CLEMENT
2014-11-04 15:11     ` Ezequiel Garcia
2014-11-10 17:09       ` Gregory CLEMENT
2014-10-22 13:43 ` [PATCH 2/7] irqchip: armada-370-xp: Initialize per cpu registers when CONFIG_SMP=N Ezequiel Garcia
2014-11-12 10:30   ` Gregory CLEMENT
2014-10-22 13:43 ` [PATCH 3/7] irqchip: armada-370-xp: Introduce a is_percpu_irq() helper for readability Ezequiel Garcia
2014-10-22 13:58   ` Mark Rutland
2014-10-22 15:14     ` Ezequiel Garcia
2014-10-22 13:43 ` [PATCH 4/7] irqchip: armada-370-xp: Enable Performance Counter interrupts Ezequiel Garcia
2014-10-22 13:43 ` [PATCH 5/7] ARM: mvebu: Enable Performance Monitor Unit on Armada 375 SoC Ezequiel Garcia
2014-10-22 14:04   ` Mark Rutland
2014-10-22 22:16     ` Ezequiel Garcia
2014-10-23  9:14       ` Thomas Petazzoni
2014-10-23 11:51         ` Ezequiel Garcia
2014-10-23 12:07           ` Thomas Petazzoni
2014-10-23 12:19             ` Ezequiel Garcia
2014-10-23 13:18             ` Mark Rutland
2014-10-31 16:23               ` Ezequiel Garcia [this message]
2014-10-23  9:41       ` Mark Rutland
2014-10-22 13:43 ` [PATCH 6/7] ARM: mvebu: Enable Performance Monitor Unit on Armada 380/385 SoC Ezequiel Garcia
2014-10-22 14:06   ` Mark Rutland
2014-10-22 22:18     ` Ezequiel Garcia
2014-10-22 13:43 ` [PATCH 7/7] ARM: mvebu: Enable perf support in mvebu_v7_defconfig Ezequiel Garcia
2014-10-22 14:11   ` Mark Rutland
2014-10-22 15:33     ` Ezequiel Garcia
2014-10-22 15:38       ` Mark Rutland
2014-11-09  5:23 ` [PATCH 0/7] Armada 375/38x perf support, and a bonus irqchip driver simplification Jason Cooper
2014-11-09  9:41   ` Thomas Petazzoni
2014-11-09 12:18     ` Ezequiel Garcia
2014-11-09 22:50       ` Jason Cooper
2014-11-23  0:45         ` Ezequiel Garcia

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=5453B769.2080601@free-electrons.com \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.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).