[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220620130432.1180451-4-ogabbay@kernel.org>
Date: Mon, 20 Jun 2022 16:04:19 +0300
From: Oded Gabbay <ogabbay@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Tal Cohen <talcohen@...ana.ai>
Subject: [PATCH 04/17] habanalabs/gaudi: send device reset notification
From: Tal Cohen <talcohen@...ana.ai>
Device reset event, indicates that the device shall be reset -
after a short delay. In such case, the driver sends a notification
towards the User process. This allows the User process
to be able to take several debug actions for system
diagnostic purposes.
Signed-off-by: Tal Cohen <talcohen@...ana.ai>
Reviewed-by: Oded Gabbay <ogabbay@...nel.org>
Signed-off-by: Oded Gabbay <ogabbay@...nel.org>
---
drivers/misc/habanalabs/gaudi/gaudi.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 8f37297b2c3b..b7460c30aa51 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -8054,13 +8054,20 @@ static void gaudi_handle_eqe(struct hl_device *hdev,
reset_device:
reset_required = true;
- if (hdev->asic_prop.fw_security_enabled && !reset_direct)
+ if (hdev->asic_prop.fw_security_enabled && !reset_direct) {
flags = HL_DRV_RESET_HARD | HL_DRV_RESET_BYPASS_REQ_TO_FW | fw_fatal_err_flag;
- else if (hdev->hard_reset_on_fw_events)
+ event_mask |= HL_NOTIFIER_EVENT_DEVICE_RESET;
+ } else if (hdev->hard_reset_on_fw_events) {
flags = HL_DRV_RESET_HARD | HL_DRV_RESET_DELAY | fw_fatal_err_flag;
- else
+ event_mask |= HL_NOTIFIER_EVENT_DEVICE_RESET;
+ } else {
reset_required = false;
+ }
+ /* despite reset doesn't execute. a notification on
+ * occurred event needs to be sent here
+ */
+ hl_notifier_event_send_all(hdev, event_mask);
if (reset_required)
hl_device_reset(hdev, flags);
else
--
2.25.1
Powered by blists - more mailing lists