summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTamir Gilad-Raz <tgiladraz@habana.ai>2022-11-06 12:22:16 +0300
committerOded Gabbay <ogabbay@kernel.org>2023-01-26 11:56:21 +0300
commit853413b234b002597df19f092892a1b1f52a2a47 (patch)
treeb036e90110c9c6f42bf98b42c27826015863c1e5 /drivers
parent35d8944480ab892a725ed4edae08a675c600b1de (diff)
downloadlinux-853413b234b002597df19f092892a1b1f52a2a47.tar.xz
habanalabs: adjacent timestamps should be more accurate
timestamp events that expire on the same interrupt will get the same timestamp value Signed-off-by: Tamir Gilad-Raz <tgiladraz@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/habanalabs/common/irq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/habanalabs/common/irq.c b/drivers/misc/habanalabs/common/irq.c
index 94d537fd4fde..8bbcc223df91 100644
--- a/drivers/misc/habanalabs/common/irq.c
+++ b/drivers/misc/habanalabs/common/irq.c
@@ -228,7 +228,7 @@ static void hl_ts_free_objects(struct work_struct *work)
* list to a dedicated workqueue to do the actual put.
*/
static int handle_registration_node(struct hl_device *hdev, struct hl_user_pending_interrupt *pend,
- struct list_head **free_list)
+ struct list_head **free_list, ktime_t now)
{
struct timestamp_reg_free_node *free_node;
u64 timestamp;
@@ -246,7 +246,7 @@ static int handle_registration_node(struct hl_device *hdev, struct hl_user_pendi
if (!free_node)
return -ENOMEM;
- timestamp = ktime_get_ns();
+ timestamp = ktime_to_ns(now);
*pend->ts_reg_info.timestamp_kernel_addr = timestamp;
@@ -298,7 +298,7 @@ static void handle_user_interrupt(struct hl_device *hdev, struct hl_user_interru
if (pend->ts_reg_info.buf) {
if (!reg_node_handle_fail) {
rc = handle_registration_node(hdev, pend,
- &ts_reg_free_list_head);
+ &ts_reg_free_list_head, now);
if (rc)
reg_node_handle_fail = true;
}