Skip to content

Commit fd7726e

Browse files
committed
accel/ivpu: Fix deadlock in context_xa
ivpu_device->context_xa is locked both in kernel thread and IRQ context. It requires XA_FLAGS_LOCK_IRQ flag to be passed during initialization otherwise the lock could be acquired from a thread and interrupted by an IRQ that locks it for the second time causing the deadlock. This deadlock was reported by lockdep and observed in internal tests. Fixes: 35b1376 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Cc: <[email protected]> # v6.3+ Signed-off-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 0d298e2 commit fd7726e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
517517
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
518518
vdev->context_xa_limit.max = IVPU_USER_CONTEXT_MAX_SSID;
519519
atomic64_set(&vdev->unique_id_counter, 0);
520-
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC);
520+
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC | XA_FLAGS_LOCK_IRQ);
521521
xa_init_flags(&vdev->submitted_jobs_xa, XA_FLAGS_ALLOC1);
522522
xa_init_flags(&vdev->db_xa, XA_FLAGS_ALLOC1);
523523
lockdep_set_class(&vdev->submitted_jobs_xa.xa_lock, &submitted_jobs_xa_lock_class_key);

0 commit comments

Comments
 (0)