Re: [PATCH v2] riscv/fence: Consolidate fence definitions and define __{mb,rmb,wmb}

From: Andrea Parri
Date: Tue Feb 13 2024 - 05:39:52 EST


Eric,

On Mon, Feb 12, 2024 at 10:59:46AM +0000, Eric Chan wrote:
> Disparate fence implementations are consolidated into fence.h.
>
> Introduce __{mb,rmb,wmb}, and rely on the generic definitions
> for {mb,rmb,wmb}. A first consequence is that __{mb,rmb,wmb}
> map to a compiler barrier on !SMP (while their definition remains
> unchanged on SMP).
>
> Introduce RISCV_FULL_BARRIER and use in arch_atomic* function.
> like RISCV_ACQUIRE_BARRIER and RISCV_RELEASE_BARRIER, The fence
> instruction can be eliminated When SMP is not enabled.
>
> Also clean up the warning with scripts/checkpatch.pl.
>
> Signed-off-by: Eric Chan <ericchancf@xxxxxxxxxx>

I suggest to split this patch into multiple patches ("one problem per
patch" and all that), say:

1/3 - riscv/barrier: Define __{mb,rmb,wmb}
2/3 - riscv/barrier: Define RISCV_FULL_BARRIER
3/3 - riscv/barrier: Resolve checkpath.pl warnings

Please also review the changelog(s), since the description above (in
particular the information about __{mb,rmb,wmb}) doesn't seem to match
the code changes.

Andrea