summaryrefslogtreecommitdiff
path: root/drivers/accel
diff options
context:
space:
mode:
authorTal Cohen <talcohen@habana.ai>2023-03-22 11:20:05 +0200
committerOded Gabbay <ogabbay@kernel.org>2023-04-08 10:39:33 +0300
commit3a8d7c3a7d1bf7d1f2121c1f467d6b349b7bf807 (patch)
treec417fa926d737c2743ad82a1e8123445b3aaad47 /drivers/accel
parenta855f710f5d40537bc2bf5f924827416653db39f (diff)
downloadlwn-3a8d7c3a7d1bf7d1f2121c1f467d6b349b7bf807.tar.gz
lwn-3a8d7c3a7d1bf7d1f2121c1f467d6b349b7bf807.zip
accel/habanalabs: send disable pci when compute ctx is active
Fix an issue in hard reset flow in which the driver didn't send a disable pci message if there was an active compute context. In hard reset, disable pci message should be sent no matter if a compute context exists or not. Signed-off-by: Tal Cohen <talcohen@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
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 c36de13d6729..3c1af9d43b65 100644
--- a/drivers/accel/habanalabs/common/device.c
+++ b/drivers/accel/habanalabs/common/device.c
@@ -1386,7 +1386,7 @@ static void handle_reset_trigger(struct hl_device *hdev, u32 flags)
/* No consecutive mechanism when user context exists */
if (hdev->is_compute_ctx_active)
- return;
+ goto disable_pci;
/*
* 'reset cause' is being updated here, because getting here
@@ -1425,6 +1425,8 @@ static void handle_reset_trigger(struct hl_device *hdev, u32 flags)
* If F/W is performing the reset, no need to send it a message to disable
* PCI access
*/
+
+disable_pci:
if ((flags & HL_DRV_RESET_HARD) &&
!(flags & (HL_DRV_RESET_HEARTBEAT | HL_DRV_RESET_BYPASS_REQ_TO_FW))) {
/* Disable PCI access from device F/W so he won't send