habanalabs: release pending user interrupts on device fini
authorOded Gabbay <ogabbay@kernel.org>
Thu, 1 Jul 2021 07:09:28 +0000 (10:09 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 29 Aug 2021 06:47:45 +0000 (09:47 +0300)
commitb07e6c7ef5c7a094c20fa9962f9af2b42546ee94
tree65861aac115be38bf5f010d75de1ce4ceeb4fc36
parentd5546d78ad409b90dbcb62100458875e8eaf6a0d
habanalabs: release pending user interrupts on device fini

In device fini there was missing a call to release all pending user
interrupts. That can cause a process to be stuck inside the driver's
IOCTL of wait for interrupts, in case the device is removed or
simulator is killed at the same time.

In addition, also call to remove inactive codec job was missing.

Moreover, to prevent such errors in the future (where code is added
to reset path but not to device fini), we moved some common parts
to two dedicated functions:
cleanup_resources
take_release_locks

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c