mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-18 05:59:04 +07:00
habanalabs: never fail hard reset of device
Hard-reset of our device should never fail, due to dangers of permanent damage to the H/W. This patch removes the last place in the reset path where the driver might exit before doing the actual reset. Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
This commit is contained in:
parent
d9973871da
commit
0878a42086
@ -663,17 +663,9 @@ int hl_device_reset(struct hl_device *hdev, bool hard_reset,
|
|||||||
/* Go over all the queues, release all CS and their jobs */
|
/* Go over all the queues, release all CS and their jobs */
|
||||||
hl_cs_rollback_all(hdev);
|
hl_cs_rollback_all(hdev);
|
||||||
|
|
||||||
if (hard_reset) {
|
/* Release kernel context */
|
||||||
/* Release kernel context */
|
if ((hard_reset) && (hl_ctx_put(hdev->kernel_ctx) == 1))
|
||||||
if (hl_ctx_put(hdev->kernel_ctx) != 1) {
|
|
||||||
dev_err(hdev->dev,
|
|
||||||
"kernel ctx is alive during hard reset\n");
|
|
||||||
rc = -EBUSY;
|
|
||||||
goto out_err;
|
|
||||||
}
|
|
||||||
|
|
||||||
hdev->kernel_ctx = NULL;
|
hdev->kernel_ctx = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
/* Reset the H/W. It will be in idle state after this returns */
|
/* Reset the H/W. It will be in idle state after this returns */
|
||||||
hdev->asic_funcs->hw_fini(hdev, hard_reset);
|
hdev->asic_funcs->hw_fini(hdev, hard_reset);
|
||||||
@ -699,6 +691,13 @@ int hl_device_reset(struct hl_device *hdev, bool hard_reset,
|
|||||||
if (hard_reset) {
|
if (hard_reset) {
|
||||||
hdev->device_cpu_disabled = false;
|
hdev->device_cpu_disabled = false;
|
||||||
|
|
||||||
|
if (hdev->kernel_ctx) {
|
||||||
|
dev_crit(hdev->dev,
|
||||||
|
"kernel ctx was alive during hard reset, something is terribly wrong\n");
|
||||||
|
rc = -EBUSY;
|
||||||
|
goto out_err;
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocate the kernel context */
|
/* Allocate the kernel context */
|
||||||
hdev->kernel_ctx = kzalloc(sizeof(*hdev->kernel_ctx),
|
hdev->kernel_ctx = kzalloc(sizeof(*hdev->kernel_ctx),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
Loading…
Reference in New Issue
Block a user