]> www.infradead.org Git - nvme.git/commitdiff
accel/habanalabs: move hl_eq_heartbeat_event_handle() to common code
authorTomer Tayar <ttayar@habana.ai>
Tue, 12 Mar 2024 14:55:08 +0000 (16:55 +0200)
committerOfir Bitton <obitton@habana.ai>
Sun, 23 Jun 2024 06:53:04 +0000 (09:53 +0300)
hl_eq_heartbeat_event_handle() doesn't have ASIC specific code, and
therefore can be moved from Gaudi2-only code to common code, and
possibly used for other ASICs.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Ofir Bitton <obitton@habana.ai>
Signed-off-by: Ofir Bitton <obitton@habana.ai>
drivers/accel/habanalabs/common/device.c
drivers/accel/habanalabs/common/habanalabs.h
drivers/accel/habanalabs/gaudi2/gaudi2.c

index 35502e938b5dafc249013e8e0c49dbc29027489a..f9b8601c4396ba1ced4a3af035730e01d85f6290 100644 (file)
@@ -2850,3 +2850,9 @@ void hl_set_irq_affinity(struct hl_device *hdev, int irq)
        if (irq_set_affinity_and_hint(irq, &hdev->irq_affinity_mask))
                dev_err(hdev->dev, "Failed setting irq %d affinity\n", irq);
 }
+
+void hl_eq_heartbeat_event_handle(struct hl_device *hdev)
+{
+       hdev->heartbeat_debug_info.heartbeat_event_counter++;
+       hdev->eq_heartbeat_received = true;
+}
index 8d0df685e62714be21fb956b18b757274808addc..057087dc8592594ec7e19f952a50f7667043481c 100644 (file)
@@ -4059,6 +4059,7 @@ void hl_capture_engine_err(struct hl_device *hdev, u16 engine_id, u16 error_coun
 void hl_enable_err_info_capture(struct hl_error_info *captured_err_info);
 void hl_init_cpu_for_irq(struct hl_device *hdev);
 void hl_set_irq_affinity(struct hl_device *hdev, int irq);
+void hl_eq_heartbeat_event_handle(struct hl_device *hdev);
 
 #ifdef CONFIG_DEBUG_FS
 
index 4791582d157ce9d515cbf0c161b026afa0b55972..a38b88baadf2bae76519c1937257a7da935cb7ea 100644 (file)
@@ -9777,12 +9777,6 @@ static u16 event_id_to_engine_id(struct hl_device *hdev, u16 event_type)
        return U16_MAX;
 }
 
-static void hl_eq_heartbeat_event_handle(struct hl_device *hdev)
-{
-       hdev->heartbeat_debug_info.heartbeat_event_counter++;
-       hdev->eq_heartbeat_received = true;
-}
-
 static void gaudi2_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entry)
 {
        struct gaudi2_device *gaudi2 = hdev->asic_specific;