From: Robin Murphy <robin.murphy@arm.com>
To: will@kernel.org, mark.rutland@arm.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Geoff Blake <blakgeof@amazon.com>
Subject: [PATCH 1/2] perf/arm-cmn: Cope with spurious IRQs better
Date: Wed, 30 Nov 2022 15:36:38 +0000 [thread overview]
Message-ID: <bc8183fcd7f6ca07b0d56aa8061d816485b84341.1669822447.git.robin.murphy@arm.com> (raw)
Although we reset the CMN state during probe before requesting our
interrupt(s), a pending IRQ could already have been latched at the
interrupt controller, and thus be delivered spuriously as soon as the
IRQ is enabled. Not handling that can then lead to the IRQ layer
disabling it again, and things subseuqently going wonky.
Since we can't support shared IRQs anyway for affinity-management
reasons, the only time we should concievably return IRQ_NONE is for a
spurious interrupt which did somehow originate from our CMN, so there
should be no harm in removing the problem by simply claiming to have
handled those as well.
Reported-by: Geoff Blake <blakgeof@amazon.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
drivers/perf/arm-cmn.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index b80a9b74662b..9e8be5586423 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -1798,7 +1798,6 @@ static int arm_cmn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *cpuhp_no
static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
{
struct arm_cmn_dtc *dtc = dev_id;
- irqreturn_t ret = IRQ_NONE;
for (;;) {
u32 status = readl_relaxed(dtc->base + CMN_DT_PMOVSR);
@@ -1807,7 +1806,6 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
for (i = 0; i < CMN_DTM_NUM_COUNTERS; i++) {
if (status & (1U << i)) {
- ret = IRQ_HANDLED;
if (WARN_ON(!dtc->counters[i]))
continue;
delta = (u64)arm_cmn_read_counter(dtc, i) << 16;
@@ -1816,7 +1814,6 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
}
if (status & (1U << CMN_DT_NUM_COUNTERS)) {
- ret = IRQ_HANDLED;
if (dtc->cc_active && !WARN_ON(!dtc->cycles)) {
delta = arm_cmn_read_cc(dtc);
local64_add(delta, &dtc->cycles->count);
@@ -1826,7 +1823,7 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id)
writel_relaxed(status, dtc->base + CMN_DT_PMOVSR_CLR);
if (!dtc->irq_friend)
- return ret;
+ return IRQ_HANDLED;
dtc += dtc->irq_friend;
}
}
--
2.36.1.dirty
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-11-30 15:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 15:36 Robin Murphy [this message]
2022-11-30 15:36 ` [PATCH 2/2] perf/arm-cmn: Implement shutdown method Robin Murphy
2022-11-30 16:02 ` [PATCH 1/2] perf/arm-cmn: Cope with spurious IRQs better Geoff Blake
2022-11-30 18:16 ` Robin Murphy
2022-11-30 23:13 ` Geoff Blake
2022-12-01 18:28 ` Robin Murphy
2022-12-05 15:38 ` Geoff Blake
2022-12-15 18:00 ` [PATCH] perf/arm-cmn: Add shutdown routine Geoff Blake
2023-01-04 15:55 ` Geoff Blake
2023-01-19 15:30 ` Geoff Blake
2023-01-19 15:32 ` Robin Murphy
2023-01-19 17:10 ` Geoff Blake
2023-01-19 18:14 ` Will Deacon
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=bc8183fcd7f6ca07b0d56aa8061d816485b84341.1669822447.git.robin.murphy@arm.com \
--to=robin.murphy@arm.com \
--cc=blakgeof@amazon.com \
--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