]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/ptrace.c
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[karo-tx-linux.git] / arch / powerpc / kernel / ptrace.c
index 925a4ef9055932174b4dc5a8f0424b330149132b..660ed39e9c9a59fc3b7087362787502a41ba50fd 100644 (file)
@@ -127,12 +127,19 @@ static void flush_tmregs_to_thread(struct task_struct *tsk)
         * If task is not current, it will have been flushed already to
         * it's thread_struct during __switch_to().
         *
-        * A reclaim flushes ALL the state.
+        * A reclaim flushes ALL the state or if not in TM save TM SPRs
+        * in the appropriate thread structures from live.
         */
 
-       if (tsk == current && MSR_TM_SUSPENDED(mfmsr()))
-               tm_reclaim_current(TM_CAUSE_SIGNAL);
+       if (tsk != current)
+               return;
 
+       if (MSR_TM_SUSPENDED(mfmsr())) {
+               tm_reclaim_current(TM_CAUSE_SIGNAL);
+       } else {
+               tm_enable();
+               tm_save_sprs(&(tsk->thread));
+       }
 }
 #else
 static inline void flush_tmregs_to_thread(struct task_struct *tsk) { }