diff options
author | 2021-09-23 17:40:14 +0300 | |
---|---|---|
committer | 2021-10-18 12:05:46 +0300 | |
commit | f05d17b226dbb5e2f21b724918b263cba57f2ad8 (patch) | |
tree | f23d5d28eacbca40f8f06d4dfcd25ab99bee036a /drivers/misc/habanalabs/common/irq.c | |
parent | habanalabs: prevent race between fd close/open (diff) | |
download | linux-dev-f05d17b226dbb5e2f21b724918b263cba57f2ad8.tar.xz linux-dev-f05d17b226dbb5e2f21b724918b263cba57f2ad8.zip |
habanalabs: take timestamp on wait for interrupt
Taking an accurate timestamp in a close proximity of the interrupt is
required for user side statistics management.
Signed-off-by: Yuri Nudelman <ynudelman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/misc/habanalabs/common/irq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/irq.c b/drivers/misc/habanalabs/common/irq.c index 39b14a933393..0dd00ffd1809 100644 --- a/drivers/misc/habanalabs/common/irq.c +++ b/drivers/misc/habanalabs/common/irq.c @@ -143,8 +143,11 @@ static void handle_user_cq(struct hl_device *hdev, struct hl_user_pending_interrupt *pend; spin_lock(&user_cq->wait_list_lock); - list_for_each_entry(pend, &user_cq->wait_list_head, wait_list_node) + list_for_each_entry(pend, &user_cq->wait_list_head, wait_list_node) { + if (pend->fence.take_timestamp) + pend->fence.timestamp = ktime_get(); complete_all(&pend->fence.completion); + } spin_unlock(&user_cq->wait_list_lock); } |