aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/misc/habanalabs
diff options
context:
space:
mode:
authorDani Liberman <dliberman@habana.ai>2022-01-11 11:10:20 +0200
committerOded Gabbay <ogabbay@kernel.org>2022-02-28 14:22:03 +0200
commit15f8eb190573aa7e38c1024fb6d20abf626298df (patch)
tree8a1b1eff24b8b3ebb3fbf65737b36618b7b6de1d /drivers/misc/habanalabs
parenthabanalabs: add missing error check in sysfs clk_freq_mhz_show (diff)
downloadwireguard-linux-15f8eb190573aa7e38c1024fb6d20abf626298df.tar.xz
wireguard-linux-15f8eb190573aa7e38c1024fb6d20abf626298df.zip
habanalabs: fix soft reset flow in case of failure
In case of soft reset failure, hard reset should be initiated, but reset flags were not set to enable it, which caused another soft reset followed by another failure. Updated reset flags to enable hard reset flow in case of soft reset failure. Signed-off-by: Dani Liberman <dliberman@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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index c98a0a81e7d5..727315b36b8b 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -1293,11 +1293,14 @@ out_err:
hdev->reset_info.hard_reset_cnt++;
} else if (reset_upon_device_release) {
dev_err(hdev->dev, "Failed to reset device after user release\n");
+ flags |= HL_DRV_RESET_HARD;
+ flags &= ~HL_DRV_RESET_DEV_RELEASE;
hard_reset = true;
goto again;
} else {
dev_err(hdev->dev, "Failed to do soft-reset\n");
hdev->reset_info.soft_reset_cnt++;
+ flags |= HL_DRV_RESET_HARD;
hard_reset = true;
goto again;
}