Commit bc75d799 authored by Omer Shpigelman's avatar Omer Shpigelman Committed by Oded Gabbay
Browse files

habanalabs: prevent read/write from/to the device during hard reset



During hard reset we should not access the device except of necessary
reset operations because the device might be stuck or unresponsive.

Signed-off-by: default avatarOmer Shpigelman <oshpigelman@habana.ai>
Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 54bb6744
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4870,7 +4870,8 @@ static void goya_mmu_invalidate_cache(struct hl_device *hdev, bool is_hard,
	u32 status, timeout_usec;
	int rc;

	if (!(goya->hw_cap_initialized & HW_CAP_MMU))
	if (!(goya->hw_cap_initialized & HW_CAP_MMU) ||
		hdev->hard_reset_pending)
		return;

	/* no need in L1 only invalidation in Goya */
@@ -4909,7 +4910,8 @@ static void goya_mmu_invalidate_cache_range(struct hl_device *hdev,
	u32 status, timeout_usec, inv_data, pi;
	int rc;

	if (!(goya->hw_cap_initialized & HW_CAP_MMU))
	if (!(goya->hw_cap_initialized & HW_CAP_MMU) ||
		hdev->hard_reset_pending)
		return;

	/* no need in L1 only invalidation in Goya */