Skip to contentSkip to conversation

habanalabs: wait for interrupt wrong timeout calculation

PATCH New Oded Gabbay 1 participant 1 message May 2, 2021 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 habanalabs: wait for interrupt wrong timeout calculation

From: Ofir Bitton <[email protected]>

Wait for interrupt timeout calculation is wrong, hence timeout occurs when user waits on an interrupt with certain timeout values.

---
 drivers/misc/habanalabs/common/command_submission.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/habanalabs/common/command_submission.c +1 -1
index ff8791a651fd..af3c497defb1 100644
@@ -2017,7 +2017,7 @@ static int _hl_interrupt_wait_ioctl(struct hl_device *hdev, struct hl_ctx *ctx,
 		if (completion_value >= target_value) {
 			*status = CS_WAIT_STATUS_COMPLETED;
 		} else {
-			timeout -= jiffies_to_usecs(completion_rc);
+			timeout = completion_rc;
 			goto wait_again;
 		}
 	} else {
Signature · 1 line
2.25.1