habanalabs/gaudi: sync stream add protection to SOB reset flow
authorfarah kassabri <fkassabri@habana.ai>
Tue, 30 Mar 2021 13:38:02 +0000 (16:38 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 9 Apr 2021 11:09:24 +0000 (14:09 +0300)
commite65448faf4cfeddd95a0e661aabf2fae1efc9831
tree1325e0095a976d711b446db5455dde395cee6902
parentcf39395034c6b927d49abe554fb4e93730d00543
habanalabs/gaudi: sync stream add protection to SOB reset flow

Since we moved the SOB reset flow to workqueue and
not part of the fence release flow, we might reach a
scenario where new context is created while we in the middle
of resetting the SOB.
in such cases the reset may fail due to idle check.
This will mess up the streams sync since the SOB value is invalid.
so we protect this area with a mutex, to delay context creation.

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/gaudi/gaudi.c