Skip to content

[PW_SID:1080348] [V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup#1754

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1080348
Closed

[PW_SID:1080348] [V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup#1754
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1080348

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1080348 applied to workflow__riscv__fixes

Name: [V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1080348
Version: 4

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.

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Tested-by: Han Gao <gaohan@iscas.ac.cn>
Tested-by: Yao Zi <me@ziyao.cc>
Cc: Chen Wang <unicorn_wang@outlook.com>
Cc: Inochi Amaoto <inochiama@gmail.com>
Cc: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
Cc: Paul Walmsley <pjw@kernel.org>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.62 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2244.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 3005.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 26.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.61 seconds
Result: WARNING
Output:

WARNING: 'cant' may be misspelled - perhaps 'can't'?
#63: FILE: arch/riscv/Kconfig.errata:167:
+	  cant problems for communication between multi-cores. Appending a
 	  ^^^^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#124: 
new file mode 100644

WARNING: Single statement macros should not use a do {} while (0) loop
#141: FILE: arch/riscv/include/asm/rwonce.h:13:
+#define write_once_fence()				\
+do {							\
+	asm volatile(ALTERNATIVE(			\
+		"nop",					\
+		"fence w, o",				\
+		THEAD_VENDOR_ID,			\
+		ERRATA_THEAD_WRITE_ONCE,		\
+		CONFIG_ERRATA_THEAD_WRITE_ONCE)		\
+		: : : "memory");			\
+} while (0)

WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
#154: FILE: arch/riscv/include/asm/rwonce.h:26:
+	*(volatile typeof(x) *)&(x) = (val);		\

total: 0 errors, 4 warnings, 0 checks, 108 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit b0f9730d99b0 ("riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 4 warnings, 0 checks, 108 lines checked
WARNING: 'cant' may be misspelled - perhaps 'can't'?
WARNING: Single statement macros should not use a do {} while (0) loop
WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.46 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[V4] riscv: errata: Add ERRATA_THEAD_WRITE_ONCE fixup"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1080348 branch April 20, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants