habanalabs: release signal if collective wait was dropped
authorOfir Bitton <obitton@habana.ai>
Sun, 25 Oct 2020 07:36:08 +0000 (09:36 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 30 Nov 2020 08:47:32 +0000 (10:47 +0200)
As in standard wait cs, we must release a signal fence once
a collective wait cs was dropped and not submitted.

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

index 56dc18f..536e095 100644 (file)
@@ -300,9 +300,11 @@ static void cs_do_release(struct kref *ref)
 
        if (!cs->submitted) {
                /* In case the wait for signal CS was submitted, the put occurs
-                * in init_signal_wait_cs() right before hanging on the PQ.
+                * in init_signal_wait_cs() or collective_wait_init_cs()
+                * right before hanging on the PQ.
                 */
-               if (cs->type == CS_TYPE_WAIT)
+               if (cs->type == CS_TYPE_WAIT ||
+                               cs->type == CS_TYPE_COLLECTIVE_WAIT)
                        hl_fence_put(cs->signal_fence);
 
                goto out;