diff options
author | Dafna Hirschfeld <dhirschfeld@habana.ai> | 2023-02-20 09:09:25 +0100 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2023-03-20 16:35:29 +0100 |
commit | 077a39fabefaef12c802b7b32facb831dd33ea92 (patch) | |
tree | 6e3bd41404e8f13106da5024c15b7e943fa2f61e /drivers/accel/habanalabs/goya | |
parent | accel/habanalabs: increase reset poll timeout (diff) | |
download | linux-077a39fabefaef12c802b7b32facb831dd33ea92.tar.xz linux-077a39fabefaef12c802b7b32facb831dd33ea92.zip |
accel/habanalabs: in hw_fini return error code if polling timed-out
In hw_fini callback, we use either the cpucp packet method or polling a
register. Currently we return error only in the case of cpucp packet
failure. In this patch we also return error if polling timed out.
Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/accel/habanalabs/goya')
-rw-r--r-- | drivers/accel/habanalabs/goya/goya.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/accel/habanalabs/goya/goya.c b/drivers/accel/habanalabs/goya/goya.c index e02de936b7b5..07d67878eac5 100644 --- a/drivers/accel/habanalabs/goya/goya.c +++ b/drivers/accel/habanalabs/goya/goya.c @@ -2834,10 +2834,10 @@ static int goya_hw_fini(struct hl_device *hdev, bool hard_reset, bool fw_reset) msleep(reset_timeout_ms); status = RREG32(mmPSOC_GLOBAL_CONF_BTM_FSM); - if (status & PSOC_GLOBAL_CONF_BTM_FSM_STATE_MASK) - dev_err(hdev->dev, - "Timeout while waiting for device to reset 0x%x\n", - status); + if (status & PSOC_GLOBAL_CONF_BTM_FSM_STATE_MASK) { + dev_err(hdev->dev, "Timeout while waiting for device to reset 0x%x\n", status); + return -ETIMEDOUT; + } if (!hard_reset && goya) { goya->hw_cap_initialized &= ~(HW_CAP_DMA | HW_CAP_MME | |