Commit 37d72439 authored by Oded Gabbay's avatar Oded Gabbay

accel/habanalabs: reset device if scrubbing failed

If scrubbing memory after user released device has failed it means
the device is in a bad state and should be reset.
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
Reviewed-by: default avatarOfir Bitton <obitton@habana.ai>
parent 89803af5
...@@ -454,8 +454,10 @@ static void hpriv_release(struct kref *ref) ...@@ -454,8 +454,10 @@ static void hpriv_release(struct kref *ref)
/* Scrubbing is handled within hl_device_reset(), so here need to do it directly */ /* Scrubbing is handled within hl_device_reset(), so here need to do it directly */
int rc = hdev->asic_funcs->scrub_device_mem(hdev); int rc = hdev->asic_funcs->scrub_device_mem(hdev);
if (rc) if (rc) {
dev_err(hdev->dev, "failed to scrub memory from hpriv release (%d)\n", rc); dev_err(hdev->dev, "failed to scrub memory from hpriv release (%d)\n", rc);
hl_device_reset(hdev, HL_DRV_RESET_HARD);
}
} }
/* Now we can mark the compute_ctx as not active. Even if a reset is running in a different /* Now we can mark the compute_ctx as not active. Even if a reset is running in a different
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment