summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2021-11-13 17:58:43 +0200
committerOded Gabbay <ogabbay@kernel.org>2021-12-26 08:59:06 +0200
commitfe8d70873c4919086d5929c49e1c6cd6bb7d1de3 (patch)
tree114e79e70ba6c1837930a04d9126f9f79caee3c2 /drivers/misc/habanalabs
parent3e55b5dbf929a40966b8eb7d4de94fad3bb404bd (diff)
downloadlinux-stable-fe8d70873c4919086d5929c49e1c6cd6bb7d1de3.tar.gz
linux-stable-fe8d70873c4919086d5929c49e1c6cd6bb7d1de3.tar.bz2
linux-stable-fe8d70873c4919086d5929c49e1c6cd6bb7d1de3.zip
habanalabs: prevent false heartbeat message
If a device reset has started, there is a chance that the heartbeat function will fail because the device is disabled at the beginning of the reset function. In that case, we don't want the error message to appear in the log. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs')
-rw-r--r--drivers/misc/habanalabs/common/device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 0da5a55490ff..ca74d7815a67 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -543,7 +543,9 @@ static void hl_device_heartbeat(struct work_struct *work)
if (!hdev->asic_funcs->send_heartbeat(hdev))
goto reschedule;
- dev_err(hdev->dev, "Device heartbeat failed!\n");
+ if (hl_device_operational(hdev, NULL))
+ dev_err(hdev->dev, "Device heartbeat failed!\n");
+
hl_device_reset(hdev, HL_DRV_RESET_HARD | HL_DRV_RESET_HEARTBEAT);
return;