Skip to content

Commit 7f34e01

Browse files
kwachowssgruszka
authored andcommitted
accel/ivpu: Clear specific interrupt status bits on C0
MTL C0 stepping fixed issue related to butrress interrupt status clearing, to clear an interrupt status it is required to write 1 to specific status bit field. This allows to execute read, modify and write routine. Writing 0 will not clear the interrupt and will cause interrupt storm. Fixes: 35b1376 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Cc: [email protected] # 6.3.x Signed-off-by: Karol Wachowski <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 020b527 commit 7f34e01

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct ivpu_wa_table {
7575
bool punit_disabled;
7676
bool clear_runtime_mem;
7777
bool d3hot_after_power_off;
78+
bool interrupt_clear_with_0;
7879
};
7980

8081
struct ivpu_hw_info;

drivers/accel/ivpu/ivpu_hw_mtl.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)
101101
vdev->wa.punit_disabled = ivpu_is_fpga(vdev);
102102
vdev->wa.clear_runtime_mem = false;
103103
vdev->wa.d3hot_after_power_off = true;
104+
105+
if (ivpu_device_id(vdev) == PCI_DEVICE_ID_MTL && ivpu_revision(vdev) < 4)
106+
vdev->wa.interrupt_clear_with_0 = true;
104107
}
105108

106109
static void ivpu_hw_timeouts_init(struct ivpu_device *vdev)
@@ -973,12 +976,15 @@ static u32 ivpu_hw_mtl_irqb_handler(struct ivpu_device *vdev, int irq)
973976
schedule_recovery = true;
974977
}
975978

976-
/*
977-
* Clear local interrupt status by writing 0 to all bits.
978-
* This must be done after interrupts are cleared at the source.
979-
* Writing 1 triggers an interrupt, so we can't perform read update write.
980-
*/
981-
REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, 0x0);
979+
/* This must be done after interrupts are cleared at the source. */
980+
if (IVPU_WA(interrupt_clear_with_0))
981+
/*
982+
* Writing 1 triggers an interrupt, so we can't perform read update write.
983+
* Clear local interrupt status by writing 0 to all bits.
984+
*/
985+
REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, 0x0);
986+
else
987+
REGB_WR32(MTL_BUTTRESS_INTERRUPT_STAT, status);
982988

983989
/* Re-enable global interrupt */
984990
REGB_WR32(MTL_BUTTRESS_GLOBAL_INT_MASK, 0x0);

0 commit comments

Comments
 (0)