ARC: remove redundant READ_ONCE() in cmpxchg loop
authorBang Li <libang.linuxer@gmail.com>
Sat, 19 Mar 2022 02:03:16 +0000 (10:03 +0800)
committerVineet Gupta <vgupta@kernel.org>
Mon, 18 Apr 2022 21:47:05 +0000 (14:47 -0700)
This patch reverts commit 7082a29c22ac ("ARC: use ACCESS_ONCE in cmpxchg
loop").

It is not necessary to use READ_ONCE() because cmpxchg contains barrier. We
can get it from commit d57f727264f1 ("ARC: add compiler barrier to LLSC
based cmpxchg").

Signed-off-by: Bang Li <libang.linuxer@gmail.com>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
arch/arc/kernel/smp.c

index 383fefee2ae56fcc20f922d75fccf25e0f0ffd3f..d947473f1e6da5f906ba25c7841c99bb981055ad 100644 (file)
@@ -274,7 +274,7 @@ static void ipi_send_msg_one(int cpu, enum ipi_msg_type msg)
         * and read back old value
         */
        do {
-               new = old = READ_ONCE(*ipi_data_ptr);
+               new = old = *ipi_data_ptr;
                new |= 1U << msg;
        } while (cmpxchg(ipi_data_ptr, old, new) != old);