Re: [PATCH V5] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup

Drew Fustini <[email protected]> Wed, 29 Jul 2026 06:43:22 -0700
Newsgroups org.kernel.vger.linux-arch,dev.linux.lists.sophgo,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel
Message-ID <amoDeloQAro0Zcsy@x1>
On Tue, Jun 02, 2026 at 10:08:09AM -0700, Drew Fustini wrote:
> On Tue, Apr 21, 2026 at 10:31:40AM -0400, [email protected] wrote:
> > From: "Guo Ren (Alibaba DAMO Academy)" <[email protected]>
> > 
> > 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 <[email protected]>
> > Reviewed-by: Alexandre Ghiti <[email protected]>
> > Reviewed-by: Leonardo Bras <[email protected]>
> > Reviewed-by: Inochi Amaoto <[email protected]>
> > Tested-by: Han Gao <[email protected]>
> > Tested-by: Yao Zi <[email protected]>
> > Cc: Chen Wang <[email protected]>
> > Cc: Xiaoguang Xing <[email protected]>
> > Cc: Paul Walmsley <[email protected]>
> > Signed-off-by: Guo Ren (Alibaba DAMO Academy) <[email protected]>
> > ---
> > Changelog
> > 
> > v5:
> >  - Add Acked-by: Arnd Bergmann <[email protected]> for asm/generic
> >  - Add Reviewed-by: Inochi Amaoto <[email protected]>
> >  - 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

Hi Paul, could this be considered for the upcoming merge window?

Thanks,
Drew