diff mbox series

[1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional

Message ID 1607912752-12481-1-git-send-email-kernelfans@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional | expand

Commit Message

Pingfan Liu Dec. 14, 2020, 2:25 a.m. UTC
Arches may implement their own counterpart of irq_enter/exit in the
frontend. Hence make the pair in __handle_domain_irq() arch optional

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Julien Thierry <julien.thierry@arm.com>
To: linux-arm-kernel@lists.infradead.org
---
 kernel/irq/Kconfig   | 4 ++++
 kernel/irq/irqdesc.c | 4 ++++
 2 files changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig
index 164a031cfdb6..f17a9c8771c1 100644
--- a/kernel/irq/Kconfig
+++ b/kernel/irq/Kconfig
@@ -100,6 +100,10 @@  config IRQ_MSI_IOMMU
 config HANDLE_DOMAIN_IRQ
 	bool
 
+config ARCH_HAS_IRQENTRY_ENTER
+	bool
+	select HANDLE_DOMAIN_IRQ
+
 config IRQ_TIMINGS
 	bool
 
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 1a7723604399..77819e489f9b 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -669,7 +669,9 @@  int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq,
 	unsigned int irq = hwirq;
 	int ret = 0;
 
+#ifndef CONFIG_ARCH_HAS_IRQENTRY_ENTER
 	irq_enter();
+#endif
 
 #ifdef CONFIG_IRQ_DOMAIN
 	if (lookup)
@@ -687,7 +689,9 @@  int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq,
 		generic_handle_irq(irq);
 	}
 
+#ifndef CONFIG_ARCH_HAS_IRQENTRY_ENTER
 	irq_exit();
+#endif
 	set_irq_regs(old_regs);
 	return ret;
 }