History

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.

Mark Rutland committed 5 years ago

Commit 7ecbc641 parent 418360b3 files · +2 −11Browse files

Unified · Split

3 files
  1. arch/riscv/Kconfig +0 −1
  2. arch/riscv/kernel/entry.S +1 −2
  3. arch/riscv/kernel/smp.c +1 −8
arch/riscv/Kconfig+0−1
@@ -63,7 +63,6 @@ config RISCV · 62 unmodified lines
6363 select GENERIC_SMP_IDLE_THREAD
6464 select GENERIC_TIME_VSYSCALL if MMU && 64BIT
6565 select HANDLE_DOMAIN_IRQ
66− select HANDLE_DOMAIN_IRQ_IRQENTRY
6766 select HAVE_ARCH_AUDITSYSCALL
6867 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
6968 select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
arch/riscv/kernel/entry.S+1−2
@@ -130,8 +130,7 @@ skip_context_tracking: · 129 unmodified lines
130130
131131 /* Handle interrupts */
132132 move a0, sp /* pt_regs */
133− la a1, handle_arch_irq
134− REG_L a1, (a1)
133+ la a1, generic_handle_arch_irq
135134 jr a1
136135 1:
137136 /*
arch/riscv/kernel/smp.c+1−8
@@ -140,12 +140,9 @@ void arch_irq_work_raise(void) · 139 unmodified lines
140140
141141 void handle_IPI(struct pt_regs *regs)
142142 {
143− struct pt_regs *old_regs = set_irq_regs(regs);
144143 unsigned long *pending_ipis = &ipi_data[smp_processor_id()].bits;
145144 unsigned long *stats = ipi_data[smp_processor_id()].stats;
146145
147− irq_enter();
148−
149146 riscv_clear_ipi();
150147
151148 while (true) {
@@ -156,7 +153,7 @@ void handle_IPI(struct pt_regs *regs) · 4 unmodified lines
156153
157154 ops = xchg(pending_ipis, 0);
158155 if (ops == 0)
159− goto done;
156+ return;
160157
161158 if (ops & (1 << IPI_RESCHEDULE)) {
162159 stats[IPI_RESCHEDULE]++;
@@ -189,10 +186,6 @@ void handle_IPI(struct pt_regs *regs) · 26 unmodified lines
189186 /* Order data access and bit testing. */
190187 mb();
191188 }
192−
193−done:
194− irq_exit();
195− set_irq_regs(old_regs);
196189 }
197190
198191 static const char * const ipi_names[] = {