accel/ivpu: Fix dev open/close races with unbind
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Mon, 22 Jan 2024 12:09:43 +0000 (13:09 +0100)
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Thu, 25 Jan 2024 09:16:56 +0000 (10:16 +0100)
commitf1cc6aceecd04964304786530eaa4ad87d90b972
treeabbfe177f3f83772c837cec402338fdf943938b1
parentd1b163aa0749706379055e40a52cf7a851abf9dc
accel/ivpu: Fix dev open/close races with unbind

  - Add context_list_lock to synchronize user context addition/removal
  - Use drm_dev_enter() to prevent unbinding the device during ivpu_open()
    and vpu address allocation

Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Wachowski, Karol <karol.wachowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240122120945.1150728-2-jacek.lawrynowicz@linux.intel.com
drivers/accel/ivpu/ivpu_drv.c
drivers/accel/ivpu/ivpu_drv.h
drivers/accel/ivpu/ivpu_gem.c
drivers/accel/ivpu/ivpu_gem.h
drivers/accel/ivpu/ivpu_job.c
drivers/accel/ivpu/ivpu_job.h