Skip to content

Commit e2ee60a

Browse files
kwachowssgruszka
authored andcommitted
accel/ivpu/40xx: Fix buttress interrupt handling
Buttress spec requires that the interrupt status is cleared at the source first (before clearing MTL_BUTTRESS_INTERRUPT_STAT), that implies that we have to mask out the global interrupt while handling buttress interrupts. Fixes: 79cdc56 ("accel/ivpu: Add initial support for VPU 4") Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230822095238.3722815-1-stanislaw.gruszka@linux.intel.com
1 parent c5f9362 commit e2ee60a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/accel/ivpu/ivpu_hw_40xx.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,8 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
10461046
if (status == 0)
10471047
return IRQ_NONE;
10481048

1049-
REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
1049+
/* Disable global interrupt before handling local buttress interrupts */
1050+
REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
10501051

10511052
if (REG_TEST_FLD(VPU_40XX_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status))
10521053
ivpu_dbg(vdev, IRQ, "FREQ_CHANGE");
@@ -1092,6 +1093,12 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
10921093
schedule_recovery = true;
10931094
}
10941095

1096+
/* This must be done after interrupts are cleared at the source. */
1097+
REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
1098+
1099+
/* Re-enable global interrupt */
1100+
REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
1101+
10951102
if (schedule_recovery)
10961103
ivpu_pm_schedule_recovery(vdev);
10971104

0 commit comments

Comments
 (0)