public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm•com>
To: Maxime Ripard <mripard@kernel•org>, Chen-Yu Tsai <wens@csie•org>
Cc: "Mark Rutland" <mark.rutland@arm•com>,
	"Rob Herring" <robh@kernel•org>,
	"Emmanuel Vadot" <manu@FreeBSD•org>,
	"Jared D . McNeill" <jmcneill@NetBSD•org>,
	linux-sunxi@googlegroups•com, devicetree@vger•kernel.org,
	"Clément Péron" <peron.clem@gmail•com>,
	"Harald Geyer" <harald@ccbib•org>,
	linux-arm-kernel@lists•infradead.org
Subject: [PATCH] arm64: dts: allwinner: a64: Re-add PMU node
Date: Tue,  5 Nov 2019 11:06:51 +0000	[thread overview]
Message-ID: <20191105110651.217513-1-andre.przywara@arm.com> (raw)

As it was found recently, the Performance Monitoring Unit (PMU) on the
Allwinner A64 SoC was not generating (the right) interrupts. With the
SPI numbers from the manual the kernel did not receive any overflow
interrupts, so perf was not happy at all.
It turns out that the numbers were just off by 4, so the PMU interrupts
are from 148 to 151, not from 152 to 155 as the manual describes.

This was found by playing around with U-Boot, which typically does not
use interrupts, so the GIC is fully available for experimentation:
With *every* PPI and SPI enabled, an overflowing PMU cycle counter was
found to set a bit in one of the GICD_ISPENDR registers, with careful
counting this was determined to be number 148.

Tested with perf record and perf top on a Pine64-LTS. Also tested with
tasksetting to every core to confirm the assignment between IRQs and
cores.

This somewhat "revert-fixes" commit ed3e9406bcbc ("arm64: dts: allwinner:
a64: Drop PMU node").

Fixes: 34a97fcc71c2 ("arm64: dts: allwinner: a64: Add PMU node")
Fixes: ed3e9406bcbc ("arm64: dts: allwinner: a64: Drop PMU node")
Signed-off-by: Andre Przywara <andre.przywara@arm•com>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 70f4cce6be43..ba41c1b85887 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -142,6 +142,15 @@
 		clock-output-names = "ext-osc32k";
 	};
 
+	pmu {
+		compatible = "arm,cortex-a53-pmu";
+		interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+	};
+
 	psci {
 		compatible = "arm,psci-0.2";
 		method = "smc";
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-11-05 20:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 11:06 Andre Przywara [this message]
2019-11-06 12:07 ` [PATCH] arm64: dts: allwinner: a64: Re-add PMU node Maxime Ripard

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=20191105110651.217513-1-andre.przywara@arm.com \
    --to=andre.przywara@arm$(echo .)com \
    --cc=devicetree@vger$(echo .)kernel.org \
    --cc=harald@ccbib$(echo .)org \
    --cc=jmcneill@NetBSD$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-sunxi@googlegroups$(echo .)com \
    --cc=manu@FreeBSD$(echo .)org \
    --cc=mark.rutland@arm$(echo .)com \
    --cc=mripard@kernel$(echo .)org \
    --cc=peron.clem@gmail$(echo .)com \
    --cc=robh@kernel$(echo .)org \
    --cc=wens@csie$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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