arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work
[linux-2.6-microblaze.git] / arch / arm64 / mm / fault.c
index c9cedc0..dff2d72 100644 (file)
@@ -635,11 +635,13 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 
        inf = esr_to_fault_info(esr);
 
-       /*
-        * Return value ignored as we rely on signal merging.
-        * Future patches will make this more robust.
-        */
-       apei_claim_sea(regs);
+       if (user_mode(regs) && apei_claim_sea(regs) == 0) {
+               /*
+                * APEI claimed this as a firmware-first notification.
+                * Some processing deferred to task_work before ret_to_user().
+                */
+               return 0;
+       }
 
        if (esr & ESR_ELx_FnV)
                siaddr = NULL;