habanalabs: verify no zero event is sent

The event notifier mechanism should not raise an empty
event (event equals zero).

Signed-off-by: Tal Cohen <talcohen@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
This commit is contained in:
Tal Cohen 2022-10-03 13:55:50 +03:00 committed by Oded Gabbay
parent 4f11694f27
commit 27cd39afde
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -7945,7 +7945,9 @@ reset_device:
/* 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