lkml.org 
[lkml]   [2022]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[irqchip: irq/irqchip-next] irqchip/armada-370-xp: Do not allow mapping IRQ 0 and 1
The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID: baf78c1078b474aed18864796a8161784dd81fc2
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/baf78c1078b474aed18864796a8161784dd81fc2
Author: Pali Rohár <pali@kernel.org>
AuthorDate: Mon, 25 Apr 2022 13:37:06 +02:00
Committer: Marc Zyngier <maz@kernel.org>
CommitterDate: Fri, 06 May 2022 12:20:27 +01:00

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

IRQs 0 and 1 cannot be mapped, they are handled internally by this driver
and this driver does not call generic_handle_domain_irq() for these IRQs.
So do not allow mapping these IRQs and correctly propagate error from the
.irq_map callback.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220425113706.29310-2-pali@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 ee18eb3..ab02b44 100644
--- a/drivers/irqchip/irq-armada-370-xp.c
+++ b/drivers/irqchip/irq-armada-370-xp.c
@@ -567,6 +567,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 +
\
 
 \ /
  Last update: 2022-05-06 13:25    [W:0.114 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site