summaryrefslogtreecommitdiffstats
path: root/drivers/accel/ivpu
diff options
context:
space:
mode:
authorKarol Wachowski <karol.wachowski@linux.intel.com>2023-08-22 11:52:38 +0200
committerStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>2023-09-20 13:00:40 +0200
commite2ee60ad9aba41afb68f4387574610ee390029f1 (patch)
tree6088701f39004b46c0c190c281272fad205c1594 /drivers/accel/ivpu
parentc5f9362307c685fe6a90d344bf81579578fd25d8 (diff)
downloadlinux-stable-e2ee60ad9aba41afb68f4387574610ee390029f1.tar.gz
linux-stable-e2ee60ad9aba41afb68f4387574610ee390029f1.tar.bz2
linux-stable-e2ee60ad9aba41afb68f4387574610ee390029f1.zip
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: 79cdc56c4a54 ("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
Diffstat (limited to 'drivers/accel/ivpu')
-rw-r--r--drivers/accel/ivpu/ivpu_hw_40xx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/accel/ivpu/ivpu_hw_40xx.c b/drivers/accel/ivpu/ivpu_hw_40xx.c
index 34626d66fa10..00c5dbbe6847 100644
--- a/drivers/accel/ivpu/ivpu_hw_40xx.c
+++ b/drivers/accel/ivpu/ivpu_hw_40xx.c
@@ -1046,7 +1046,8 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
if (status == 0)
return IRQ_NONE;
- REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
+ /* Disable global interrupt before handling local buttress interrupts */
+ REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
if (REG_TEST_FLD(VPU_40XX_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status))
ivpu_dbg(vdev, IRQ, "FREQ_CHANGE");
@@ -1092,6 +1093,12 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
schedule_recovery = true;
}
+ /* This must be done after interrupts are cleared at the source. */
+ REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
+
+ /* Re-enable global interrupt */
+ REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
+
if (schedule_recovery)
ivpu_pm_schedule_recovery(vdev);