* [PATCH 0/6] drm/msm: Assorted fixes - June/26
@ 2026-06-04 20:08 Akhil P Oommen
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
` (5 more replies)
0 siblings, 6 replies; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Shivam Rawat, Jie Zhang
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
Jie Zhang (5):
drm/msm: Recover HW before retire hung submit
drm/msm/a6xx: Fix A663 GPUCC register list for state capture
drm/msm/a6xx: Fix A621 GPUCC register list for state capture
drm/msm/a6xx: Fix IRQ storm during msm_recovery test
drm/msm: Fix task_struct reference leak in recover_worker
Shivam Rawat (1):
drm/msm/a6xx: Fix stale rpmh votes after suspend
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 ++++-
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 5 ++++-
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 12 ++++++++++++
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
drivers/gpu/drm/msm/msm_gpu.c | 8 ++++++--
7 files changed, 39 insertions(+), 6 deletions(-)
---
base-commit: ef8274b9c19a4b614e10ce95553d0d363dc1c1f8
change-id: 20260605-assorted-fixes-june-61940864a97f
Best regards,
--
Akhil P Oommen <akhilpo@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
@ 2026-06-04 20:08 ` Akhil P Oommen
2026-06-05 13:09 ` Neil Armstrong
` (2 more replies)
2026-06-04 20:08 ` [PATCH 2/6] drm/msm: Recover HW before retire hung submit Akhil P Oommen
` (4 subsequent siblings)
5 siblings, 3 replies; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Shivam Rawat
From: Shivam Rawat <shivrawa@qti.qualcomm.com>
There are stale RPMH votes (BCM votes) observed after GMU suspend. This
is because the rpmh stop sequences are skipped during gmu suspend. Fix
this and also move GMU to reset state to avoid any further activity.
Fixes: f248d5d5159a ("drm/msm/a6xx: Fix PDC sleep sequence")
Signed-off-by: Shivam Rawat <shivrawa@qti.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 2e5d7b53a0c3..a2f6918c4f7f 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -642,7 +642,7 @@ static void a6xx_rpmh_stop(struct a6xx_gmu *gmu)
int ret;
u32 val;
- if (test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
+ if (!test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
return;
if (adreno_is_a840(adreno_gpu))
@@ -1465,6 +1465,9 @@ static void a6xx_gmu_shutdown(struct a6xx_gmu *gmu)
/* Stop the interrupts and mask the hardware */
a6xx_gmu_irq_disable(gmu);
+ /* Halt the gmu cm3 core */
+ gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1);
+
/* Tell RPMh to power off the GPU */
a6xx_rpmh_stop(gmu);
--
2.51.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/6] drm/msm: Recover HW before retire hung submit
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
@ 2026-06-04 20:08 ` Akhil P Oommen
2026-06-08 8:11 ` Konrad Dybcio
2026-06-04 20:08 ` [PATCH 3/6] drm/msm/a6xx: Fix A663 GPUCC register list for state capture Akhil P Oommen
` (3 subsequent siblings)
5 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Jie Zhang
From: Jie Zhang <jie.zhang@oss.qualcomm.com>
During recovery, it is not safe to retire the hung submit before we
recover the GPU. Retiring the submit triggers BO free and that can
result in GPU pagefaults since the GPU may be actively accessing those
BOs.
To fix this, retire the submits after gpu recovery is complete in
recover_worker().
Fixes: 1a370be9ac51 ("drm/msm: restart queued submits after hang")
Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_gpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 18ed00e5f143..9ac7740a87f0 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -552,11 +552,11 @@ static void recover_worker(struct kthread_work *work)
msm_update_fence(ring->fctx, fence);
}
+ gpu->funcs->recover(gpu);
+
/* retire completed submits, plus the one that hung: */
retire_submits(gpu);
- gpu->funcs->recover(gpu);
-
/*
* Replay all remaining submits starting with highest priority
* ring
--
2.51.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/6] drm/msm/a6xx: Fix A663 GPUCC register list for state capture
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
2026-06-04 20:08 ` [PATCH 2/6] drm/msm: Recover HW before retire hung submit Akhil P Oommen
@ 2026-06-04 20:08 ` Akhil P Oommen
2026-06-06 12:04 ` Dmitry Baryshkov
2026-06-04 20:08 ` [PATCH 4/6] drm/msm/a6xx: Fix A621 " Akhil P Oommen
` (2 subsequent siblings)
5 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Jie Zhang
From: Jie Zhang <jie.zhang@oss.qualcomm.com>
The GPUCC register list for A663 is incorrect, which can cause
out-of-bounds register access during GPU state capture.
Update it to use the correct register ranges.
Fixes: 5773cce8615c ("drm/msm/a6xx: Add support for A663")
Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
index 166365359fa6..2a62a22077f9 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
@@ -1244,7 +1244,9 @@ static void a6xx_get_gmu_registers(struct msm_gpu *gpu,
_a6xx_get_gmu_registers(gpu, a6xx_state, &a6xx_gmu_reglist[1],
&a6xx_state->gmu_registers[1], true);
- if (adreno_is_a621(adreno_gpu) || adreno_is_a623(adreno_gpu))
+ if (adreno_is_a621(adreno_gpu) ||
+ adreno_is_a623(adreno_gpu) ||
+ adreno_is_a663(adreno_gpu))
_a6xx_get_gmu_registers(gpu, a6xx_state, &a621_gpucc_reg,
&a6xx_state->gmu_registers[2], false);
else
--
2.51.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/6] drm/msm/a6xx: Fix A621 GPUCC register list for state capture
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
` (2 preceding siblings ...)
2026-06-04 20:08 ` [PATCH 3/6] drm/msm/a6xx: Fix A663 GPUCC register list for state capture Akhil P Oommen
@ 2026-06-04 20:08 ` Akhil P Oommen
2026-06-06 12:05 ` Dmitry Baryshkov
2026-06-04 20:08 ` [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test Akhil P Oommen
2026-06-04 20:08 ` [PATCH 6/6] drm/msm: Fix task_struct reference leak in recover_worker Akhil P Oommen
5 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Jie Zhang
From: Jie Zhang <jie.zhang@oss.qualcomm.com>
A621 uses an incorrect GPUCC register list during state capture.
The existing list matches A623/A663. Rename it accordingly and add a
dedicated A621 GPUCC register list.
Fixes: 11cdb81b3c1b ("drm/msm/a6xx: Fix gpucc register block for A621")
Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 7 ++++---
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 12 ++++++++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
index 2a62a22077f9..3ea8ff8c7404 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
@@ -1244,11 +1244,12 @@ static void a6xx_get_gmu_registers(struct msm_gpu *gpu,
_a6xx_get_gmu_registers(gpu, a6xx_state, &a6xx_gmu_reglist[1],
&a6xx_state->gmu_registers[1], true);
- if (adreno_is_a621(adreno_gpu) ||
- adreno_is_a623(adreno_gpu) ||
- adreno_is_a663(adreno_gpu))
+ if (adreno_is_a621(adreno_gpu))
_a6xx_get_gmu_registers(gpu, a6xx_state, &a621_gpucc_reg,
&a6xx_state->gmu_registers[2], false);
+ else if (adreno_is_a623(adreno_gpu) || adreno_is_a663(adreno_gpu))
+ _a6xx_get_gmu_registers(gpu, a6xx_state, &a623_gpucc_reg,
+ &a6xx_state->gmu_registers[2], false);
else
_a6xx_get_gmu_registers(gpu, a6xx_state, &a6xx_gpucc_reg,
&a6xx_state->gmu_registers[2], false);
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
index b49d8427b59e..0a13a65f89ac 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
@@ -377,6 +377,17 @@ static const u32 a6xx_gmu_gpucc_registers[] = {
};
static const u32 a621_gmu_gpucc_registers[] = {
+ /* GPU CC */
+ 0x24000, 0x2400e, 0x24400, 0x2440e, 0x24800, 0x24805, 0x24c00, 0x24cff,
+ 0x25800, 0x25804, 0x25c00, 0x25c04, 0x26000, 0x26004, 0x26400, 0x26405,
+ 0x26414, 0x2641d, 0x2642a, 0x26430, 0x26432, 0x26432, 0x26441, 0x26455,
+ 0x26466, 0x26468, 0x26478, 0x2647a, 0x26489, 0x2648a, 0x2649c, 0x2649e,
+ 0x264a0, 0x264a3, 0x264b3, 0x264b5, 0x264c5, 0x264c7, 0x264d6, 0x264d8,
+ 0x264e8, 0x264e9, 0x264f9, 0x264fc, 0x2650b, 0x2650c, 0x2651c, 0x2651e,
+ 0x26540, 0x26570, 0x26600, 0x26616, 0x26620, 0x2662d,
+};
+
+static const u32 a623_gmu_gpucc_registers[] = {
/* GPU CC */
0x24000, 0x2400e, 0x24400, 0x2440e, 0x25800, 0x25804, 0x25c00, 0x25c04,
0x26000, 0x26004, 0x26400, 0x26405, 0x26414, 0x2641d, 0x2642a, 0x26430,
@@ -402,6 +413,7 @@ static const struct a6xx_registers a6xx_gmu_reglist[] = {
static const struct a6xx_registers a6xx_gpucc_reg = REGS(a6xx_gmu_gpucc_registers, 0, 0);
static const struct a6xx_registers a621_gpucc_reg = REGS(a621_gmu_gpucc_registers, 0, 0);
+static const struct a6xx_registers a623_gpucc_reg = REGS(a623_gmu_gpucc_registers, 0, 0);
static u32 a6xx_get_cp_roq_size(struct msm_gpu *gpu);
static u32 a7xx_get_cp_roq_size(struct msm_gpu *gpu);
--
2.51.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
` (3 preceding siblings ...)
2026-06-04 20:08 ` [PATCH 4/6] drm/msm/a6xx: Fix A621 " Akhil P Oommen
@ 2026-06-04 20:08 ` Akhil P Oommen
2026-06-05 6:50 ` Rob Clark
2026-06-04 20:08 ` [PATCH 6/6] drm/msm: Fix task_struct reference leak in recover_worker Akhil P Oommen
5 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Jie Zhang
From: Jie Zhang <jie.zhang@oss.qualcomm.com>
Once a hang is triggered by the msm_recovery test, the gpu error irq
remains asserted and triggers an interrupt storm. In the worst case,
this IRQ storm lands on the CPU core where the hangcheck timer is
scheduled, blocking it from running. This eventually leads to CPU
watchdog timeouts.
To fix this, mask the gpu error irqs during msm_recovery test and
enable them back during the recovery.
Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
drivers/gpu/drm/msm/msm_gpu.c | 2 ++
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 2c0bbac43c52..f1df2514c613 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
if (priv->disable_err_irq) {
+ /* Turn off interrupts to avoid interrupt storm */
+ gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
+ A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
+ A5XX_RBBM_INT_0_MASK_CP_SW);
+
status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
A5XX_RBBM_INT_0_MASK_CP_SW;
}
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 8b3bb2fd433b..9a4f9d0e1780 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
- if (priv->disable_err_irq)
+ if (priv->disable_err_irq) {
+ /* Turn off interrupts to avoid interrupt storm */
+ gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
+ }
if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
a6xx_fault_detect_irq(gpu);
diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
index 9e44fd1ae634..0f6fd35bd587 100644
--- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
@@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
- if (priv->disable_err_irq)
+ if (priv->disable_err_irq) {
+ /* Turn off interrupts to avoid interrupt storm */
+ gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
+ }
if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
a8xx_fault_detect_irq(gpu);
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 9ac7740a87f0..48ac51f4119b 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
msm_update_fence(ring->fctx, fence);
}
+ priv->disable_err_irq = false;
+
gpu->funcs->recover(gpu);
/* retire completed submits, plus the one that hung: */
--
2.51.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/6] drm/msm: Fix task_struct reference leak in recover_worker
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
` (4 preceding siblings ...)
2026-06-04 20:08 ` [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test Akhil P Oommen
@ 2026-06-04 20:08 ` Akhil P Oommen
2026-06-08 8:16 ` Konrad Dybcio
5 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-04 20:08 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Akhil P Oommen, Jie Zhang
From: Jie Zhang <jie.zhang@oss.qualcomm.com>
get_pid_task() increments the task reference count, but the
corresponding put_task_struct() was missing in the else branch,
leaking a reference on every GPU hang recovery.
Fixes: 25654a1756a4 ("drm/msm: Update global fault counter when faulty process has already ended")
Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/msm_gpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 48ac51f4119b..03c057856065 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -505,6 +505,8 @@ static void recover_worker(struct kthread_work *work)
*/
if (!vm->managed)
msm_gem_vm_unusable(submit->vm);
+
+ put_task_struct(task);
}
noreclaim_flag = memalloc_noreclaim_save();
--
2.51.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-04 20:08 ` [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test Akhil P Oommen
@ 2026-06-05 6:50 ` Rob Clark
2026-06-08 21:54 ` Akhil P Oommen
0 siblings, 1 reply; 20+ messages in thread
From: Rob Clark @ 2026-06-05 6:50 UTC (permalink / raw)
To: Akhil P Oommen
Cc: Sean Paul, Konrad Dybcio, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Marijn Suijten, David Airlie, Simona Vetter,
Puranam V G Tejaswi, Jie Zhang, Maíra Canal, linux-arm-msm,
dri-devel, freedreno, linux-kernel, Jie Zhang
On Thu, Jun 4, 2026 at 1:10 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>
> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>
> Once a hang is triggered by the msm_recovery test, the gpu error irq
> remains asserted and triggers an interrupt storm. In the worst case,
> this IRQ storm lands on the CPU core where the hangcheck timer is
> scheduled, blocking it from running. This eventually leads to CPU
> watchdog timeouts.
>
> To fix this, mask the gpu error irqs during msm_recovery test and
> enable them back during the recovery.
>
> Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
> drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
> drivers/gpu/drm/msm/msm_gpu.c | 2 ++
> 4 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> index 2c0bbac43c52..f1df2514c613 100644
> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> @@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
> status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
>
> if (priv->disable_err_irq) {
> + /* Turn off interrupts to avoid interrupt storm */
> + gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
> + A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
> + A5XX_RBBM_INT_0_MASK_CP_SW);
> +
> status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
> A5XX_RBBM_INT_0_MASK_CP_SW;
> }
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 8b3bb2fd433b..9a4f9d0e1780 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
>
> gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
>
> - if (priv->disable_err_irq)
> + if (priv->disable_err_irq) {
> + /* Turn off interrupts to avoid interrupt storm */
> + gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
> + }
>
> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
> a6xx_fault_detect_irq(gpu);
> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> index 9e44fd1ae634..0f6fd35bd587 100644
> --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> @@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
>
> gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
>
> - if (priv->disable_err_irq)
> + if (priv->disable_err_irq) {
> + /* Turn off interrupts to avoid interrupt storm */
> + gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
> + }
>
> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
> a8xx_fault_detect_irq(gpu);
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 9ac7740a87f0..48ac51f4119b 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
> msm_update_fence(ring->fctx, fence);
> }
>
> + priv->disable_err_irq = false;
Ok, so we rely on recovery to re-enable the error irqs.. that is
probably ok, given the intended purpose of the debugfs file. And,
well, it is debugfs. But why do we clear disable_err_irq here?
BR,
-R
> +
> gpu->funcs->recover(gpu);
>
> /* retire completed submits, plus the one that hung: */
>
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
@ 2026-06-05 13:09 ` Neil Armstrong
2026-06-06 12:04 ` Dmitry Baryshkov
2026-06-08 8:10 ` Konrad Dybcio
2 siblings, 0 replies; 20+ messages in thread
From: Neil Armstrong @ 2026-06-05 13:09 UTC (permalink / raw)
To: Akhil P Oommen, Rob Clark, Sean Paul, Konrad Dybcio,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Marijn Suijten,
David Airlie, Simona Vetter, Puranam V G Tejaswi, Jie Zhang,
Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Shivam Rawat
On 6/4/26 22:08, Akhil P Oommen wrote:
> From: Shivam Rawat <shivrawa@qti.qualcomm.com>
>
> There are stale RPMH votes (BCM votes) observed after GMU suspend. This
> is because the rpmh stop sequences are skipped during gmu suspend. Fix
> this and also move GMU to reset state to avoid any further activity.
>
> Fixes: f248d5d5159a ("drm/msm/a6xx: Fix PDC sleep sequence")
> Signed-off-by: Shivam Rawat <shivrawa@qti.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index 2e5d7b53a0c3..a2f6918c4f7f 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -642,7 +642,7 @@ static void a6xx_rpmh_stop(struct a6xx_gmu *gmu)
> int ret;
> u32 val;
>
> - if (test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
> + if (!test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
> return;
>
> if (adreno_is_a840(adreno_gpu))
> @@ -1465,6 +1465,9 @@ static void a6xx_gmu_shutdown(struct a6xx_gmu *gmu)
> /* Stop the interrupts and mask the hardware */
> a6xx_gmu_irq_disable(gmu);
>
> + /* Halt the gmu cm3 core */
> + gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1);
> +
> /* Tell RPMh to power off the GPU */
> a6xx_rpmh_stop(gmu);
>
>
Thanks !
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
2026-06-05 13:09 ` Neil Armstrong
@ 2026-06-06 12:04 ` Dmitry Baryshkov
2026-06-08 8:10 ` Konrad Dybcio
2 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2026-06-06 12:04 UTC (permalink / raw)
To: Akhil P Oommen
Cc: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal,
linux-arm-msm, dri-devel, freedreno, linux-kernel, Shivam Rawat
On Fri, Jun 05, 2026 at 01:38:17AM +0530, Akhil P Oommen wrote:
> From: Shivam Rawat <shivrawa@qti.qualcomm.com>
>
> There are stale RPMH votes (BCM votes) observed after GMU suspend. This
> is because the rpmh stop sequences are skipped during gmu suspend. Fix
> this and also move GMU to reset state to avoid any further activity.
>
> Fixes: f248d5d5159a ("drm/msm/a6xx: Fix PDC sleep sequence")
> Signed-off-by: Shivam Rawat <shivrawa@qti.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 3/6] drm/msm/a6xx: Fix A663 GPUCC register list for state capture
2026-06-04 20:08 ` [PATCH 3/6] drm/msm/a6xx: Fix A663 GPUCC register list for state capture Akhil P Oommen
@ 2026-06-06 12:04 ` Dmitry Baryshkov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2026-06-06 12:04 UTC (permalink / raw)
To: Akhil P Oommen
Cc: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal,
linux-arm-msm, dri-devel, freedreno, linux-kernel, Jie Zhang
On Fri, Jun 05, 2026 at 01:38:19AM +0530, Akhil P Oommen wrote:
> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>
> The GPUCC register list for A663 is incorrect, which can cause
> out-of-bounds register access during GPU state capture.
>
> Update it to use the correct register ranges.
>
> Fixes: 5773cce8615c ("drm/msm/a6xx: Add support for A663")
> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 4/6] drm/msm/a6xx: Fix A621 GPUCC register list for state capture
2026-06-04 20:08 ` [PATCH 4/6] drm/msm/a6xx: Fix A621 " Akhil P Oommen
@ 2026-06-06 12:05 ` Dmitry Baryshkov
0 siblings, 0 replies; 20+ messages in thread
From: Dmitry Baryshkov @ 2026-06-06 12:05 UTC (permalink / raw)
To: Akhil P Oommen
Cc: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Marijn Suijten, David Airlie,
Simona Vetter, Puranam V G Tejaswi, Jie Zhang, Maíra Canal,
linux-arm-msm, dri-devel, freedreno, linux-kernel, Jie Zhang
On Fri, Jun 05, 2026 at 01:38:20AM +0530, Akhil P Oommen wrote:
> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>
> A621 uses an incorrect GPUCC register list during state capture.
>
> The existing list matches A623/A663. Rename it accordingly and add a
> dedicated A621 GPUCC register list.
>
> Fixes: 11cdb81b3c1b ("drm/msm/a6xx: Fix gpucc register block for A621")
> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 7 ++++---
> drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 12 ++++++++++++
> 2 files changed, 16 insertions(+), 3 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
2026-06-05 13:09 ` Neil Armstrong
2026-06-06 12:04 ` Dmitry Baryshkov
@ 2026-06-08 8:10 ` Konrad Dybcio
2 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2026-06-08 8:10 UTC (permalink / raw)
To: Akhil P Oommen, Rob Clark, Sean Paul, Konrad Dybcio,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Marijn Suijten,
David Airlie, Simona Vetter, Puranam V G Tejaswi, Jie Zhang,
Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Shivam Rawat
On 6/4/26 10:08 PM, Akhil P Oommen wrote:
> From: Shivam Rawat <shivrawa@qti.qualcomm.com>
>
> There are stale RPMH votes (BCM votes) observed after GMU suspend. This
> is because the rpmh stop sequences are skipped during gmu suspend. Fix
> this and also move GMU to reset state to avoid any further activity.
>
> Fixes: f248d5d5159a ("drm/msm/a6xx: Fix PDC sleep sequence")
> Signed-off-by: Shivam Rawat <shivrawa@qti.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index 2e5d7b53a0c3..a2f6918c4f7f 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -642,7 +642,7 @@ static void a6xx_rpmh_stop(struct a6xx_gmu *gmu)
> int ret;
> u32 val;
>
> - if (test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
> + if (!test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
> return;
Hiding in plain sight!
>
> if (adreno_is_a840(adreno_gpu))
> @@ -1465,6 +1465,9 @@ static void a6xx_gmu_shutdown(struct a6xx_gmu *gmu)
> /* Stop the interrupts and mask the hardware */
> a6xx_gmu_irq_disable(gmu);
>
> + /* Halt the gmu cm3 core */
> + gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1);
I believe this is what kgsl does as well, so:
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 2/6] drm/msm: Recover HW before retire hung submit
2026-06-04 20:08 ` [PATCH 2/6] drm/msm: Recover HW before retire hung submit Akhil P Oommen
@ 2026-06-08 8:11 ` Konrad Dybcio
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2026-06-08 8:11 UTC (permalink / raw)
To: Akhil P Oommen, Rob Clark, Sean Paul, Konrad Dybcio,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Marijn Suijten,
David Airlie, Simona Vetter, Puranam V G Tejaswi, Jie Zhang,
Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Jie Zhang
On 6/4/26 10:08 PM, Akhil P Oommen wrote:
> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>
> During recovery, it is not safe to retire the hung submit before we
> recover the GPU. Retiring the submit triggers BO free and that can
> result in GPU pagefaults since the GPU may be actively accessing those
> BOs.
>
> To fix this, retire the submits after gpu recovery is complete in
> recover_worker().
>
> Fixes: 1a370be9ac51 ("drm/msm: restart queued submits after hang")
> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
Acked-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/6] drm/msm: Fix task_struct reference leak in recover_worker
2026-06-04 20:08 ` [PATCH 6/6] drm/msm: Fix task_struct reference leak in recover_worker Akhil P Oommen
@ 2026-06-08 8:16 ` Konrad Dybcio
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2026-06-08 8:16 UTC (permalink / raw)
To: Akhil P Oommen, Rob Clark, Sean Paul, Konrad Dybcio,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Marijn Suijten,
David Airlie, Simona Vetter, Puranam V G Tejaswi, Jie Zhang,
Maíra Canal
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, Jie Zhang
On 6/4/26 10:08 PM, Akhil P Oommen wrote:
> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>
> get_pid_task() increments the task reference count, but the
> corresponding put_task_struct() was missing in the else branch,
> leaking a reference on every GPU hang recovery.
>
> Fixes: 25654a1756a4 ("drm/msm: Update global fault counter when faulty process has already ended")
> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-05 6:50 ` Rob Clark
@ 2026-06-08 21:54 ` Akhil P Oommen
2026-06-09 0:20 ` Rob Clark
0 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-08 21:54 UTC (permalink / raw)
To: rob.clark
Cc: Sean Paul, Konrad Dybcio, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Marijn Suijten, David Airlie, Simona Vetter,
Puranam V G Tejaswi, Jie Zhang, Maíra Canal, linux-arm-msm,
dri-devel, freedreno, linux-kernel, Jie Zhang
On 6/5/2026 12:20 PM, Rob Clark wrote:
> On Thu, Jun 4, 2026 at 1:10 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>>
>> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>>
>> Once a hang is triggered by the msm_recovery test, the gpu error irq
>> remains asserted and triggers an interrupt storm. In the worst case,
>> this IRQ storm lands on the CPU core where the hangcheck timer is
>> scheduled, blocking it from running. This eventually leads to CPU
>> watchdog timeouts.
>>
>> To fix this, mask the gpu error irqs during msm_recovery test and
>> enable them back during the recovery.
>>
>> Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
>> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
>> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
>> ---
>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
>> drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
>> drivers/gpu/drm/msm/msm_gpu.c | 2 ++
>> 4 files changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>> index 2c0bbac43c52..f1df2514c613 100644
>> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>> @@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
>> status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
>>
>> if (priv->disable_err_irq) {
>> + /* Turn off interrupts to avoid interrupt storm */
>> + gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
>> + A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
>> + A5XX_RBBM_INT_0_MASK_CP_SW);
>> +
>> status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
>> A5XX_RBBM_INT_0_MASK_CP_SW;
>> }
>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> index 8b3bb2fd433b..9a4f9d0e1780 100644
>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> @@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
>>
>> gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
>>
>> - if (priv->disable_err_irq)
>> + if (priv->disable_err_irq) {
>> + /* Turn off interrupts to avoid interrupt storm */
>> + gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
>> + }
>>
>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
>> a6xx_fault_detect_irq(gpu);
>> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>> index 9e44fd1ae634..0f6fd35bd587 100644
>> --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>> @@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
>>
>> gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
>>
>> - if (priv->disable_err_irq)
>> + if (priv->disable_err_irq) {
>> + /* Turn off interrupts to avoid interrupt storm */
>> + gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
>> + }
>>
>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
>> a8xx_fault_detect_irq(gpu);
>> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
>> index 9ac7740a87f0..48ac51f4119b 100644
>> --- a/drivers/gpu/drm/msm/msm_gpu.c
>> +++ b/drivers/gpu/drm/msm/msm_gpu.c
>> @@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
>> msm_update_fence(ring->fctx, fence);
>> }
>>
>> + priv->disable_err_irq = false;
>
> Ok, so we rely on recovery to re-enable the error irqs.. that is
> probably ok, given the intended purpose of the debugfs file. And,
> well, it is debugfs. But why do we clear disable_err_irq here?
Now that we are updating the IRQ mask register which won't reset until
there is a gpu suspend, its side effect will be felt even after
userspace deasserts the debugfs knob, potentially into the next
testcase. This is different from the older behavior. So, I felt it would
be better to reset this flag during the recovery, considering
msm_recovery is the only user of this knob, afaiu.
I should have explicitly called out this new behavior of disable_err_irq
in the commit text, but I forgot.
-Akhil.
>
> BR,
> -R
>
>> +
>> gpu->funcs->recover(gpu);
>>
>> /* retire completed submits, plus the one that hung: */
>>
>> --
>> 2.51.0
>>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-08 21:54 ` Akhil P Oommen
@ 2026-06-09 0:20 ` Rob Clark
2026-06-09 13:08 ` Akhil P Oommen
0 siblings, 1 reply; 20+ messages in thread
From: Rob Clark @ 2026-06-09 0:20 UTC (permalink / raw)
To: Akhil P Oommen
Cc: Sean Paul, Konrad Dybcio, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Marijn Suijten, David Airlie, Simona Vetter,
Puranam V G Tejaswi, Jie Zhang, Maíra Canal, linux-arm-msm,
dri-devel, freedreno, linux-kernel, Jie Zhang
On Mon, Jun 8, 2026 at 2:55 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>
> On 6/5/2026 12:20 PM, Rob Clark wrote:
> > On Thu, Jun 4, 2026 at 1:10 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
> >>
> >> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
> >>
> >> Once a hang is triggered by the msm_recovery test, the gpu error irq
> >> remains asserted and triggers an interrupt storm. In the worst case,
> >> this IRQ storm lands on the CPU core where the hangcheck timer is
> >> scheduled, blocking it from running. This eventually leads to CPU
> >> watchdog timeouts.
> >>
> >> To fix this, mask the gpu error irqs during msm_recovery test and
> >> enable them back during the recovery.
> >>
> >> Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
> >> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> >> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> >> ---
> >> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
> >> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
> >> drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
> >> drivers/gpu/drm/msm/msm_gpu.c | 2 ++
> >> 4 files changed, 15 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> >> index 2c0bbac43c52..f1df2514c613 100644
> >> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> >> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> >> @@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
> >> status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
> >>
> >> if (priv->disable_err_irq) {
> >> + /* Turn off interrupts to avoid interrupt storm */
> >> + gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
> >> + A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
> >> + A5XX_RBBM_INT_0_MASK_CP_SW);
> >> +
> >> status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
> >> A5XX_RBBM_INT_0_MASK_CP_SW;
> >> }
> >> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >> index 8b3bb2fd433b..9a4f9d0e1780 100644
> >> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >> @@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
> >>
> >> gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
> >>
> >> - if (priv->disable_err_irq)
> >> + if (priv->disable_err_irq) {
> >> + /* Turn off interrupts to avoid interrupt storm */
> >> + gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
> >> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
> >> + }
> >>
> >> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
> >> a6xx_fault_detect_irq(gpu);
> >> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> >> index 9e44fd1ae634..0f6fd35bd587 100644
> >> --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> >> +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> >> @@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
> >>
> >> gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
> >>
> >> - if (priv->disable_err_irq)
> >> + if (priv->disable_err_irq) {
> >> + /* Turn off interrupts to avoid interrupt storm */
> >> + gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
> >> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
> >> + }
> >>
> >> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
> >> a8xx_fault_detect_irq(gpu);
> >> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> >> index 9ac7740a87f0..48ac51f4119b 100644
> >> --- a/drivers/gpu/drm/msm/msm_gpu.c
> >> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> >> @@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
> >> msm_update_fence(ring->fctx, fence);
> >> }
> >>
> >> + priv->disable_err_irq = false;
> >
> > Ok, so we rely on recovery to re-enable the error irqs.. that is
> > probably ok, given the intended purpose of the debugfs file. And,
> > well, it is debugfs. But why do we clear disable_err_irq here?
>
> Now that we are updating the IRQ mask register which won't reset until
> there is a gpu suspend, its side effect will be felt even after
> userspace deasserts the debugfs knob, potentially into the next
> testcase. This is different from the older behavior. So, I felt it would
> be better to reset this flag during the recovery, considering
> msm_recovery is the only user of this knob, afaiu.
Hmm... maybe debugfs writes should just immediately update the irq
mask (if the gpu is powered)?
BR,
-R
> I should have explicitly called out this new behavior of disable_err_irq
> in the commit text, but I forgot.
>
> -Akhil.
>
> >
> > BR,
> > -R
> >
> >> +
> >> gpu->funcs->recover(gpu);
> >>
> >> /* retire completed submits, plus the one that hung: */
> >>
> >> --
> >> 2.51.0
> >>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-09 0:20 ` Rob Clark
@ 2026-06-09 13:08 ` Akhil P Oommen
2026-06-09 14:25 ` Rob Clark
0 siblings, 1 reply; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-09 13:08 UTC (permalink / raw)
To: rob.clark
Cc: Sean Paul, Konrad Dybcio, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Marijn Suijten, David Airlie, Simona Vetter,
Puranam V G Tejaswi, Jie Zhang, Maíra Canal, linux-arm-msm,
dri-devel, freedreno, linux-kernel, Jie Zhang
On 6/9/2026 5:50 AM, Rob Clark wrote:
> On Mon, Jun 8, 2026 at 2:55 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>>
>> On 6/5/2026 12:20 PM, Rob Clark wrote:
>>> On Thu, Jun 4, 2026 at 1:10 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>>>>
>>>> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>>>>
>>>> Once a hang is triggered by the msm_recovery test, the gpu error irq
>>>> remains asserted and triggers an interrupt storm. In the worst case,
>>>> this IRQ storm lands on the CPU core where the hangcheck timer is
>>>> scheduled, blocking it from running. This eventually leads to CPU
>>>> watchdog timeouts.
>>>>
>>>> To fix this, mask the gpu error irqs during msm_recovery test and
>>>> enable them back during the recovery.
>>>>
>>>> Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
>>>> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
>>>> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
>>>> ---
>>>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
>>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
>>>> drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
>>>> drivers/gpu/drm/msm/msm_gpu.c | 2 ++
>>>> 4 files changed, 15 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>>>> index 2c0bbac43c52..f1df2514c613 100644
>>>> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>>>> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>>>> @@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
>>>> status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
>>>>
>>>> if (priv->disable_err_irq) {
>>>> + /* Turn off interrupts to avoid interrupt storm */
>>>> + gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
>>>> + A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
>>>> + A5XX_RBBM_INT_0_MASK_CP_SW);
>>>> +
>>>> status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
>>>> A5XX_RBBM_INT_0_MASK_CP_SW;
>>>> }
>>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>>>> index 8b3bb2fd433b..9a4f9d0e1780 100644
>>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>>>> @@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
>>>>
>>>> gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
>>>>
>>>> - if (priv->disable_err_irq)
>>>> + if (priv->disable_err_irq) {
>>>> + /* Turn off interrupts to avoid interrupt storm */
>>>> + gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
>>>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
>>>> + }
>>>>
>>>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
>>>> a6xx_fault_detect_irq(gpu);
>>>> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>>>> index 9e44fd1ae634..0f6fd35bd587 100644
>>>> --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>>>> +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>>>> @@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
>>>>
>>>> gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
>>>>
>>>> - if (priv->disable_err_irq)
>>>> + if (priv->disable_err_irq) {
>>>> + /* Turn off interrupts to avoid interrupt storm */
>>>> + gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
>>>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
>>>> + }
>>>>
>>>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
>>>> a8xx_fault_detect_irq(gpu);
>>>> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
>>>> index 9ac7740a87f0..48ac51f4119b 100644
>>>> --- a/drivers/gpu/drm/msm/msm_gpu.c
>>>> +++ b/drivers/gpu/drm/msm/msm_gpu.c
>>>> @@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
>>>> msm_update_fence(ring->fctx, fence);
>>>> }
>>>>
>>>> + priv->disable_err_irq = false;
>>>
>>> Ok, so we rely on recovery to re-enable the error irqs.. that is
>>> probably ok, given the intended purpose of the debugfs file. And,
>>> well, it is debugfs. But why do we clear disable_err_irq here?
>>
>> Now that we are updating the IRQ mask register which won't reset until
>> there is a gpu suspend, its side effect will be felt even after
>> userspace deasserts the debugfs knob, potentially into the next
>> testcase. This is different from the older behavior. So, I felt it would
>> be better to reset this flag during the recovery, considering
>> msm_recovery is the only user of this knob, afaiu.
>
> Hmm... maybe debugfs writes should just immediately update the irq
> mask (if the gpu is powered)?
That needs some plumbing in adreno func table to program the register.
We can do that if you prefer that, but is it an overkill for this usecase?
-Akhil
>
> BR,
> -R
>
>> I should have explicitly called out this new behavior of disable_err_irq
>> in the commit text, but I forgot.
>>
>> -Akhil.
>>
>>>
>>> BR,
>>> -R
>>>
>>>> +
>>>> gpu->funcs->recover(gpu);
>>>>
>>>> /* retire completed submits, plus the one that hung: */
>>>>
>>>> --
>>>> 2.51.0
>>>>
>>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-09 13:08 ` Akhil P Oommen
@ 2026-06-09 14:25 ` Rob Clark
2026-06-09 20:03 ` Akhil P Oommen
0 siblings, 1 reply; 20+ messages in thread
From: Rob Clark @ 2026-06-09 14:25 UTC (permalink / raw)
To: Akhil P Oommen
Cc: Sean Paul, Konrad Dybcio, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Marijn Suijten, David Airlie, Simona Vetter,
Puranam V G Tejaswi, Jie Zhang, Maíra Canal, linux-arm-msm,
dri-devel, freedreno, linux-kernel, Jie Zhang
On Tue, Jun 9, 2026 at 6:09 AM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>
> On 6/9/2026 5:50 AM, Rob Clark wrote:
> > On Mon, Jun 8, 2026 at 2:55 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
> >>
> >> On 6/5/2026 12:20 PM, Rob Clark wrote:
> >>> On Thu, Jun 4, 2026 at 1:10 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
> >>>>
> >>>> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
> >>>>
> >>>> Once a hang is triggered by the msm_recovery test, the gpu error irq
> >>>> remains asserted and triggers an interrupt storm. In the worst case,
> >>>> this IRQ storm lands on the CPU core where the hangcheck timer is
> >>>> scheduled, blocking it from running. This eventually leads to CPU
> >>>> watchdog timeouts.
> >>>>
> >>>> To fix this, mask the gpu error irqs during msm_recovery test and
> >>>> enable them back during the recovery.
> >>>>
> >>>> Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
> >>>> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
> >>>> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> >>>> ---
> >>>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
> >>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
> >>>> drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
> >>>> drivers/gpu/drm/msm/msm_gpu.c | 2 ++
> >>>> 4 files changed, 15 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> >>>> index 2c0bbac43c52..f1df2514c613 100644
> >>>> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> >>>> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
> >>>> @@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
> >>>> status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
> >>>>
> >>>> if (priv->disable_err_irq) {
> >>>> + /* Turn off interrupts to avoid interrupt storm */
> >>>> + gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
> >>>> + A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
> >>>> + A5XX_RBBM_INT_0_MASK_CP_SW);
> >>>> +
> >>>> status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
> >>>> A5XX_RBBM_INT_0_MASK_CP_SW;
> >>>> }
> >>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >>>> index 8b3bb2fd433b..9a4f9d0e1780 100644
> >>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> >>>> @@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
> >>>>
> >>>> gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
> >>>>
> >>>> - if (priv->disable_err_irq)
> >>>> + if (priv->disable_err_irq) {
> >>>> + /* Turn off interrupts to avoid interrupt storm */
> >>>> + gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
> >>>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
> >>>> + }
> >>>>
> >>>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
> >>>> a6xx_fault_detect_irq(gpu);
> >>>> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> >>>> index 9e44fd1ae634..0f6fd35bd587 100644
> >>>> --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> >>>> +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
> >>>> @@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
> >>>>
> >>>> gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
> >>>>
> >>>> - if (priv->disable_err_irq)
> >>>> + if (priv->disable_err_irq) {
> >>>> + /* Turn off interrupts to avoid interrupt storm */
> >>>> + gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
> >>>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
> >>>> + }
> >>>>
> >>>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
> >>>> a8xx_fault_detect_irq(gpu);
> >>>> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> >>>> index 9ac7740a87f0..48ac51f4119b 100644
> >>>> --- a/drivers/gpu/drm/msm/msm_gpu.c
> >>>> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> >>>> @@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
> >>>> msm_update_fence(ring->fctx, fence);
> >>>> }
> >>>>
> >>>> + priv->disable_err_irq = false;
> >>>
> >>> Ok, so we rely on recovery to re-enable the error irqs.. that is
> >>> probably ok, given the intended purpose of the debugfs file. And,
> >>> well, it is debugfs. But why do we clear disable_err_irq here?
> >>
> >> Now that we are updating the IRQ mask register which won't reset until
> >> there is a gpu suspend, its side effect will be felt even after
> >> userspace deasserts the debugfs knob, potentially into the next
> >> testcase. This is different from the older behavior. So, I felt it would
> >> be better to reset this flag during the recovery, considering
> >> msm_recovery is the only user of this knob, afaiu.
> >
> > Hmm... maybe debugfs writes should just immediately update the irq
> > mask (if the gpu is powered)?
>
> That needs some plumbing in adreno func table to program the register.
> We can do that if you prefer that, but is it an overkill for this usecase?
Yeah, that is why I didn't suggest it earlier. But stealth re-enable
of err irqs makes the behavior harder to reason about, which I
dislike. I guess it works now because msm_recovery only does a single
hang-test w/ hw error irq's disabled. But from userspace PoV it seems
natural to expect error irq's to remain disabled until writing debugfs
again.
Since it is about debugfs and a single igt test, maybe it is just best
to document that this is how it works.
Or, would it be reasonable just to update the irq mask in gpu->submit()?
BR,
-R
> -Akhil
>
> >
> > BR,
> > -R
> >
> >> I should have explicitly called out this new behavior of disable_err_irq
> >> in the commit text, but I forgot.
> >>
> >> -Akhil.
> >>
> >>>
> >>> BR,
> >>> -R
> >>>
> >>>> +
> >>>> gpu->funcs->recover(gpu);
> >>>>
> >>>> /* retire completed submits, plus the one that hung: */
> >>>>
> >>>> --
> >>>> 2.51.0
> >>>>
> >>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test
2026-06-09 14:25 ` Rob Clark
@ 2026-06-09 20:03 ` Akhil P Oommen
0 siblings, 0 replies; 20+ messages in thread
From: Akhil P Oommen @ 2026-06-09 20:03 UTC (permalink / raw)
To: rob.clark
Cc: Sean Paul, Konrad Dybcio, Dmitry Baryshkov, Abhinav Kumar,
Jessica Zhang, Marijn Suijten, David Airlie, Simona Vetter,
Puranam V G Tejaswi, Jie Zhang, Maíra Canal, linux-arm-msm,
dri-devel, freedreno, linux-kernel, Jie Zhang
On 6/9/2026 7:55 PM, Rob Clark wrote:
> On Tue, Jun 9, 2026 at 6:09 AM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>>
>> On 6/9/2026 5:50 AM, Rob Clark wrote:
>>> On Mon, Jun 8, 2026 at 2:55 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>>>>
>>>> On 6/5/2026 12:20 PM, Rob Clark wrote:
>>>>> On Thu, Jun 4, 2026 at 1:10 PM Akhil P Oommen <akhilpo@oss.qualcomm.com> wrote:
>>>>>>
>>>>>> From: Jie Zhang <jie.zhang@oss.qualcomm.com>
>>>>>>
>>>>>> Once a hang is triggered by the msm_recovery test, the gpu error irq
>>>>>> remains asserted and triggers an interrupt storm. In the worst case,
>>>>>> this IRQ storm lands on the CPU core where the hangcheck timer is
>>>>>> scheduled, blocking it from running. This eventually leads to CPU
>>>>>> watchdog timeouts.
>>>>>>
>>>>>> To fix this, mask the gpu error irqs during msm_recovery test and
>>>>>> enable them back during the recovery.
>>>>>>
>>>>>> Fixes: 5edf2750d998 ("drm/msm: Add debugfs to disable hw err handling")
>>>>>> Signed-off-by: Jie Zhang <jie.zhang@oss.qualcomm.com>
>>>>>> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
>>>>>> ---
>>>>>> drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +++++
>>>>>> drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 5 ++++-
>>>>>> drivers/gpu/drm/msm/adreno/a8xx_gpu.c | 5 ++++-
>>>>>> drivers/gpu/drm/msm/msm_gpu.c | 2 ++
>>>>>> 4 files changed, 15 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>>>>>> index 2c0bbac43c52..f1df2514c613 100644
>>>>>> --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>>>>>> +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
>>>>>> @@ -1275,6 +1275,11 @@ static irqreturn_t a5xx_irq(struct msm_gpu *gpu)
>>>>>> status & ~A5XX_RBBM_INT_0_MASK_RBBM_AHB_ERROR);
>>>>>>
>>>>>> if (priv->disable_err_irq) {
>>>>>> + /* Turn off interrupts to avoid interrupt storm */
>>>>>> + gpu_write(gpu, REG_A5XX_RBBM_INT_0_MASK,
>>>>>> + A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
>>>>>> + A5XX_RBBM_INT_0_MASK_CP_SW);
>>>>>> +
>>>>>> status &= A5XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS |
>>>>>> A5XX_RBBM_INT_0_MASK_CP_SW;
>>>>>> }
>>>>>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>>>>>> index 8b3bb2fd433b..9a4f9d0e1780 100644
>>>>>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>>>>>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>>>>>> @@ -1911,8 +1911,11 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu)
>>>>>>
>>>>>> gpu_write(gpu, REG_A6XX_RBBM_INT_CLEAR_CMD, status);
>>>>>>
>>>>>> - if (priv->disable_err_irq)
>>>>>> + if (priv->disable_err_irq) {
>>>>>> + /* Turn off interrupts to avoid interrupt storm */
>>>>>> + gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
>>>>>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
>>>>>> + }
>>>>>>
>>>>>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
>>>>>> a6xx_fault_detect_irq(gpu);
>>>>>> diff --git a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>>>>>> index 9e44fd1ae634..0f6fd35bd587 100644
>>>>>> --- a/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>>>>>> +++ b/drivers/gpu/drm/msm/adreno/a8xx_gpu.c
>>>>>> @@ -1211,8 +1211,11 @@ irqreturn_t a8xx_irq(struct msm_gpu *gpu)
>>>>>>
>>>>>> gpu_write(gpu, REG_A8XX_RBBM_INT_CLEAR_CMD, status);
>>>>>>
>>>>>> - if (priv->disable_err_irq)
>>>>>> + if (priv->disable_err_irq) {
>>>>>> + /* Turn off interrupts to avoid interrupt storm */
>>>>>> + gpu_write(gpu, REG_A8XX_RBBM_INT_0_MASK, A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS);
>>>>>> status &= A6XX_RBBM_INT_0_MASK_CP_CACHE_FLUSH_TS;
>>>>>> + }
>>>>>>
>>>>>> if (status & A6XX_RBBM_INT_0_MASK_RBBM_HANG_DETECT)
>>>>>> a8xx_fault_detect_irq(gpu);
>>>>>> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
>>>>>> index 9ac7740a87f0..48ac51f4119b 100644
>>>>>> --- a/drivers/gpu/drm/msm/msm_gpu.c
>>>>>> +++ b/drivers/gpu/drm/msm/msm_gpu.c
>>>>>> @@ -552,6 +552,8 @@ static void recover_worker(struct kthread_work *work)
>>>>>> msm_update_fence(ring->fctx, fence);
>>>>>> }
>>>>>>
>>>>>> + priv->disable_err_irq = false;
>>>>>
>>>>> Ok, so we rely on recovery to re-enable the error irqs.. that is
>>>>> probably ok, given the intended purpose of the debugfs file. And,
>>>>> well, it is debugfs. But why do we clear disable_err_irq here?
>>>>
>>>> Now that we are updating the IRQ mask register which won't reset until
>>>> there is a gpu suspend, its side effect will be felt even after
>>>> userspace deasserts the debugfs knob, potentially into the next
>>>> testcase. This is different from the older behavior. So, I felt it would
>>>> be better to reset this flag during the recovery, considering
>>>> msm_recovery is the only user of this knob, afaiu.
>>>
>>> Hmm... maybe debugfs writes should just immediately update the irq
>>> mask (if the gpu is powered)?
>>
>> That needs some plumbing in adreno func table to program the register.
>> We can do that if you prefer that, but is it an overkill for this usecase?
>
> Yeah, that is why I didn't suggest it earlier. But stealth re-enable
> of err irqs makes the behavior harder to reason about, which I
> dislike. I guess it works now because msm_recovery only does a single
> hang-test w/ hw error irq's disabled. But from userspace PoV it seems
> natural to expect error irq's to remain disabled until writing debugfs
> again.
>
> Since it is about debugfs and a single igt test, maybe it is just best
> to document that this is how it works.
>
> Or, would it be reasonable just to update the irq mask in gpu->submit()?
IFPC complicates this a little bit. We need to vote OOB to keep the GX
domain up to program this register. And I am not sure if we have any
existing OOB bit that we can use for this purpose.
I feel this debugfs knob is not worth any additional complications in
the driver at the moment. We can consider improving this when more
usecases show up. For now, I feel it is better to just document the
modified behavior.
-Akhil
>
> BR,
> -R
>
>
>> -Akhil
>>
>>>
>>> BR,
>>> -R
>>>
>>>> I should have explicitly called out this new behavior of disable_err_irq
>>>> in the commit text, but I forgot.
>>>>
>>>> -Akhil.
>>>>
>>>>>
>>>>> BR,
>>>>> -R
>>>>>
>>>>>> +
>>>>>> gpu->funcs->recover(gpu);
>>>>>>
>>>>>> /* retire completed submits, plus the one that hung: */
>>>>>>
>>>>>> --
>>>>>> 2.51.0
>>>>>>
>>>>
>>
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2026-06-09 20:03 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04 20:08 [PATCH 0/6] drm/msm: Assorted fixes - June/26 Akhil P Oommen
2026-06-04 20:08 ` [PATCH 1/6] drm/msm/a6xx: Fix stale rpmh votes after suspend Akhil P Oommen
2026-06-05 13:09 ` Neil Armstrong
2026-06-06 12:04 ` Dmitry Baryshkov
2026-06-08 8:10 ` Konrad Dybcio
2026-06-04 20:08 ` [PATCH 2/6] drm/msm: Recover HW before retire hung submit Akhil P Oommen
2026-06-08 8:11 ` Konrad Dybcio
2026-06-04 20:08 ` [PATCH 3/6] drm/msm/a6xx: Fix A663 GPUCC register list for state capture Akhil P Oommen
2026-06-06 12:04 ` Dmitry Baryshkov
2026-06-04 20:08 ` [PATCH 4/6] drm/msm/a6xx: Fix A621 " Akhil P Oommen
2026-06-06 12:05 ` Dmitry Baryshkov
2026-06-04 20:08 ` [PATCH 5/6] drm/msm/a6xx: Fix IRQ storm during msm_recovery test Akhil P Oommen
2026-06-05 6:50 ` Rob Clark
2026-06-08 21:54 ` Akhil P Oommen
2026-06-09 0:20 ` Rob Clark
2026-06-09 13:08 ` Akhil P Oommen
2026-06-09 14:25 ` Rob Clark
2026-06-09 20:03 ` Akhil P Oommen
2026-06-04 20:08 ` [PATCH 6/6] drm/msm: Fix task_struct reference leak in recover_worker Akhil P Oommen
2026-06-08 8:16 ` Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome