All of lore.kernel.org
 help / color / mirror / Atom feed
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: "Pali Rohár" <pali@kernel.org>, "Marek Behún" <kabel@kernel.org>
Subject: [PATCH 1/4] irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1
Date: Wed, 19 Jun 2024 16:11:31 +0200	[thread overview]
Message-ID: <20240619141134.30900-2-kabel@kernel.org> (raw)
In-Reply-To: <20240619141134.30900-1-kabel@kernel.org>

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(+)

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 +
-- 
2.44.2



  reply	other threads:[~2024-06-19 14:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 14:11 [PATCH 0/4] armada-370-xp irqchip updates Marek Behún
2024-06-19 14:11 ` Marek Behún [this message]
2024-06-19 17:08   ` [PATCH 1/4] irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1 Andrew Lunn
2024-06-19 19:25     ` Marek Behún
2024-06-19 14:11 ` [PATCH 2/4] irqchip/armada-370-xp: Exit ipi_resume() early if IPI is not used Marek Behún
2024-06-19 17:11   ` Andrew Lunn
2024-06-19 19:27     ` Marek Behún
2024-06-19 14:11 ` [PATCH 3/4] irqchip/armada-370-xp: Do not touch IPI registers on platforms without IPI Marek Behún
2024-06-19 17:17   ` Andrew Lunn
2024-06-19 14:11 ` [PATCH 4/4] irqchip/armada-370-xp: Add support for 32 MSI interrupts on non-IPI platforms Marek Behún
2024-06-19 17:21   ` Andrew Lunn

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=20240619141134.30900-2-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=pali@kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.