Skip to content

Commit b132ac5

Browse files
kwachowssgruszka
authored andcommitted
accel/ivpu/37xx: Fix missing VPUIP interrupts
Move sequence of masking and unmasking global interrupts from buttress interrupt handler to generic one that handles both VPUIP and BTRS interrupts. Unmasking global interrupts will re-trigger MSI for any pending interrupts. Lack of this sequence will cause the driver to miss any VPUIP interrupt that comes after reading VPU_37XX_HOST_SS_ICB_STATUS_0 and before clearing all active interrupt sources. Fixes: 35b1376 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Cc: stable@vger.kernel.org Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com> Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231024161952.759914-1-stanislaw.gruszka@linux.intel.com
1 parent 4e6c38c commit b132ac5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/accel/ivpu/ivpu_hw_37xx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -940,9 +940,6 @@ static u32 ivpu_hw_37xx_irqb_handler(struct ivpu_device *vdev, int irq)
940940
if (status == 0)
941941
return 0;
942942

943-
/* Disable global interrupt before handling local buttress interrupts */
944-
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
945-
946943
if (REG_TEST_FLD(VPU_37XX_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status))
947944
ivpu_dbg(vdev, IRQ, "FREQ_CHANGE irq: %08x",
948945
REGB_RD32(VPU_37XX_BUTTRESS_CURRENT_PLL));
@@ -974,9 +971,6 @@ static u32 ivpu_hw_37xx_irqb_handler(struct ivpu_device *vdev, int irq)
974971
else
975972
REGB_WR32(VPU_37XX_BUTTRESS_INTERRUPT_STAT, status);
976973

977-
/* Re-enable global interrupt */
978-
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
979-
980974
if (schedule_recovery)
981975
ivpu_pm_schedule_recovery(vdev);
982976

@@ -988,9 +982,14 @@ static irqreturn_t ivpu_hw_37xx_irq_handler(int irq, void *ptr)
988982
struct ivpu_device *vdev = ptr;
989983
u32 ret_irqv, ret_irqb;
990984

985+
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);
986+
991987
ret_irqv = ivpu_hw_37xx_irqv_handler(vdev, irq);
992988
ret_irqb = ivpu_hw_37xx_irqb_handler(vdev, irq);
993989

990+
/* Re-enable global interrupts to re-trigger MSI for pending interrupts */
991+
REGB_WR32(VPU_37XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);
992+
994993
return IRQ_RETVAL(ret_irqb | ret_irqv);
995994
}
996995

0 commit comments

Comments
 (0)