habanalabs: fix wait offset handling
authorfarah kassabri <fkassabri@habana.ai>
Sun, 12 Sep 2021 11:30:35 +0000 (14:30 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 14 Sep 2021 12:00:04 +0000 (15:00 +0300)
commit42254c2a4991b98ca3f86040a1a7b7b32a0c8c4a
tree1daffe4f49956c2dc62249d98fc95f1bf59f7461
parent3d3200ae167ba048a29e0c815987a3fdc90fc8d2
habanalabs: fix wait offset handling

Add handling for case where the user doesn't set wait offset,
and keeps it as 0. In such a case the driver will decrement one
from this zero value which will cause the code to wait for
wrong number of signals.

The solution is to treat this case as in legacy wait cs,
and wait for the next signal.

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