[PATCH V5] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup

Drew Fustini fustini at kernel.org
Tue Jun 2 10:08:09 PDT 2026


On Tue, Apr 21, 2026 at 10:31:40AM -0400, guoren at kernel.org wrote:
> From: "Guo Ren (Alibaba DAMO Academy)" <guoren at kernel.org>
> 
> The early version of XuanTie C910 core has a store merge buffer
> 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 & th1520 platforms 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 by
> running the lock_torture test program for half an hour. The problem
> was not found in the user space application, because interrupt can
> break the livelock.
> 
> 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>
> Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren at kernel.org>
> ---
> Changelog
> 
> v5:
>  - Add Acked-by: Arnd Bergmann <arnd at arndb.de> for asm/generic
>  - Add Reviewed-by: Inochi Amaoto <inochiama at gmail.com>
>  - Rebase on v7.0

Hi Paul,

Han Gao (revy) let me know that there is now an errata entry for 'Writes
might stick in C910/C920v1 store buffer for too long' [1].

Does that address the concern you had about documenting the errata?

Thanks,
Drew

[1] https://github.com/revyos/xuantie-c900-bugs#writes-might-stick-in-c910c920v1-store-buffer-for-too-long



More information about the linux-riscv mailing list