habanalabs: add reset support when user closes FD
authorOfir Bitton <obitton@habana.ai>
Wed, 10 Feb 2021 12:29:33 +0000 (14:29 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 9 Apr 2021 11:09:22 +0000 (14:09 +0300)
commit8e9445a678cab4478aa90a5f8898ba093371e30f
treed1943caa084ca23ba68164f90d65c26f1f1b9d79
parentb6821b3c65c80f11f92f1abb27be2ad9683acefc
habanalabs: add reset support when user closes FD

In order to support command submissions that are done directly from
user space, the driver must perform soft reset once user closes its FD.
In case the soft reset fails or device is not idle, a hard reset should
be performed.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/device.c
drivers/misc/habanalabs/common/habanalabs.h