From: "Marek Behún" <kabel@kernel.org>
To: "Andrew Lunn" <andrew@lunn.ch>,
"Gregory Clement" <gregory.clement@bootlin.com>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
linux-arm-kernel@lists.infradead.org, arm@kernel.org,
"Andy Shevchenko" <andy@kernel.org>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "Marek Behún" <kabel@kernel.org>, stable+noautosel@kernel.org
Subject: [PATCH v2 09/12] irqchip/armada-370-xp: Fix reenabling last per-CPU interrupt
Date: Wed, 7 Aug 2024 18:41:01 +0200 [thread overview]
Message-ID: <20240807164104.4140-10-kabel@kernel.org> (raw)
In-Reply-To: <20240807164104.4140-1-kabel@kernel.org>
The number of per-CPU interrupts is 29 (0 to 28). This is described by
the constant MPIC_MAX_PER_CPU_IRQS, set to 28 (the maximum per-CPU
interrupt).
Commit 0fa4ce746d1d ("irqchip/armada-370-xp: Re-enable per-CPU
interrupts at resume time") used the constant incorrectly in the
for-loop, it used the operator < instead of <=, causing it to iterate
only the first 28 interrupts (0 to 27), ignoring the last, 28th,
per-CPU interrupt.
To avoid this kind of confusions, fix this issue by renaming the constant
to MPIC_PER_CPU_IRQS_NR and set it to 29, the number of per-CPU IRQs.
Update its use in mpic_is_percpu_irq() accordingly.
Cc: <stable+noautosel@kernel.org> # The 29th interrupt is not used in any device-tree
Fixes: 0fa4ce746d1d ("irqchip/armada-370-xp: Re-enable per-CPU interrupts at resume time")
Signed-off-by: Marek Behún <kabel@kernel.org>
---
Thomas, I have added the stable+noautosel Cc so that this patch won't be
autoselected for stable releases, as described in
Documentation/process/stable-kernel-rules.rst. This way I can keep the
Fixes tag.
---
drivers/irqchip/irq-armada-370-xp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index f8658a232f21..83afc3a27812 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -133,7 +133,7 @@
#define MPIC_INT_FABRIC_MASK 0x54
#define MPIC_INT_CAUSE_PERF(cpu) BIT(cpu)
-#define MPIC_MAX_PER_CPU_IRQS 28
+#define MPIC_PER_CPU_IRQS_NR 29
/* IPI and MSI interrupt definitions for IPI platforms */
#define IPI_DOORBELL_NR 8
@@ -202,7 +202,7 @@ static inline bool mpic_is_ipi_available(struct mpic *mpic)
static inline bool mpic_is_percpu_irq(irq_hw_number_t hwirq)
{
- return hwirq <= MPIC_MAX_PER_CPU_IRQS;
+ return hwirq < MPIC_PER_CPU_IRQS_NR;
}
/*
@@ -545,7 +545,7 @@ static void mpic_smp_cpu_init(struct mpic *mpic)
static void mpic_reenable_percpu(struct mpic *mpic)
{
/* Re-enable per-CPU interrupts that were enabled before suspend */
- for (irq_hw_number_t i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) {
+ for (irq_hw_number_t i = 0; i < MPIC_PER_CPU_IRQS_NR; i++) {
unsigned int virq = irq_linear_revmap(mpic->domain, i);
struct irq_data *d;
--
2.44.2
next prev parent reply other threads:[~2024-08-07 16:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 16:40 [PATCH v2 00/12] armada-370-xp irqchip updates round 5 Marek Behún
2024-08-07 16:40 ` [PATCH v2 01/12] irqchip/armada-370-xp: Drop IPI_DOORBELL_START and rename IPI_DOORBELL_END Marek Behún
2024-08-07 16:40 ` [PATCH v2 02/12] irqchip/armada-370-xp: Drop msi_doorbell_end() Marek Behún
2024-08-07 16:40 ` [PATCH v2 03/12] irqchip/armada-370-xp: Add the __init attribute to mpic_msi_init() Marek Behún
2024-08-07 16:40 ` [PATCH v2 04/12] irqchip/armada-370-xp: Put __init attribute after return type in mpic_ipi_init() Marek Behún
2024-08-07 16:40 ` [PATCH v2 05/12] irqchip/armada-370-xp: Put static variables into driver private structure Marek Behún
2024-08-07 16:40 ` [PATCH v2 06/12] irqchip/armada-370-xp: Put MSI doorbell limits into the mpic structure Marek Behún
2024-08-07 16:40 ` [PATCH v2 07/12] irqchip/armada-370-xp: Pass around the driver private structure Marek Behún
2024-08-07 16:41 ` [PATCH v2 08/12] irqchip/armada-370-xp: Dynamically allocate " Marek Behún
2024-08-07 16:41 ` Marek Behún [this message]
2024-08-07 16:41 ` [PATCH v2 10/12] irqchip/armada-370-xp: Iterate only valid bits of the per-CPU interrupt cause register Marek Behún
2024-08-07 16:41 ` [PATCH v2 11/12] irqchip/armada-370-xp: Allow mapping only per-CPU interrupts Marek Behún
2024-08-07 16:41 ` [PATCH v2 12/12] irqchip/armada-370-xp: Use the mpic_is_ipi_available() helper in one more case Marek Behún
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=20240807164104.4140-10-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=andrew@lunn.ch \
--cc=andy@kernel.org \
--cc=arm@kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=stable+noautosel@kernel.org \
--cc=tglx@linutronix.de \
/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).