habanalabs: wait for interrupt wrong timeout calculation
authorOfir Bitton <obitton@habana.ai>
Tue, 27 Apr 2021 14:49:25 +0000 (17:49 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sat, 8 May 2021 08:21:57 +0000 (11:21 +0300)
Wait for interrupt timeout calculation is wrong, hence timeout occurs
when user waits on an interrupt with certain timeout values.

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 ff8791a..af3c497 100644 (file)
@@ -2017,7 +2017,7 @@ wait_again:
                if (completion_value >= target_value) {
                        *status = CS_WAIT_STATUS_COMPLETED;
                } else {
-                       timeout -= jiffies_to_usecs(completion_rc);
+                       timeout = completion_rc;
                        goto wait_again;
                }
        } else {