linux/drivers/accel/ivpu
Tomasz Rusinowicz d71333ffdd 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
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 14:02:44 +01:00
..
ivpu_coredump.c accel/ivpu: Add coredump support 2024-10-11 12:44:38 +02:00
ivpu_coredump.h accel/ivpu: Add coredump support 2024-10-11 12:44:38 +02:00
ivpu_debugfs.c accel/ivpu: Use effective buffer size for zero terminator 2025-05-12 15:12:44 +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-01 12:37:21 +02:00
ivpu_drv.h accel/ivpu: Add turbo flag to the DRM_IVPU_CMDQ_CREATE ioctl 2025-06-16 13:35:42 +02:00
ivpu_fw.c accel/ivpu: Use firmware names from upstream repo 2025-05-28 11:44:03 +02:00
ivpu_fw.h accel/ivpu: Make function parameter names consistent 2025-09-01 12:18:36 +02:00
ivpu_fw_log.c accel/ivpu: Fix fw log printing 2024-10-11 12:43:49 +02:00
ivpu_fw_log.h accel/ivpu: Add coredump support 2024-10-11 12:44:38 +02:00
ivpu_gem.c accel/ivpu: Fix race condition when unbinding BOs 2025-12-18 14:02:44 +01:00
ivpu_gem.h accel/ivpu: Rework bind/unbind of imported buffers 2025-12-18 14:02:26 +01:00
ivpu_hw.c Merge drm/drm-next into drm-misc-next 2025-06-11 09:01:34 +02:00
ivpu_hw.h accel/ivpu: Show NPU frequency in sysfs 2025-04-11 12:01:20 +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 2024-10-11 12:53:44 +02:00
ivpu_hw_btrs.c accel/ivpu: Fix DCT active percent format 2025-12-18 14:02:26 +01:00
ivpu_hw_btrs.h accel/ivpu: Fix DCT active percent format 2025-12-18 14:02:26 +01:00
ivpu_hw_btrs_lnl_reg.h accel/ivpu: Add platform detection for presilicon 2025-01-09 09:35:45 +01: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: Add initial Wildcat Lake support 2025-06-16 13:35:27 +02: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: Add support for hardware fault injection 2025-02-03 10:39:45 +01:00
ivpu_ipc.c accel/ivpu: Remove lockdep_assert_irqs_disabled() 2025-07-22 10:26:37 +02:00
ivpu_ipc.h accel/ivpu: Use workqueue for IRQ handling 2025-01-09 09:35:44 +01:00
ivpu_job.c accel/ivpu: Rework bind/unbind of imported buffers 2025-12-18 14:02:26 +01:00
ivpu_job.h accel/ivpu: Set command queue management capability based on HWS 2025-01-09 09:35:44 +01:00
ivpu_jsm_msg.c accel/ivpu: Trigger device recovery on engine reset/resume failure 2025-06-05 14:36:56 +02:00
ivpu_jsm_msg.h accel/ivpu: Add FW state dump on TDR 2024-10-11 12:44:38 +02:00
ivpu_mmu.c accel/ivpu: Add missing locks around mmu queues 2025-02-10 10:45:40 +01:00
ivpu_mmu.h accel/ivpu: Move parts of MMU event IRQ handling to thread handler 2025-01-09 09:35:44 +01:00
ivpu_mmu_context.c Merge drm/drm-next into drm-misc-next 2025-02-06 13:47:32 +01:00
ivpu_mmu_context.h accel/ivpu: Dump only first MMU fault from single context 2025-01-09 09:35:44 +01:00
ivpu_ms.c accel/ivpu: Fix PM related deadlocks in MS IOCTLs 2025-03-31 14:19:05 +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 14:02:26 +01:00
ivpu_pm.h accel/ivpu: Prevent recovery work from being queued during device removal 2025-09-01 12:37:21 +02:00
ivpu_sysfs.c accel/ivpu: Show NPU frequency in sysfs 2025-04-11 12:01:20 +02:00
ivpu_sysfs.h accel/ivpu: Share NPU busy time in sysfs 2024-05-15 07:42:29 +02:00
ivpu_trace.h accel/ivpu: Add tracing for IPC/PM/JOB 2024-10-11 12:44:39 +02:00
ivpu_trace_points.c accel/ivpu: Add tracing for IPC/PM/JOB 2024-10-11 12:44:39 +02:00
Kconfig accel/ivpu: Add debug Kconfig option 2024-10-30 10:23:49 +01:00
Makefile accel/ivpu: Add debug Kconfig option 2024-10-30 10:23:49 +01:00
vpu_boot_api.h accel/ivpu: Update FW Boot API to version 3.28.3 2025-04-11 11:50:31 +02:00
vpu_jsm_api.h accel/ivpu: Update FW Boot API to version 3.28.3 2025-04-11 11:50:31 +02:00