Commit 7ecbc648 authored by Mark Rutland's avatar Mark Rutland

irq: riscv: perform irqentry in entry code

In preparation for removing HANDLE_DOMAIN_IRQ_IRQENTRY, have arch/riscv
perform all the irqentry accounting in its entry code. As arch/riscv
uses GENERIC_IRQ_MULTI_HANDLER, we can use generic_handle_arch_irq() to
do so.

Since generic_handle_arch_irq() handles the irq entry and setting the
irq regs, and happens before the irqchip code calls handle_IPI(), we can
remove the redundant irq entry and irq regs manipulation from
handle_IPI().

There should be no functional change as a result of this patch.
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Reviewed-by: default avatarGuo Ren <guoren@kernel.org>
Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
parent 418360b2
...@@ -63,7 +63,6 @@ config RISCV ...@@ -63,7 +63,6 @@ config RISCV
select GENERIC_SMP_IDLE_THREAD select GENERIC_SMP_IDLE_THREAD
select GENERIC_TIME_VSYSCALL if MMU && 64BIT select GENERIC_TIME_VSYSCALL if MMU && 64BIT
select HANDLE_DOMAIN_IRQ select HANDLE_DOMAIN_IRQ
select HANDLE_DOMAIN_IRQ_IRQENTRY
select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
......
...@@ -130,8 +130,7 @@ skip_context_tracking: ...@@ -130,8 +130,7 @@ skip_context_tracking:
/* Handle interrupts */ /* Handle interrupts */
move a0, sp /* pt_regs */ move a0, sp /* pt_regs */
la a1, handle_arch_irq la a1, generic_handle_arch_irq
REG_L a1, (a1)
jr a1 jr a1
1: 1:
/* /*
......
...@@ -140,12 +140,9 @@ void arch_irq_work_raise(void) ...@@ -140,12 +140,9 @@ void arch_irq_work_raise(void)
void handle_IPI(struct pt_regs *regs) void handle_IPI(struct pt_regs *regs)
{ {
struct pt_regs *old_regs = set_irq_regs(regs);
unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits; unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
unsigned long *stats = ipi_data[smp_processor_id()].stats; unsigned long *stats = ipi_data[smp_processor_id()].stats;
irq_enter();
riscv_clear_ipi(); riscv_clear_ipi();
while (true) { while (true) {
...@@ -156,7 +153,7 @@ void handle_IPI(struct pt_regs *regs) ...@@ -156,7 +153,7 @@ void handle_IPI(struct pt_regs *regs)
ops = xchg(pending_ipis, 0); ops = xchg(pending_ipis, 0);
if (ops == 0) if (ops == 0)
goto done; return;
if (ops & (1 << IPI_RESCHEDULE)) { if (ops & (1 << IPI_RESCHEDULE)) {
stats[IPI_RESCHEDULE]++; stats[IPI_RESCHEDULE]++;
...@@ -189,10 +186,6 @@ void handle_IPI(struct pt_regs *regs) ...@@ -189,10 +186,6 @@ void handle_IPI(struct pt_regs *regs)
/* Order data access and bit testing. */ /* Order data access and bit testing. */
mb(); mb();
} }
done:
irq_exit();
set_irq_regs(old_regs);
} }
static const char * const ipi_names[] = { static const char * const ipi_names[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment