Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>, Will Deacon <will@kernel.org>
Subject: [PATCH] perf: arm_pmu_acpi: Get rid of the edge-triggered interrupt oddity
Date: Sat, 25 Jul 2026 17:26:27 +0100	[thread overview]
Message-ID: <20260725162627.145301-1-maz@kernel.org> (raw)

The ACPI spec bizarrely indicates that the PMU interrupt can be
edge-triggered, which contradicts the very basics of the PMU
architecture (SW is required to clear the interrupt condition for
the level to drop).

Remove the code parsing this flag and always flag the interrupt
as level triggered, no matter what firmware says.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 drivers/perf/arm_pmu_acpi.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/perf/arm_pmu_acpi.c b/drivers/perf/arm_pmu_acpi.c
index e80f76d95e68b..ca6bf8f86cfe9 100644
--- a/drivers/perf/arm_pmu_acpi.c
+++ b/drivers/perf/arm_pmu_acpi.c
@@ -22,7 +22,7 @@ static DEFINE_PER_CPU(int, pmu_irqs);
 static int arm_pmu_acpi_register_irq(int cpu)
 {
 	struct acpi_madt_generic_interrupt *gicc;
-	int gsi, trigger;
+	int gsi;
 
 	gicc = acpi_cpu_get_madt_gicc(cpu);
 
@@ -38,11 +38,6 @@ static int arm_pmu_acpi_register_irq(int cpu)
 	if (!gsi)
 		return 0;
 
-	if (gicc->flags & ACPI_MADT_PERFORMANCE_IRQ_MODE)
-		trigger = ACPI_EDGE_SENSITIVE;
-	else
-		trigger = ACPI_LEVEL_SENSITIVE;
-
 	/*
 	 * Helpfully, the MADT GICC doesn't have a polarity flag for the
 	 * "performance interrupt". Luckily, on compliant GICs the polarity is
@@ -53,8 +48,12 @@ static int arm_pmu_acpi_register_irq(int cpu)
 	 * may not match the real polarity, but that should not matter.
 	 *
 	 * Other interrupt controllers are not supported with ACPI.
+	 *
+	 * The spec also indicates that the PMU interrupt can be edge
+	 * triggered, which doesn't make any sense (SW needs to clear the
+	 * interrupt condition for the level to drop). Ignore the silly flag.
 	 */
-	return acpi_register_gsi(NULL, gsi, trigger, ACPI_ACTIVE_HIGH);
+	return acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH);
 }
 
 static void arm_pmu_acpi_unregister_irq(int cpu)
-- 
2.47.3



             reply	other threads:[~2026-07-25 16:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25 16:26 Marc Zyngier [this message]
2026-07-27 11:40 ` [PATCH] perf: arm_pmu_acpi: Get rid of the edge-triggered interrupt oddity Zenghui Yu

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=20260725162627.145301-1-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.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