Skip to content

Commit 4b0b1fb

Browse files
Tomer Tayarogabbay
authored andcommitted
accel/habanalabs: set hard reset flag if graceful reset is skipped
hl_device_cond_reset() might be called with the hard reset flag unset, because a compute reset upon device release as part of a graceful reset is valid. If the conditions for graceful reset are not met, hl_device_reset() will be called for an immediate reset. In this case a compute reset is not valid, so it will be replaced with a hard reset together with a debug message about it. This message might be confusing, as it implies that a compute reset was requested when it shouldn't. To prevent this confusion, set the hard reset flag in hl_device_cond_reset() if going to an immediate reset. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
1 parent 571cdb6 commit 4b0b1fb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/accel/habanalabs/common/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ int hl_device_cond_reset(struct hl_device *hdev, u32 flags, u64 event_mask)
20402040
if (ctx)
20412041
hl_ctx_put(ctx);
20422042

2043-
return hl_device_reset(hdev, flags);
2043+
return hl_device_reset(hdev, flags | HL_DRV_RESET_HARD);
20442044
}
20452045

20462046
static void hl_notifier_event_send(struct hl_notifier_event *notifier_event, u64 event_mask)

0 commit comments

Comments
 (0)