RISC-V: entry: Remove unneeded need_resched() loop
authorValentin Schneider <valentin.schneider@arm.com>
Mon, 23 Sep 2019 14:36:17 +0000 (15:36 +0100)
committerPaul Walmsley <paul.walmsley@sifive.com>
Wed, 9 Oct 2019 23:48:27 +0000 (16:48 -0700)
Since the enabling and disabling of IRQs within preempt_schedule_irq()
is contained in a need_resched() loop, we don't need the outer arch
code loop.

Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/kernel/entry.S

index 2d592da..8ca4798 100644 (file)
@@ -273,12 +273,11 @@ restore_all:
 resume_kernel:
        REG_L s0, TASK_TI_PREEMPT_COUNT(tp)
        bnez s0, restore_all
-need_resched:
        REG_L s0, TASK_TI_FLAGS(tp)
        andi s0, s0, _TIF_NEED_RESCHED
        beqz s0, restore_all
        call preempt_schedule_irq
-       j need_resched
+       j restore_all
 #endif
 
 work_pending: