summaryrefslogtreecommitdiffstats
path: root/drivers/accel
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2023-05-10 18:18:05 +0300
committerOded Gabbay <ogabbay@kernel.org>2023-10-09 12:37:17 +0300
commita35c99760146137bbcfafe82ed5dc9c7a00b640a (patch)
treebe25d26f4e75abbaa249de2e2bd428b3a6b9d2f3 /drivers/accel
parent5d89ce6f8c2775b926b63c14529c5970429ea935 (diff)
downloadlinux-a35c99760146137bbcfafe82ed5dc9c7a00b640a.tar.gz
linux-a35c99760146137bbcfafe82ed5dc9c7a00b640a.tar.bz2
linux-a35c99760146137bbcfafe82ed5dc9c7a00b640a.zip
accel/habanalabs: update pending reset flags with new reset requests
If hl_device_cond_reset() is called while a reset is already pending but hasn't started, the reset request will be dropped. If the flags of the new request are more severe, e.g. a hard reset while the pending reset is a compute reset, the eventual reset won't be suitable for the device status. To prevent such cases, update the pending reset flags with the new requests flags before the requests are dropped. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/accel')
-rw-r--r--drivers/accel/habanalabs/common/device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c
index 1e61e79c42e5..993305871292 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -1937,8 +1937,10 @@ int hl_device_cond_reset(struct hl_device *hdev, u32 flags, u64 event_mask)
goto device_reset;
}
- if (hdev->reset_info.watchdog_active)
+ if (hdev->reset_info.watchdog_active) {
+ hdev->device_release_watchdog_work.flags |= flags;
goto out;
+ }
hdev->device_release_watchdog_work.flags = flags;
dev_dbg(hdev->dev, "Device is going to be hard-reset in %u sec unless being released\n",