Skip to content

[PW_SID:1118585] [v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup#2164

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1118585
Closed

[PW_SID:1118585] [v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup#2164
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1118585

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1118585 applied to workflow__riscv__fixes

Name: [v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1118585
Version: 2

Linux RISC-V bot and others added 2 commits June 25, 2026 20:36
…rdware lockup

When the RISC-V IOMMU encounters an illegal command, the hardware
stops processing and the HEAD register remains pointing at the
illegal command. If software does not handle this properly, the
hardware will be stuck at this index indefinitely, preventing any
further command queue operations.

This patch implements a recovery mechanism by replacing the illegal
command with a dummy IOFENCE instruction (all operands are zero):

1. Prevents hardware lockup: By overwriting the illegal command with
   a valid instruction, the hardware can continue processing from the
   current position instead of being stuck.

2. Enables user recovery: After replacing the illegal command, the
   user/driver has an opportunity to retry the original failed
   operation rather than losing all queued work.

3. Minimal hardware impact: A dummy IOFENCE behaves as a NOP, it
   it performs no cache invalidation operations and has no side
   effects on the system state. This is the safest replacement
   instruction.

Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 153.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1454.16 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1768.62 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.29 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 31.01 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.00 seconds
Result: WARNING
Output:

CHECK: Blank lines aren't necessary after an open brace '{'
#51: FILE: drivers/iommu/riscv/iommu.c:474:
 		    RISCV_IOMMU_CQCSR_CMD_ILL | RISCV_IOMMU_CQCSR_FENCE_W_IP)) {
+

total: 0 errors, 0 warnings, 1 checks, 44 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 2de095472bec ("iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup") 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, 0 warnings, 1 checks, 44 lines checked
CHECK: Blank lines aren't necessary after an open brace '{'


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.62 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
kdoc
Desc: Detects for kdoc errors
Duration: 1.16 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
module-param
Desc: Detect module_param changes
Duration: 5.50 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 1.02 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v2] iommu/riscv: Replace illegal command with dummy IOFENCE to prevent hardware lockup"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.57 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch 2 times, most recently from 89be0ce to dc5ff20 Compare July 7, 2026 03:25
@linux-riscv-bot
linux-riscv-bot deleted the pw1118585 branch July 8, 2026 01:57
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