linux/drivers/accel/ivpu
Tomasz Rusinowicz 0328bb097b accel/ivpu: Fix race condition when unbinding BOs
[ Upstream commit 00812636df ]

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: 48aea7f2a2 ("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
[ The context change is due to the commit e0c0891cd6
("accel/ivpu: Rework bind/unbind of imported buffers")
and the proper adoption is done. ]
Signed-off-by: Rahul Sharma <black.hawk@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-30 10:28:48 +01:00
..
ivpu_coredump.c accel/ivpu: Add coredump support 2025-02-27 04:30:15 -08:00
ivpu_coredump.h accel/ivpu: Add coredump support 2025-02-27 04:30:15 -08:00
ivpu_debugfs.c accel/ivpu: Fix reset_engine debugfs file logic 2025-08-15 12:14:10 +02:00
ivpu_debugfs.h accel/ivpu: Compile ivpu_debugfs.c conditionally 2023-09-27 13:11:51 +02:00
ivpu_drv.c accel/ivpu: Prevent recovery work from being queued during device removal 2025-09-09 18:58:14 +02:00
ivpu_drv.h accel/ivpu: Make command queue ID allocated on XArray 2025-07-06 11:01:38 +02:00
ivpu_fw.c accel/ivpu: Use firmware names from upstream repo 2025-06-27 11:11:25 +01:00
ivpu_fw.h accel/ivpu: Make function parameter names consistent 2025-12-18 13:54:40 +01:00
ivpu_fw_log.c accel/ivpu: Fix fw log printing 2025-05-22 14:29:53 +02:00
ivpu_fw_log.h accel/ivpu: Refactor functions in ivpu_fw_log.c 2025-05-22 14:29:52 +02:00
ivpu_gem.c accel/ivpu: Fix race condition when unbinding BOs 2026-01-30 10:28:48 +01:00
ivpu_gem.h accel/ivpu: Use dma_resv_lock() instead of a custom mutex 2025-06-27 11:11:25 +01:00
ivpu_hw.c accel/ivpu: Add debugfs interface for setting HWS priority bands 2025-07-06 11:01:38 +02:00
ivpu_hw.h accel/ivpu: Add debugfs interface for setting HWS priority bands 2025-07-06 11:01:38 +02:00
ivpu_hw_37xx_reg.h accel/ivpu: Split IP and buttress headers 2024-05-17 08:30:23 +02:00
ivpu_hw_40xx_reg.h accel/ivpu: Update power island delays 2025-06-10 07:12:59 -04:00
ivpu_hw_btrs.c accel/ivpu: Fix DCT active percent format 2025-12-18 13:54:40 +01:00
ivpu_hw_btrs.h accel/ivpu: Fix DCT active percent format 2025-12-18 13:54:40 +01:00
ivpu_hw_btrs_lnl_reg.h accel/ivpu: Implement DCT handling 2024-06-14 09:13:32 +02:00
ivpu_hw_btrs_mtl_reg.h accel/ivpu: Split IP and buttress headers 2024-05-17 08:30:23 +02:00
ivpu_hw_ip.c accel/ivpu: Update power island delays 2025-06-10 07:12:59 -04:00
ivpu_hw_ip.h accel/ivpu: Replace wake_thread with kfifo 2024-05-17 08:30:27 +02:00
ivpu_hw_reg_io.h accel/ivpu: Fix verbose version of REG_POLL macros 2023-10-23 08:57:25 +02:00
ivpu_ipc.c accel/ivpu: Fix warning in ivpu_ipc_send_receive_internal() 2025-04-20 10:15:42 +02:00
ivpu_ipc.h accel/ivpu: Add FW state dump on TDR 2025-02-27 04:30:15 -08:00
ivpu_job.c accel/ivpu: Ensure rpm_runtime_put in case of engine reset/resume fail 2025-12-18 13:54:40 +01:00
ivpu_job.h accel/ivpu: Make command queue ID allocated on XArray 2025-07-06 11:01:38 +02:00
ivpu_jsm_msg.c accel/ivpu: Trigger device recovery on engine reset/resume failure 2025-07-06 11:01:38 +02:00
ivpu_jsm_msg.h accel/ivpu: Add FW state dump on TDR 2025-02-27 04:30:15 -08:00
ivpu_mmu.c accel/ivpu: Abort all jobs after command queue unregister 2025-05-09 09:50:50 +02:00
ivpu_mmu.h accel/ivpu: Dump MMU events in case of VPU boot timeout 2024-01-22 10:27:37 +01:00
ivpu_mmu_context.c accel/ivpu: Make parts of FW image read-only 2024-06-14 09:14:29 +02:00
ivpu_mmu_context.h accel/ivpu: Make parts of FW image read-only 2024-06-14 09:14:29 +02:00
ivpu_ms.c accel/ivpu: Fix deadlock in ivpu_ms_cleanup() 2025-04-20 10:15:42 +02:00
ivpu_ms.h accel/ivpu: Add NPU profiling support 2024-05-15 07:42:23 +02:00
ivpu_pm.c accel/ivpu: Fix DCT active percent format 2025-12-18 13:54:40 +01:00
ivpu_pm.h accel/ivpu: Prevent recovery work from being queued during device removal 2025-09-09 18:58:14 +02:00
ivpu_sysfs.c accel/ivpu: Abort all jobs after command queue unregister 2025-05-09 09:50:50 +02:00
ivpu_sysfs.h accel/ivpu: Share NPU busy time in sysfs 2024-05-15 07:42:29 +02:00
Kconfig accel/ivpu: Add coredump support 2025-02-27 04:30:15 -08:00
Makefile accel/ivpu: Add coredump support 2025-02-27 04:30:15 -08:00
vpu_boot_api.h accel/ivpu: Update VPU FW API headers 2025-05-09 09:50:49 +02:00
vpu_jsm_api.h accel/ivpu: Update VPU FW API headers 2025-05-09 09:50:49 +02:00