linux/drivers/accel
Tomer Tayar 09524eb882 accel/habanalabs: enforce release order of compute device and dma-buf
When user closes the compute device file descriptor without closing a
dma-buf file descriptor, the device will be considered as in use,
leading to hard reset and killing the user process, to ensure the
release of the dma-buf.
Same thing will happen if user first releases the compute device file
and only then the dma-buf.

The implication of this is the duration of hard reset, during which the
device cannot be reacquired.
Moreover, this behavior adds a constraint on a user process to follow
this order of release operations.

To avoid killing the user process and to remove this constraint, enforce
the correct order of release operations inside the driver, by
incrementing the device file refcount for any dma-buf until it is
released.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
2023-03-15 13:29:12 +02:00
..
habanalabs accel/habanalabs: enforce release order of compute device and dma-buf 2023-03-15 13:29:12 +02:00
ivpu Merge tag 'drm-misc-next-2023-03-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-next 2023-03-14 12:18:54 +10:00
drm_accel.c Fix mismerge due to devnode now taking a 'const *' device 2022-12-16 13:04:15 -06:00
Kconfig accel: fix CONFIG_DRM dependencies 2023-02-01 11:18:46 +01:00
Makefile habanalabs: move driver to accel subsystem 2023-01-26 11:52:10 +02:00