[PATCH -fixes v2] riscv: Fix fully ordered LR/SC xchg[8|16]() implementations
Andrea Parri
parri.andrea at gmail.com
Thu May 30 08:18:43 PDT 2024
On Thu, May 30, 2024 at 04:55:46PM +0200, Alexandre Ghiti wrote:
> The fully ordered versions of xchg[8|16]() using LR/SC lack the
> necessary memory barriers to guarantee the order.
>
> Fix this by matching what is already implemented in the fully ordered
> versions of cmpxchg() using LR/SC.
>
> Suggested-by: Andrea Parri <parri.andrea at gmail.com>
> Reported-by: Andrea Parri <parri.andrea at gmail.com>
> Closes: https://lore.kernel.org/linux-riscv/ZlYbupL5XgzgA0MX@andrea/T/#u
> Fixes: a8ed2b7a2c13 ("riscv/cmpxchg: Implement xchg for variables of size 1 and 2")
> Signed-off-by: Alexandre Ghiti <alexghiti at rivosinc.com>
Reviewed-by: Andrea Parri <parri.andrea at gmail.com>
Thanks!
Andrea
More information about the linux-riscv
mailing list