diff options
author | Tomer Tayar <ttayar@habana.ai> | 2022-09-30 16:43:47 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-11-23 17:13:43 +0300 |
commit | 5b8873b39c5d4ee93e382389b199d553b38b19f3 (patch) | |
tree | d72e88d225aa914b26cdf4d87232ee5fc316381f /drivers/misc | |
parent | 11669b58fa1cee8442ae31ad4ba71398729727b5 (diff) | |
download | linux-5b8873b39c5d4ee93e382389b199d553b38b19f3.tar.xz |
habanalabs/gaudi: use graceful hard reset for F/W events
Use graceful hard reset for F/W events on Gaudi device that require a
device reset.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/habanalabs/gaudi/gaudi.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index 337123f73501..3dfb9ecf7db3 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -7942,16 +7942,14 @@ reset_device: reset_required = false; } - /* despite reset doesn't execute. a notification on - * occurred event needs to be sent here - */ - if (event_mask) - hl_notifier_event_send_all(hdev, event_mask); - - if (reset_required) - hl_device_reset(hdev, flags); - else + if (reset_required) { + hl_device_cond_reset(hdev, flags, event_mask); + } else { hl_fw_unmask_irq(hdev, event_type); + /* Notification on occurred event needs to be sent although reset is not executed */ + if (event_mask) + hl_notifier_event_send_all(hdev, event_mask); + } } static void *gaudi_get_events_stat(struct hl_device *hdev, bool aggregate, u32 *size) |