aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2022-07-19 09:01:53 +0300
committerOded Gabbay <ogabbay@kernel.org>2022-09-18 13:29:51 +0300
commitf0d4944c20819edf4de2c5c17963491d23e213da (patch)
tree325b17c09ba6f906bc8d634fd3495b3c2cfd94b3 /drivers/misc/habanalabs
parenthabanalabs: fix vma fields assignments order in hl_hw_block_mmap() (diff)
downloadlinux-dev-f0d4944c20819edf4de2c5c17963491d23e213da.tar.xz
linux-dev-f0d4944c20819edf4de2c5c17963491d23e213da.zip
habanalabs: add a missing lock for in_reset indication
Add a missing lock in hl_device_resume() when it assigns a value to the 'in_reset' indication. 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/misc/habanalabs')
-rw-r--r--drivers/misc/habanalabs/common/device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 90e346727a7c..6a98aae90f49 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -1091,7 +1091,9 @@ int hl_device_resume(struct hl_device *hdev)
/* 'in_reset' was set to true during suspend, now we must clear it in order
* for hard reset to be performed
*/
+ spin_lock(&hdev->reset_info.lock);
hdev->reset_info.in_reset = 0;
+ spin_unlock(&hdev->reset_info.lock);
rc = hl_device_reset(hdev, HL_DRV_RESET_HARD);
if (rc) {