[PATCH v8] riscv: errata: Add C-SKY ERRATA WRITE_ONCE fixup
Drew Fustini
fustini at kernel.org
Sun Nov 29 19:26:58 PST 2026
On Mon, Nov 30, 2026 at 01:58:35AM +0000, GUO Ren (XuanTie) wrote:
> The early version of C-SKY C910 core has a store merge buffer
It is confusing to me that this now says C-SKY. If it is going to be
changed from the previous revision, then I think there needs to be an
explanation. It is not clear what the difference is between T-HEAD and
C-SKY.
> delay problem. The store merge buffer could improve the store queue
> performance by merging multi-store requests, but when there are not
> continued store requests, the prior single store request would be
> waiting in the store queue for a long time. That would cause
> significant problems for communication between multi-cores. This
> problem was found on sg2042 platform with the qspinlock lock torture
> test.
>
> So appending a fence w.o could immediately flush the store merge
> buffer and let other cores see the write result.
>
> This will apply the WRITE_ONCE errata to handle the non-standard
> behavior via appending a fence w.o instruction for WRITE_ONCE().
>
> This problem is only observed on the sg2042 hardware platform: it
> takes hours of locktorture stress testing to trigger the livelock
> once, and an interrupt can break the livelock. No user space
> application has been observed to hit this problem, so there is no
> need to modify user space WRITE_ONCE(). The vDSO code runs in user
> space context as well, so its WRITE_ONCE() does not need the errata
> fence either.
>
> Acked-by: Arnd Bergmann <arnd at arndb.de>
> Reviewed-by: Alexandre Ghiti <alexghiti at rivosinc.com>
> Reviewed-by: Leonardo Bras <leobras at redhat.com>
> Reviewed-by: Inochi Amaoto <inochiama at gmail.com>
> Tested-by: Han Gao <gaohan at iscas.ac.cn>
> Tested-by: Yao Zi <me at ziyao.cc>
> Cc: Chen Wang <unicorn_wang at outlook.com>
> Cc: Xiaoguang Xing <xiaoguang.xing at sophgo.com>
> Cc: Paul Walmsley <pjw at kernel.org>
> Cc: Drew Fustini <fustini at kernel.org>
> Co-developed-by: Han Gao <gaohan at iscas.ac.cn>
> Signed-off-by: Han Gao <gaohan at iscas.ac.cn>
> Reviewed-by: Drew Fustini <fustini at kernel.org>
> Signed-off-by: GUO Ren (XuanTie) <guoren at kernel.org>
[..]
> diff --git a/arch/riscv/Kconfig.errata b/arch/riscv/Kconfig.errata
> index 4f77b3c6d7fd..dfa99f1cfd4e 100644
> --- a/arch/riscv/Kconfig.errata
> +++ b/arch/riscv/Kconfig.errata
> @@ -179,4 +179,22 @@ config ERRATA_THEAD_GHOSTWRITE
>
> If you don't know what to do here, say "Y".
>
> +config ERRATA_THEAD_WRITE_ONCE
> + bool "Apply C-SKY WRITE_ONCE errata"
Also, here it is ERRATA_THEAD_WRITE_ONCE but "C-SKY WRITE_ONCE"
Thanks,
Drew
More information about the linux-riscv
mailing list