arm64: mte: Report async tag faults before suspend
[linux-2.6-microblaze.git] / arch / arm64 / kernel / mte.c
index b6336fb..820bad9 100644 (file)
@@ -265,6 +265,22 @@ void mte_thread_switch(struct task_struct *next)
        mte_check_tfsr_el1();
 }
 
+void mte_suspend_enter(void)
+{
+       if (!system_supports_mte())
+               return;
+
+       /*
+        * The barriers are required to guarantee that the indirect writes
+        * to TFSR_EL1 are synchronized before we report the state.
+        */
+       dsb(nsh);
+       isb();
+
+       /* Report SYS_TFSR_EL1 before suspend entry */
+       mte_check_tfsr_el1();
+}
+
 void mte_suspend_exit(void)
 {
        if (!system_supports_mte())