Merge tag 'powerpc-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-2.6-block.git] / arch / powerpc / xmon / xmon.c
index fe34c4fdd24ae24a1a37bfdb6b2197642871dc90..da4d7f225a409bc03b0cf84a67fea7724833bed3 100644 (file)
@@ -3266,6 +3266,7 @@ memzcan(void)
 
 static void show_task(struct task_struct *volatile tsk)
 {
+       unsigned int p_state = READ_ONCE(tsk->__state);
        char state;
 
        /*
@@ -3273,14 +3274,14 @@ static void show_task(struct task_struct *volatile tsk)
         * appropriate for calling from xmon. This could be moved
         * to a common, generic, routine used by both.
         */
-       state = (tsk->state == 0) ? 'R' :
-               (tsk->state < 0) ? 'U' :
-               (tsk->state & TASK_UNINTERRUPTIBLE) ? 'D' :
-               (tsk->state & TASK_STOPPED) ? 'T' :
-               (tsk->state & TASK_TRACED) ? 'C' :
+       state = (p_state == 0) ? 'R' :
+               (p_state < 0) ? 'U' :
+               (p_state & TASK_UNINTERRUPTIBLE) ? 'D' :
+               (p_state & TASK_STOPPED) ? 'T' :
+               (p_state & TASK_TRACED) ? 'C' :
                (tsk->exit_state & EXIT_ZOMBIE) ? 'Z' :
                (tsk->exit_state & EXIT_DEAD) ? 'E' :
-               (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?';
+               (p_state & TASK_INTERRUPTIBLE) ? 'S' : '?';
 
        printf("%16px %16lx %16px %6d %6d %c %2d %s\n", tsk,
                tsk->thread.ksp, tsk->thread.regs,