Skip to contentSkip to conversation

accel/ivpu: Fix wrong register read in LNL failure diagnostics

PATCH In review Karol Wachowski 2 participants 3 messages Jul 10 – Jul 13

Subsystems (2)
lore
Share & tools
lore

Karol Wachowski

author maintainer
#0 lore raw

PATCH 1/1 accel/ivpu: Fix wrong register read in LNL failure diagnostics

diagnose_failure_lnl() read VPU_HW_BTRS_MTL_INTERRUPT_STAT instead of VPU_HW_BTRS_LNL_INTERRUPT_STAT, which on LNL and newer parts is a different register with a different bit layout, so failure diagnostics decoded the wrong register and reported a bogus error cause. Read the LNL interrupt status register instead.

Fixes 8a27ad81f7d3 ("accel/ivpu: Split IP and buttress code")
---
 drivers/accel/ivpu/ivpu_hw_btrs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_hw_btrs.c +1 -1
index dac935164e11..a17c829adb89 100644
@@ -927,7 +927,7 @@ static void diagnose_failure_mtl(struct ivpu_device *vdev)
 
 static void diagnose_failure_lnl(struct ivpu_device *vdev)
 {
-	u32 reg = REGB_RD32(VPU_HW_BTRS_MTL_INTERRUPT_STAT) & BTRS_LNL_IRQ_MASK;
+	u32 reg = REGB_RD32(VPU_HW_BTRS_LNL_INTERRUPT_STAT) & BTRS_LNL_IRQ_MASK;
 
 	if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, ATS_ERR, reg)) {
 		ivpu_err(vdev, "ATS_ERR_LOG1 0x%08x ATS_ERR_LOG2 0x%08x\n",
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Karol Wachowski

diagnose_failure_lnl() read VPU_HW_BTRS_MTL_INTERRUPT_STAT instead of VPU_HW_BTRS_LNL_INTERRUPT_STAT, which on LNL and newer parts is a different register with a different bit layout, so failure diagnostics decoded the wrong register and reported a bogus error cause. Read the LNL interrupt status register instead.

Fixes 8a27ad81f7d3 ("accel/ivpu: Split IP and buttress code")
---
  drivers/accel/ivpu/ivpu_hw_btrs.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_hw_btrs.c +0 -0
index dac935164e11..a17c829adb89 100644

drivers/accel/ivpu/ivpu_hw_btrs.c static void diagnose_failure_mtl(struct ivpu_device *vdev) · line 933

Quoted 8 lines
drivers/accel/ivpu/ivpu_hw_btrs.c +1 -1
@@ -927,7 +927,7 @@ static void diagnose_failure_mtl(struct ivpu_device *vdev)
 
  static void diagnose_failure_lnl(struct ivpu_device *vdev)
  {
-	u32 reg = REGB_RD32(VPU_HW_BTRS_MTL_INTERRUPT_STAT) & BTRS_LNL_IRQ_MASK;
+	u32 reg = REGB_RD32(VPU_HW_BTRS_LNL_INTERRUPT_STAT) & BTRS_LNL_IRQ_MASK;
 
  	if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, ATS_ERR, reg)) {
  		ivpu_err(vdev, "ATS_ERR_LOG1 0x%08x ATS_ERR_LOG2 0x%08x\n",
author maintainer
#2 lore raw
Quoted 13 lines · Andrzej Kacprowski
Quoted 12 lines · Karol Wachowski

diagnose_failure_lnl() read VPU_HW_BTRS_MTL_INTERRUPT_STAT instead of VPU_HW_BTRS_LNL_INTERRUPT_STAT, which on LNL and newer parts is a different register with a different bit layout, so failure diagnostics decoded the wrong register and reported a bogus error cause. Read the LNL interrupt status register instead.

Fixes 8a27ad81f7d3 ("accel/ivpu: Split IP and buttress code")

---
  drivers/accel/ivpu/ivpu_hw_btrs.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 13 lines
drivers/accel/ivpu/ivpu_hw_btrs.c +1 -1
index dac935164e11..a17c829adb89 100644
@@ -927,7 +927,7 @@ static void diagnose_failure_mtl(struct 
 ivpu_device *vdev)
   static void diagnose_failure_lnl(struct ivpu_device *vdev)
   {
-    u32 reg = REGB_RD32(VPU_HW_BTRS_MTL_INTERRUPT_STAT) & 
 BTRS_LNL_IRQ_MASK;
+    u32 reg = REGB_RD32(VPU_HW_BTRS_LNL_INTERRUPT_STAT) & 
 BTRS_LNL_IRQ_MASK;
       if (REG_TEST_FLD(VPU_HW_BTRS_LNL_INTERRUPT_STAT, ATS_ERR, reg)) {
Quoted 1 line

          ivpu_err(vdev, "ATS_ERR_LOG1 0x%08x ATS_ERR_LOG2 0x%08x\n",

Thanks!
Applied to drm-misc-fixes.