summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/common/hw_queue.c
diff options
context:
space:
mode:
authorOfir Bitton <obitton@habana.ai>2020-10-05 14:40:10 +0300
committerOded Gabbay <ogabbay@kernel.org>2020-11-30 10:47:33 +0200
commit66a76401c50b2638fd95dd31f365fd64be307d6a (patch)
treeb68c7e871b87d7770a1e0caae13aa6c80f44ad9a /drivers/misc/habanalabs/common/hw_queue.c
parentf2d032ee1381ae1eda8846800a304d76d2d8b735 (diff)
downloadlinux-66a76401c50b2638fd95dd31f365fd64be307d6a.tar.bz2
habanalabs: add 'needs reset' state in driver
The new state indicates that device should be reset in order to re-gain funcionality. This unique state can occur if reset_on_lockup is disabled and an actual lockup has occurred. Signed-off-by: Ofir Bitton <obitton@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/hw_queue.c')
-rw-r--r--drivers/misc/habanalabs/common/hw_queue.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/habanalabs/common/hw_queue.c b/drivers/misc/habanalabs/common/hw_queue.c
index e808e668a007..f9550fcf5500 100644
--- a/drivers/misc/habanalabs/common/hw_queue.c
+++ b/drivers/misc/habanalabs/common/hw_queue.c
@@ -515,6 +515,7 @@ static void init_signal_wait_cs(struct hl_cs *cs)
*/
int hl_hw_queue_schedule_cs(struct hl_cs *cs)
{
+ enum hl_device_status status;
struct hl_cs_counters_atomic *cntr;
struct hl_ctx *ctx = cs->ctx;
struct hl_device *hdev = ctx->hdev;
@@ -527,11 +528,10 @@ int hl_hw_queue_schedule_cs(struct hl_cs *cs)
hdev->asic_funcs->hw_queues_lock(hdev);
- if (hl_device_disabled_or_in_reset(hdev)) {
+ if (!hl_device_operational(hdev, &status)) {
atomic64_inc(&ctx->cs_counters.device_in_reset_drop_cnt);
- atomic64_inc(&cntr->device_in_reset_drop_cnt);
dev_err(hdev->dev,
- "device is disabled or in reset, CS rejected!\n");
+ "device is %s, CS rejected!\n", hdev->status[status]);
rc = -EPERM;
goto out;
}