summaryrefslogtreecommitdiff
path: root/drivers/accel
diff options
context:
space:
mode:
authorDafna Hirschfeld <dhirschfeld@habana.ai>2023-10-31 13:51:10 +0200
committerOded Gabbay <ogabbay@kernel.org>2023-12-19 11:09:43 +0200
commit0ec346779644039c4c05cfa7f071b1a24e54d8d9 (patch)
tree803feb4e01906a2bd0b3daec671cd72fe2d4a879 /drivers/accel
parentd1958dce5ab6a3e089c60cf474e8c9b7e96e70ad (diff)
accel/habanalabs/gaudi2: fix undef opcode reporting
currently the undefined opcode event bit in set only for lower cp and only if 'write_enable' is true. It should be set anyway and for all streams in order to report that event to userspace. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/accel')
-rw-r--r--drivers/accel/habanalabs/gaudi2/gaudi2.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index b739078c2d87..5075f92d15cc 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -7929,21 +7929,19 @@ static int gaudi2_handle_qman_err_generic(struct hl_device *hdev, u16 event_type
error_count++;
}
- if (i == QMAN_STREAMS && error_count) {
- /* check for undefined opcode */
- if (glbl_sts_val & PDMA0_QM_GLBL_ERR_STS_CP_UNDEF_CMD_ERR_MASK &&
- hdev->captured_err_info.undef_opcode.write_enable) {
+ /* check for undefined opcode */
+ if (glbl_sts_val & PDMA0_QM_GLBL_ERR_STS_CP_UNDEF_CMD_ERR_MASK) {
+ *event_mask |= HL_NOTIFIER_EVENT_UNDEFINED_OPCODE;
+ if (hdev->captured_err_info.undef_opcode.write_enable) {
memset(&hdev->captured_err_info.undef_opcode, 0,
sizeof(hdev->captured_err_info.undef_opcode));
-
- hdev->captured_err_info.undef_opcode.write_enable = false;
hdev->captured_err_info.undef_opcode.timestamp = ktime_get();
hdev->captured_err_info.undef_opcode.engine_id =
gaudi2_queue_id_to_engine_id[qid_base];
- *event_mask |= HL_NOTIFIER_EVENT_UNDEFINED_OPCODE;
}
- handle_lower_qman_data_on_err(hdev, qman_base, *event_mask);
+ if (i == QMAN_STREAMS)
+ handle_lower_qman_data_on_err(hdev, qman_base, *event_mask);
}
}