diff mbox series

[1/4] irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1

Message ID 20240619141134.30900-2-kabel@kernel.org (mailing list archive)
State Superseded
Headers show
Series armada-370-xp irqchip updates | expand

Commit Message

Marek Behún June 19, 2024, 2:11 p.m. UTC
From: Pali Rohár <pali@kernel.org>

IRQs 0 (IPI) and 1 (MSI) are handled internally by this driver,
generic_handle_domain_irq() is never called for these IRQs.

Disallow mapping these IRQs.

Fixes: 344e873e5657 ("arm: mvebu: Add IPI support via doorbells")
Fixes: 31f614edb726 ("irqchip: armada-370-xp: implement MSI support")
Signed-off-by: Pali Rohár <pali@kernel.org>
[ changed commit message, added Fixes tags ]
Signed-off-by: Marek Behún <kabel@kernel.org>
---
 drivers/irqchip/irq-armada-370-xp.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andrew Lunn June 19, 2024, 5:08 p.m. UTC | #1
On Wed, Jun 19, 2024 at 04:11:31PM +0200, Marek Behún wrote:
> From: Pali Rohár <pali@kernel.org>
> 
> IRQs 0 (IPI) and 1 (MSI) are handled internally by this driver,
> generic_handle_domain_irq() is never called for these IRQs.
> 
> Disallow mapping these IRQs.
> 
> Fixes: 344e873e5657 ("arm: mvebu: Add IPI support via doorbells")
> Fixes: 31f614edb726 ("irqchip: armada-370-xp: implement MSI support")
> Signed-off-by: Pali Rohár <pali@kernel.org>
> [ changed commit message, added Fixes tags ]
> Signed-off-by: Marek Behún <kabel@kernel.org>

Is this needed in stable? Is the problem being fixed a real bug that
bothers people?

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

If you would like this back ported in stable, please post it as a
separate patch. Otherwise it can be kept as part of the series.  The
Fixes: might result in it being backported anyway.

	Andrew
Marek Behún June 19, 2024, 7:25 p.m. UTC | #2
On Wed, 19 Jun 2024 19:08:04 +0200
Andrew Lunn <andrew@lunn.ch> wrote:

> On Wed, Jun 19, 2024 at 04:11:31PM +0200, Marek Behún wrote:
> > From: Pali Rohár <pali@kernel.org>
> > 
> > IRQs 0 (IPI) and 1 (MSI) are handled internally by this driver,
> > generic_handle_domain_irq() is never called for these IRQs.
> > 
> > Disallow mapping these IRQs.
> > 
> > Fixes: 344e873e5657 ("arm: mvebu: Add IPI support via doorbells")
> > Fixes: 31f614edb726 ("irqchip: armada-370-xp: implement MSI support")
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > [ changed commit message, added Fixes tags ]
> > Signed-off-by: Marek Behún <kabel@kernel.org>  
> 
> Is this needed in stable? Is the problem being fixed a real bug that
> bothers people?

Not as far as I know, but I have been asked to add Fixes tag for less.

> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> 
> If you would like this back ported in stable, please post it as a
> separate patch. Otherwise it can be kept as part of the series.  The
> Fixes: might result in it being backported anyway.

I don't need it backported. Semantically it is a fix, but it doesn't
bother anyone.

I will post v2 without the Fixes tags.

Marek
diff mbox series

Patch

diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c
index 4b021a67bdfe..f488c35d9130 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -566,6 +566,10 @@  static struct irq_chip armada_370_xp_irq_chip = {
 static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
 				      unsigned int virq, irq_hw_number_t hw)
 {
+	/* IRQs 0 and 1 cannot be mapped, they are handled internally */
+	if (hw <= 1)
+		return -EINVAL;
+
 	armada_370_xp_irq_mask(irq_get_irq_data(virq));
 	if (!is_percpu_irq(hw))
 		writel(hw, per_cpu_int_base +