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: Wed, 22 Oct 2014 19:16:42 -0300 [thread overview]
Message-ID: <54482CCA.9010002@free-electrons.com> (raw)
In-Reply-To: <20141022140421.GL22642@leverpostej>
Hi Mark,
Thanks for the reply. You made me research and test this in depth :)
On 10/22/2014 11:04 AM, Mark Rutland wrote:
> On Wed, Oct 22, 2014 at 02:43:45PM +0100, Ezequiel Garcia wrote:
>> The Armada 375 SoC has a Cortex-A9 CPU, and so the PMU is available
>> to be used. This commit enables it in the devicetree.
>>
>> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
>> ---
>> arch/arm/boot/dts/armada-375.dtsi | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/armada-375.dtsi b/arch/arm/boot/dts/armada-375.dtsi
>> index de65714..f131cd2 100644
>> --- a/arch/arm/boot/dts/armada-375.dtsi
>> +++ b/arch/arm/boot/dts/armada-375.dtsi
>> @@ -55,6 +55,11 @@
>> };
>> };
>>
>> + pmu {
>> + compatible = "arm,cortex-a9-pmu";
>> + interrupts-extended = <&mpic 3>;
>> + };
>
> Just to check - the interrupts from both CPUs are muxed into a single
> line into the interrupt controller?
>
> This isn't gonig to work at the moment -- the perf code will associate
> this interrupt with CPU0 and you'll lose events on CPU1.
>
> Hopefully there's a separate interrupt for CPU1?
>
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.
The interrupt cause can be read from a banked register called "CPU
subsystem local cause". Conversely, each of these must be enabled from
another (banked) register.
As far as I understand, this works (or should work) because the irqchip
driver enables *just* the perf counter interrupt for the running CPU in
the armada_xp_mpic_secondary_init(). Then, the ARM perf code requests
the interrupt as per cpu and things just work, right?
However:
1) In the Armada 375 SoC case, the MPIC is chained and the code does not
register the cpu notifier, so armada_xp_mpic_secondary_init is not
called on CPU1.
2) Even when ensuring armada_xp_mpic_secondary_init is called on each
CPU, and thus each perf counter interrupt is enabled, I can't see the
PMU interrupt for CPU1, but just the one for the boot CPU.
I'll check with the hardware designer about this.
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-10-22 22:16 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 [this message]
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
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=54482CCA.9010002@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.