habanalabs: fix kernel OOPs related to staged cs
authorfarah kassabri <fkassabri@habana.ai>
Wed, 1 Sep 2021 12:48:04 +0000 (15:48 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 14 Sep 2021 12:00:03 +0000 (15:00 +0300)
commitbeb71ee36e4de93c2b21d916fb94558333d99974
tree675162c58b0b9ab8355cba4e91532e662ac8d039
parentd53c66594dc7606b191bb2976901a691d291a316
habanalabs: fix kernel OOPs related to staged cs

In case of single staged cs with both first/last indications
set, we reach a scenario where in cs_release function flow
we don't cancel the TDR work before freeing the cs memory,
this lead to kernel OOPs since when the timer expires
the work pointer will be freed already.
In addition treat wait encaps cs "not found" handle
as "OK" for the user in order to keep the user interface
for both legacy and encpas signal/wait features the same.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_submission.c