[PATCH v2 0/3] accel/rocket: Fix BO creation and prep_bo handling

From: Sidong Yang

Date: Fri Dec 04 2026 - 12:40:31 EST


This series fixes three bugs in drivers/accel/rocket/rocket_gem.c, based
on drm-misc-fixes:

1. Store iommu_map_sgtable() return values in ssize_t (avoiding int
truncation and leaked IOMMU mappings on >= 2 GiB allocations), size
the drm_mm node from gem_obj->size, and unmap short mappings on error.
2. Skip dma_sync_sgtable_for_cpu() in rocket_ioctl_prep_bo() when the
fence wait fails.
3. Wait on DMA_RESV_USAGE_READ in rocket_ioctl_prep_bo() so PREP_BO also
waits for in-flight jobs that published read fences on input BOs.

Tested on a ROCK 5B+ (RK3588).

Changes in v2:
- Dropped "Reject zero-sized BO creation". Its description was wrong
(the ioctl already fails with -ENOSPC, nothing crashes) and Hu Xinyao's
patch [1] covers it. On top of [1], 1/3 needs "git am -3".
- 1/3: rebased without that patch.
- 2/3: reworded the commit message, dropped Cc: stable.

v1: https://lore.kernel.org/r/20261128063844.1537615-1-sidong.yang@xxxxxxxxxx
[1] https://lore.kernel.org/r/2287DB0FF71AB8B8+1796018957.205946-1-huxinyao@xxxxxxxxxxxxxxx

Sidong Yang (3):
accel/rocket: Fix iommu_map_sgtable() return handling in create_bo
accel/rocket: Skip CPU cache sync when prep_bo wait fails
accel/rocket: Wait for read fences in rocket_ioctl_prep_bo()

drivers/accel/rocket/rocket_gem.c | 37 ++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 13 deletions(-)


base-commit: ae720e1e682846a3c23ba572d96a38f46709bef0
--
2.53.0