[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20221006082308.1266716-13-ogabbay@kernel.org>
Date: Thu, 6 Oct 2022 11:23:08 +0300
From: Oded Gabbay <ogabbay@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Tal Cohen <talcohen@...ana.ai>
Subject: [PATCH 13/13] habanalabs: verify no zero event is sent
From: Tal Cohen <talcohen@...ana.ai>
The event notifier mechanism should not raise an empty
event (event equals zero).
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/common/device.c | 5 +++++
drivers/misc/habanalabs/gaudi/gaudi.c | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index b8b32285720d..9b54d1df5302 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -1746,6 +1746,11 @@ void hl_notifier_event_send_all(struct hl_device *hdev, u64 event_mask)
{
struct hl_fpriv *hpriv;
+ if (!event_mask) {
+ dev_warn(hdev->dev, "Skip sending zero event");
+ return;
+ }
+
mutex_lock(&hdev->fpriv_list_lock);
list_for_each_entry(hpriv, &hdev->fpriv_list, dev_node)
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 1a99f7be8b60..337123f73501 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -7945,7 +7945,9 @@ static void gaudi_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_entr
/* despite reset doesn't execute. a notification on
* occurred event needs to be sent here
*/
- hl_notifier_event_send_all(hdev, event_mask);
+ if (event_mask)
+ 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