[PATCH 0/5] iommu/rockchip: page fault and reset handling fixes
Arun Iyengar via B4 Relay
devnull+aiyengar1990.gmail.com at kernel.org
Mon Nov 9 23:11:01 PST 2026
Fixes for the Rockchip IOMMU found on an Orange Pi 5 (RK3588S) while
making the video codec drivers recover from bad jobs (Hantro VEPU121
JPEG encoder, rkvdec VDPU381 decoder):
1. log_iova() walked a page table that a master's own reset had taken
away (DTE_ADDR read as 0) and oopsed under KASAN.
2. A master that keeps faulting on unmapped memory printed three lines
per fault from the hard interrupt handler; on a 115200 baud console
one bad job kept the CPU in rk_iommu_irq() for 2 s. Rate-limit it.
3. FORCE_RESET swapped the poll period and the timeout.
4. The stall/paging helpers skipped a bank whose state differed from
the other bank; the two banks of an RK3588 decoder IOMMU were read
back in different states after a reset that timed out.
5. In a page fault storm the IOMMU now leaves the fault pending (which
holds the master) and masks the interrupt until the master's driver
resets and re-attaches it, or 100 ms pass. Before, one bad JPEG
encode job kept CPU0 in interrupt context until the soft lockup
detector and then the hardware watchdog reset the board.
Tested on an Orange Pi 5 (RK3588S): patch 1 with an rkvdec fault
injection run under KASAN (the "page table lost to a reset" path taken
14 times in 3178 decoder recoveries and 96 injected faults, no other
report); patches 2 and 5 with a VEPU121 JPEG encode job given an
unmapped input address, ten times (the storm held after 65 faults,
rk_iommu_irq() 0.8 to 1.7 ms per bad job instead of 2.02 s, the
encoder's timeout reset the core every time, and the GStreamer pipeline
that used to lock the board up ran to its end ten times). The whole
series has been in the board's kernel since, including MPEG-4 and VP9
decoder bring-up runs that hit page fault storms and recovered.
This series was developed with Claude (Anthropic) as a coding assistant:
it wrote the code and the commit messages, and I reviewed and tested
every change as described above.
Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
---
Arun Iyengar (5):
iommu/rockchip: Don't walk a page table that a reset took away
iommu/rockchip: Rate-limit the page fault reports
iommu/rockchip: Fix the poll period and timeout of FORCE_RESET
iommu/rockchip: Don't skip a bank whose state differs from the others
iommu/rockchip: Hold the master in a page fault storm
drivers/iommu/rockchip-iommu.c | 217 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 192 insertions(+), 25 deletions(-)
---
base-commit: 2cf4be57b301ed2d7af82e70cff5dfd96894d8de
change-id: 20261110-iommu-rockchip-faults-0c1e41c33ed7
Best regards,
--
Arun Iyengar <aiyengar1990 at gmail.com>
More information about the Linux-rockchip
mailing list