Skip to content

Commit f431baa

Browse files
atsushi-nemotoralfbaechle
authored andcommitted
[MIPS] ret_from_irq adjustment
Make sure that RA on top of interrupt stack is an address of ret_from_irq, so that dump_stack etc. can trace info interrupted context. Also this patch fixes except_vec_vi_handler and __smtc_ipi_vector which seems broken. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 441ee34 commit f431baa

4 files changed

Lines changed: 19 additions & 23 deletions

File tree

‎arch/mips/dec/int-handler.S‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,8 @@
266266
handle_it:
267267
LONG_L s0, TI_REGS($28)
268268
LONG_S sp, TI_REGS($28)
269-
jal do_IRQ
270-
LONG_S s0, TI_REGS($28)
271-
272-
j ret_from_irq
269+
PTR_LA ra, ret_from_irq
270+
j do_IRQ
273271
nop
274272

275273
#ifdef CONFIG_32BIT
@@ -279,9 +277,8 @@ fpu:
279277
#endif
280278

281279
spurious:
282-
jal spurious_interrupt
283-
nop
284-
j ret_from_irq
280+
PTR_LA ra, _ret_from_irq
281+
j spurious_interrupt
285282
nop
286283
END(plat_irq_dispatch)
287284

‎arch/mips/kernel/entry.S‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
#include <asm/mipsmtregs.h>
2121
#endif
2222

23-
#ifdef CONFIG_PREEMPT
24-
.macro preempt_stop
25-
.endm
26-
#else
23+
#ifndef CONFIG_PREEMPT
2724
.macro preempt_stop
2825
local_irq_disable
2926
.endm
@@ -32,9 +29,16 @@
3229

3330
.text
3431
.align 5
32+
FEXPORT(ret_from_irq)
33+
LONG_S s0, TI_REGS($28)
34+
#ifdef CONFIG_PREEMPT
35+
FEXPORT(ret_from_exception)
36+
#else
37+
b _ret_from_irq
3538
FEXPORT(ret_from_exception)
3639
preempt_stop
37-
FEXPORT(ret_from_irq)
40+
#endif
41+
FEXPORT(_ret_from_irq)
3842
LONG_L t0, PT_STATUS(sp) # returning to kernel mode?
3943
andi t0, t0, KU_USER
4044
beqz t0, resume_kernel

‎arch/mips/kernel/genex.S‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ NESTED(handle_int, PT_SIZE, sp)
133133

134134
LONG_L s0, TI_REGS($28)
135135
LONG_S sp, TI_REGS($28)
136-
jal plat_irq_dispatch
137-
LONG_S s0, TI_REGS($28)
138-
j ret_from_irq
136+
PTR_LA ra, ret_from_irq
137+
j plat_irq_dispatch
139138
END(handle_int)
140139

141140
__INIT
@@ -224,9 +223,8 @@ NESTED(except_vec_vi_handler, 0, sp)
224223

225224
LONG_L s0, TI_REGS($28)
226225
LONG_S sp, TI_REGS($28)
227-
jalr v0
228-
LONG_S s0, TI_REGS($28)
229226
PTR_LA ra, ret_from_irq
227+
jr v0
230228
END(except_vec_vi_handler)
231229

232230
/*

‎arch/mips/kernel/smtc-asm.S‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,12 @@ FEXPORT(__smtc_ipi_vector)
9797
SAVE_ALL
9898
CLI
9999
TRACE_IRQS_OFF
100-
move a0,sp
101100
/* Function to be invoked passed stack pad slot 5 */
102101
lw t0,PT_PADSLOT5(sp)
103102
/* Argument from sender passed in stack pad slot 4 */
104-
lw a1,PT_PADSLOT4(sp)
105-
jalr t0
106-
nop
107-
j ret_from_irq
108-
nop
103+
lw a0,PT_PADSLOT4(sp)
104+
PTR_LA ra, _ret_from_irq
105+
jr t0
109106

110107
/*
111108
* Called from idle loop to provoke processing of queued IPIs

0 commit comments

Comments
 (0)