]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/ivpu: Rework bind/unbind of imported buffers
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Thu, 25 Sep 2025 14:50:59 +0000 (16:50 +0200)
committerKarol Wachowski <karol.wachowski@linux.intel.com>
Wed, 1 Oct 2025 07:58:50 +0000 (09:58 +0200)
commite0c0891cd63bf8338c25c423e28a5a93aed3d74c
treed5addf4196f197b12f62ddc730044d1270382d00
parent87a23fe2966668f8ea69bd9e7b080f6cb076fdc9
accel/ivpu: Rework bind/unbind of imported buffers

Ensure that imported buffers are properly mapped and unmapped in
the same way as regular buffers to properly handle buffers during
device's bind and unbind operations to prevent resource leaks and
inconsistent buffer states.

Imported buffers are now dma_mapped before submission and
dma_unmapped in ivpu_bo_unbind(), guaranteeing they are unmapped
when the device is unbound.

Add also imported buffers to vdev->bo_list for consistent unmapping
on device unbind. The bo->ctx_id is set in open() so imported
buffers have a valid context ID.

Debug logs have been updated to match the new code structure.
The function ivpu_bo_pin() has been renamed to ivpu_bo_bind()
to better reflect its purpose, and unbind tests have been refactored
for improved coverage and clarity.

Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250925145059.1446243-1-maciej.falkowski@linux.intel.com
drivers/accel/ivpu/ivpu_gem.c
drivers/accel/ivpu/ivpu_gem.h
drivers/accel/ivpu/ivpu_job.c