diff options
author | Oded Gabbay <[email protected]> | 2023-06-12 14:24:05 +0300 |
---|---|---|
committer | Oded Gabbay <[email protected]> | 2023-10-09 12:37:19 +0300 |
commit | 37d72439a4b17dda2adc2de98bcb98932fd6ceb2 (patch) | |
tree | 671dc2af5e3d55e40015f464305bb9f3140c9334 | |
parent | 89803af5355b04f4e2583d5c7170aa3676f9c1b7 (diff) |
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: Oded Gabbay <[email protected]>
Reviewed-by: Ofir Bitton <[email protected]>
-rw-r--r-- | drivers/accel/habanalabs/common/device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 5e61761b8c11..d7d9198b2103 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -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 */ 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); + 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 |