mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 01/10] accel/habanalabs/gaudi2: assume hard-reset by FW upon PCIe AXI drain
@ 2023-11-15 16:39 Oded Gabbay
  2023-11-15 16:39 ` [PATCH 02/10] accel/habanalabs: add log when eq event is not received Oded Gabbay
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Oded Gabbay @ 2023-11-15 16:39 UTC (permalink / raw)
  To: dri-devel, linux-kernel; +Cc: Tomer Tayar

From: Tomer Tayar <ttayar@habana.ai>

When a PCIe AXI drain event happens, it is possible that the driver
cannot access the device through PCIe, and therefore cannot send a
hard-reset request to FW.
Starting from FW version 1.13, FW will initiate a hard-reset in such
a case without waiting for a reset request from the driver.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/accel/habanalabs/common/habanalabs.h | 8 ++++++++
 drivers/accel/habanalabs/gaudi2/gaudi2.c     | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/drivers/accel/habanalabs/common/habanalabs.h b/drivers/accel/habanalabs/common/habanalabs.h
index 1655c101c705..5c69a482b8de 100644
--- a/drivers/accel/habanalabs/common/habanalabs.h
+++ b/drivers/accel/habanalabs/common/habanalabs.h
@@ -3594,6 +3594,14 @@ static inline bool hl_is_fw_sw_ver_below(struct hl_device *hdev, u32 fw_sw_major
 	return false;
 }
 
+static inline bool hl_is_fw_sw_ver_equal_or_greater(struct hl_device *hdev, u32 fw_sw_major,
+							u32 fw_sw_minor)
+{
+	return (hdev->fw_sw_major_ver > fw_sw_major ||
+			(hdev->fw_sw_major_ver == fw_sw_major &&
+					hdev->fw_sw_minor_ver >= fw_sw_minor));
+}
+
 /*
  * Kernel module functions that can be accessed by entire module
  */
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index 819660c684cf..b739078c2d87 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -10007,6 +10007,8 @@ static void gaudi2_handle_eqe(struct hl_device *hdev, struct hl_eq_entry *eq_ent
 		error_count = gaudi2_handle_pcie_drain(hdev, &eq_entry->pcie_drain_ind_data);
 		reset_flags |= HL_DRV_RESET_FW_FATAL_ERR;
 		event_mask |= HL_NOTIFIER_EVENT_GENERAL_HW_ERR;
+		if (hl_is_fw_sw_ver_equal_or_greater(hdev, 1, 13))
+			is_critical = true;
 		break;
 
 	case GAUDI2_EVENT_PSOC59_RPM_ERROR_OR_DRAIN:
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-11-15 16:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 16:39 [PATCH 01/10] accel/habanalabs/gaudi2: assume hard-reset by FW upon PCIe AXI drain Oded Gabbay
2023-11-15 16:39 ` [PATCH 02/10] accel/habanalabs: add log when eq event is not received Oded Gabbay
2023-11-15 16:39 ` [PATCH 03/10] accel/habanalabs: add support for Gaudi2C device Oded Gabbay
2023-11-15 16:39 ` [PATCH 04/10] accel/habanalabs: fix EQ heartbeat mechanism Oded Gabbay
2023-11-15 16:39 ` [PATCH 05/10] accel/habanalabs/gaudi2: fix undef opcode reporting Oded Gabbay
2023-11-15 16:39 ` [PATCH 06/10] accel/habanalabs: remove 'get temperature' debug print Oded Gabbay
2023-11-15 16:39 ` [PATCH 07/10] accel/habanalabs: set hard reset flag if graceful reset is skipped Oded Gabbay
2023-11-15 16:39 ` [PATCH 08/10] accel/habanalabs/gaudi2: get the correct QM CQ info upon an error Oded Gabbay
2023-11-15 16:39 ` [PATCH 09/10] accel/habanalabs: print error code when mapping fails Oded Gabbay
2023-11-15 16:39 ` [PATCH 10/10] accel/habanalabs: expose module id through sysfs Oded Gabbay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®