csky: Fixup do_page_fault parent irq status
authorGuo Ren <guoren@linux.alibaba.com>
Mon, 28 Dec 2020 15:11:26 +0000 (15:11 +0000)
committerGuo Ren <guoren@linux.alibaba.com>
Tue, 12 Jan 2021 01:52:41 +0000 (09:52 +0800)
We must succeed parent's context irq status in page fault handler.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
arch/csky/kernel/entry.S
arch/csky/mm/fault.c

index 185fea4..c1bd7a6 100644 (file)
@@ -42,7 +42,7 @@ ENTRY(csky_pagefault)
        SAVE_ALL 0
        zero_fp
        context_tracking
-       psrset  ee, ie
+       psrset  ee
        mov     a0, sp
        jbsr    do_page_fault
        jmpi    ret_from_exception
index 9533bd8..cd8c730 100644 (file)
@@ -143,6 +143,10 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
                return;
        }
 
+       /* Enable interrupts if they were enabled in the parent context. */
+       if (likely(regs->sr & BIT(6)))
+               local_irq_enable();
+
        /*
         * If we're in an interrupt or have no user
         * context, we must not take the fault..