Skip to content

Commit 7ecbc64

Browse files
committed
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: Mark Rutland <[email protected]> Reviewed-by: Guo Ren <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Albert Ou <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Thomas Gleixner <[email protected]>
1 parent 418360b commit 7ecbc64

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

arch/riscv/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ config RISCV
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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ skip_context_tracking:
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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,9 @@ void arch_irq_work_raise(void)
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)
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)
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[] = {

0 commit comments

Comments
 (0)