diff options
author | Tomer Tayar <ttayar@habana.ai> | 2023-03-27 00:08:45 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2023-04-08 10:39:34 +0300 |
commit | d4801c048543115f9eddbecd6f72a3f68d562bdb (patch) | |
tree | 95bb8a4d3d03229abcd60f01ed14641eb5988ce4 /drivers/accel | |
parent | 9cf56f0d97806eaff68c4c4facd7ef94e2a072bc (diff) | |
download | lwn-d4801c048543115f9eddbecd6f72a3f68d562bdb.tar.gz lwn-d4801c048543115f9eddbecd6f72a3f68d562bdb.zip |
accel/habanalabs: fix events mask of decoder abnormal interrupts
The decoder IRQ status register may have several set bits upon an
abnormal interrupt. Therefore, when setting the events mask, need to
check all bits and not using if-else.
Signed-off-by: Tomer Tayar <ttayar@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/common/decoder.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/accel/habanalabs/common/decoder.c b/drivers/accel/habanalabs/common/decoder.c index 59a1ecb20c04..c03a6da45d00 100644 --- a/drivers/accel/habanalabs/common/decoder.c +++ b/drivers/accel/habanalabs/common/decoder.c @@ -47,8 +47,8 @@ static void dec_abnrm_intr_work(struct work_struct *work) { struct hl_dec *dec = container_of(work, struct hl_dec, abnrm_intr_work); struct hl_device *hdev = dec->hdev; + u32 irq_status, event_mask = 0; bool reset_required = false; - u32 irq_status, event_mask; irq_status = RREG32(dec->base_addr + VCMD_IRQ_STATUS_OFFSET); @@ -64,17 +64,21 @@ static void dec_abnrm_intr_work(struct work_struct *work) if (irq_status & VCMD_IRQ_STATUS_TIMEOUT_MASK) { reset_required = true; - event_mask = HL_NOTIFIER_EVENT_GENERAL_HW_ERR; - } else if (irq_status & VCMD_IRQ_STATUS_CMDERR_MASK) { - event_mask = HL_NOTIFIER_EVENT_UNDEFINED_OPCODE; - } else { - event_mask = HL_NOTIFIER_EVENT_USER_ENGINE_ERR; + event_mask |= HL_NOTIFIER_EVENT_GENERAL_HW_ERR; } + if (irq_status & VCMD_IRQ_STATUS_CMDERR_MASK) + event_mask |= HL_NOTIFIER_EVENT_UNDEFINED_OPCODE; + + if (irq_status & (VCMD_IRQ_STATUS_ENDCMD_MASK | + VCMD_IRQ_STATUS_BUSERR_MASK | + VCMD_IRQ_STATUS_ABORT_MASK)) + event_mask |= HL_NOTIFIER_EVENT_USER_ENGINE_ERR; + if (reset_required) { event_mask |= HL_NOTIFIER_EVENT_DEVICE_RESET; hl_device_cond_reset(hdev, 0, event_mask); - } else { + } else if (event_mask) { hl_notifier_event_send_all(hdev, event_mask); } } |