Skip to content

Commit fac91dd

Browse files
ofirbittogabbay
authored andcommitted
accel/habanalabs: add event queue extra validation
In order to increase reliability of the event queue interface, we apply to Gaudi2 the same mechanism we have in Gaudi1. The extra validation is basically checking that the received event index matches the expected index. Signed-off-by: Ofir Bitton <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]>
1 parent 19aa21b commit fac91dd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/accel/habanalabs/common/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ irqreturn_t hl_irq_handler_eq(int irq, void *arg)
430430
cur_eqe_index = FIELD_GET(EQ_CTL_INDEX_MASK, cur_eqe);
431431
if ((hdev->event_queue.check_eqe_index) &&
432432
(((eq->prev_eqe_index + 1) & EQ_CTL_INDEX_MASK) != cur_eqe_index)) {
433-
dev_dbg(hdev->dev,
433+
dev_err(hdev->dev,
434434
"EQE %#x in queue is ready but index does not match %d!=%d",
435435
cur_eqe,
436436
((eq->prev_eqe_index + 1) & EQ_CTL_INDEX_MASK),

drivers/accel/habanalabs/gaudi2/gaudi2.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,6 +3619,12 @@ static int gaudi2_sw_init(struct hl_device *hdev)
36193619

36203620
prop->supports_compute_reset = true;
36213621

3622+
/* Event queue sanity check added in FW version 1.11 */
3623+
if (hl_is_fw_sw_ver_below(hdev, 1, 11))
3624+
hdev->event_queue.check_eqe_index = false;
3625+
else
3626+
hdev->event_queue.check_eqe_index = true;
3627+
36223628
hdev->asic_funcs->set_pci_memory_regions(hdev);
36233629

36243630
rc = gaudi2_special_blocks_iterator_config(hdev);

0 commit comments

Comments
 (0)