summaryrefslogtreecommitdiffstats
path: root/drivers/accel/habanalabs/goya/goya.c
diff options
context:
space:
mode:
authorDafna Hirschfeld <dhirschfeld@habana.ai>2023-02-15 11:15:57 +0100
committerOded Gabbay <ogabbay@kernel.org>2023-03-15 12:29:14 +0100
commit86b74d843897fdb9f2366bc515e9d52816e3d247 (patch)
tree80d6aaa65fc82efa33fd40f80f6eb14f99141b0d /drivers/accel/habanalabs/goya/goya.c
parentaccel/habanalabs: break is_idle function into per-engine sub-routines (diff)
downloadlinux-86b74d843897fdb9f2366bc515e9d52816e3d247.tar.xz
linux-86b74d843897fdb9f2366bc515e9d52816e3d247.zip
accel/habanalabs: assert return value of hw_fini
Since hw_fini return error code for failure indication, we should check its return value. Currently it might only fail upon soft-reset from hl_device_reset. Later patch will add hw_fini failure in case of polling timeout in hard-reset. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/accel/habanalabs/goya/goya.c')
-rw-r--r--drivers/accel/habanalabs/goya/goya.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/accel/habanalabs/goya/goya.c b/drivers/accel/habanalabs/goya/goya.c
index c869cfe44ce7..e02de936b7b5 100644
--- a/drivers/accel/habanalabs/goya/goya.c
+++ b/drivers/accel/habanalabs/goya/goya.c
@@ -669,13 +669,18 @@ pci_init:
rc = hl_fw_read_preboot_status(hdev);
if (rc) {
if (hdev->reset_on_preboot_fail)
+ /* we are already on failure flow, so don't check if hw_fini fails. */
hdev->asic_funcs->hw_fini(hdev, true, false);
goto pci_fini;
}
if (goya_get_hw_state(hdev) == HL_DEVICE_HW_STATE_DIRTY) {
dev_dbg(hdev->dev, "H/W state is dirty, must reset before initializing\n");
- hdev->asic_funcs->hw_fini(hdev, true, false);
+ rc = hdev->asic_funcs->hw_fini(hdev, true, false);
+ if (rc) {
+ dev_err(hdev->dev, "failed to reset HW in dirty state (%d)\n", rc);
+ goto pci_fini;
+ }
}
if (!hdev->pldm) {