Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

accel/ivpu: Fix race condition when unbinding BOs

Fix 'Memory manager not clean during takedown' warning that occurs
when ivpu_gem_bo_free() removes the BO from the BOs list before it
gets unmapped. Then file_priv_unbind() triggers a warning in
drm_mm_takedown() during context teardown.

Protect the unmapping sequence with bo_list_lock to ensure the BO is
always fully unmapped when removed from the list. This ensures the BO
is either fully unmapped at context teardown time or present on the
list and unmapped by file_priv_unbind().

Fixes: 48aea7f2a2ef ("accel/ivpu: Fix locking in ivpu_bo_remove_all_bos_from_context()")
Signed-off-by: Tomasz Rusinowicz <tomasz.rusinowicz@intel.com>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://patch.msgid.link/20251029071451.184243-1-karol.wachowski@linux.intel.com

authored by

Tomasz Rusinowicz and committed by
Karol Wachowski
00812636 0f5b2982

+2 -1
+2 -1
drivers/accel/ivpu/ivpu_gem.c
··· 315 315 316 316 mutex_lock(&vdev->bo_list_lock); 317 317 list_del(&bo->bo_list_node); 318 - mutex_unlock(&vdev->bo_list_lock); 319 318 320 319 drm_WARN_ON(&vdev->drm, !drm_gem_is_imported(&bo->base.base) && 321 320 !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_READ)); ··· 324 325 ivpu_bo_lock(bo); 325 326 ivpu_bo_unbind_locked(bo); 326 327 ivpu_bo_unlock(bo); 328 + 329 + mutex_unlock(&vdev->bo_list_lock); 327 330 328 331 drm_WARN_ON(&vdev->drm, bo->mmu_mapped); 329 332 drm_WARN_ON(&vdev->drm, bo->ctx);