Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irq: nds32: avoid CONFIG_HANDLE_DOMAIN_IRQ

In preparation for removing HANDLE_DOMAIN_IRQ, have arch/nds32 perform
all the necessary IRQ entry accounting in its entry code.

Currently arch/nds32 is tightly coupled with the ativic32 irqchip, and
while the entry code should logically live under arch/nds32/, moving the
entry logic there makes things more convoluted. So for now, place the
entry logic in the ativic32 irqchip, but separated into a separate
function to make the split of responsibility clear.

In future this should probably use GENERIC_IRQ_MULTI_HANDLER to cleanly
decouple this.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Nick Hu <nickhu@andestech.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vincent Chen <deanbo422@gmail.com>

+20 -3
-1
arch/nds32/Kconfig
··· 27 27 select GENERIC_LIB_MULDI3 28 28 select GENERIC_LIB_UCMPDI2 29 29 select GENERIC_TIME_VSYSCALL 30 - select HANDLE_DOMAIN_IRQ 31 30 select HAVE_ARCH_TRACEHOOK 32 31 select HAVE_DEBUG_KMEMLEAK 33 32 select HAVE_EXIT_THREAD
+20 -2
drivers/irqchip/irq-ativic32.c
··· 5 5 #include <linux/of.h> 6 6 #include <linux/of_irq.h> 7 7 #include <linux/of_address.h> 8 + #include <linux/hardirq.h> 8 9 #include <linux/interrupt.h> 9 10 #include <linux/irqdomain.h> 10 11 #include <linux/irqchip.h> 11 12 #include <nds32_intrinsic.h> 13 + 14 + #include <asm/irq_regs.h> 12 15 13 16 unsigned long wake_mask; 14 17 ··· 106 103 - NDS32_VECTOR_offINTERRUPT; 107 104 } 108 105 109 - asmlinkage void asm_do_IRQ(struct pt_regs *regs) 106 + static void ativic32_handle_irq(struct pt_regs *regs) 110 107 { 111 108 irq_hw_number_t hwirq = get_intr_src(); 112 - handle_domain_irq(root_domain, hwirq, regs); 109 + generic_handle_domain_irq(root_domain, hwirq); 110 + } 111 + 112 + /* 113 + * TODO: convert nds32 to GENERIC_IRQ_MULTI_HANDLER so that this entry logic 114 + * can live in arch code. 115 + */ 116 + asmlinkage void asm_do_IRQ(struct pt_regs *regs) 117 + { 118 + struct pt_regs *old_regs; 119 + 120 + irq_enter(); 121 + old_regs = set_irq_regs(regs); 122 + ativic32_handle_irq(regs); 123 + set_irq_regs(old_regs); 124 + irq_exit(); 113 125 } 114 126 115 127 int __init ativic32_init_irq(struct device_node *node, struct device_node *parent)