]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
accel/ivpu: Fix deadlock in context_xa
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Tue, 2 Apr 2024 10:49:29 +0000 (12:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:19:34 +0000 (11:19 +0200)
commitd43e11d9c7fcb16f18bd46ab2556c2772ffc5775
treebfc288cd2f7ba696c9dadea3e409ea3246e2a3c9
parent2704f4833550a3570e62337eaed79eb9bee3ecbc
accel/ivpu: Fix deadlock in context_xa

commit fd7726e75968b27fe98534ccbf47ccd6fef686f3 upstream.

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: 35b137630f08 ("accel/ivpu: Introduce a new DRM driver for Intel VPU")
Cc: <stable@vger.kernel.org> # v6.3+
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104929.941186-9-jacek.lawrynowicz@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accel/ivpu/ivpu_drv.c