* [PATCH v2] drm/msm: preemption aware hangcheck
@ 2026-10-29 18:41 Anna Maniscalco
2026-10-30 15:24 ` kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: Anna Maniscalco @ 2026-10-29 18:41 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Dmitry Baryshkov,
Abhinav Kumar, Marijn Suijten, David Airlie, Simona Vetter,
Jessica Zhang
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel,
Anna Maniscalco, Akhil P Oommen, Jessica Zhang
Rework hangcheck code to work well toghether with preemption.
Track the time a job has spent in a ring by storing timestamps of the
`CP_ALWAYS_ON_CONTEXT` register at the beginning of a job and when
switching rings as well as reading it back if the ring is currently
active.
Signed-off-by: Anna Maniscalco <anna.maniscalco2000@gmail.com>
---
Ever since we added support for preemption hangcheck has been somewhat
broken as it is not aware of multiple rings.
In some cases it might not recognize that one ring is stuck if the gpu
switches in and out of it.
---
Changes in v2:
- Various fixes
- Fix interaction with IFPC by using OOB vote
- Link to v1: https://lore.kernel.org/r/20250911-preemption_aware_hangcheck-v1-0-974819876819@gmail.com
To: Rob Clark <robin.clark@oss.qualcomm.com>
To: Sean Paul <sean@poorly.run>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Akhil P Oommen <akhilpo@oss.qualcomm.com>
To: Dmitry Baryshkov <lumag@kernel.org>
To: Abhinav Kumar <abhinav.kumar@linux.dev>
To: Jessica Zhang <jesszhan0024@gmail.com>
To: Marijn Suijten <marijn.suijten@somainline.org>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
Cc: linux-arm-msm@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
---
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 5 +--
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +---
drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 55 ++++++++++++++++++++++++-----
drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 +
drivers/gpu/drm/msm/adreno/a6xx_preempt.c | 28 ++++++++++-----
drivers/gpu/drm/msm/adreno/adreno_gpu.c | 3 +-
drivers/gpu/drm/msm/msm_gpu.c | 57 ++++++++++++++++++++++++-------
drivers/gpu/drm/msm/msm_gpu.h | 11 ++++++
drivers/gpu/drm/msm/msm_ringbuffer.h | 10 ++++++
9 files changed, 137 insertions(+), 39 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index 16c7335c4b1f..8800352455df 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -1251,10 +1251,7 @@ static void a5xx_fault_detect_irq(struct msm_gpu *gpu)
gpu_read64(gpu, REG_A5XX_CP_IB2_BASE),
gpu_read(gpu, REG_A5XX_CP_IB2_BUFSZ));
- /* Turn off the hangcheck timer to keep it from bothering us */
- timer_delete(&gpu->hangcheck_timer);
-
- kthread_queue_work(gpu->worker, &gpu->recover_work);
+ msm_trigger_recovery(gpu);
}
#define RBBM_ERROR_MASK \
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 662f09bec9d5..7efcb8de67ba 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -28,11 +28,7 @@ static void a6xx_gmu_fault(struct a6xx_gmu *gmu)
/* FIXME: add a banner here */
gmu->hung = true;
- /* Turn off the hangcheck timer while we are resetting */
- timer_delete(&gpu->hangcheck_timer);
-
- /* Queue the GPU handler because we need to treat this as a recovery */
- kthread_queue_work(gpu->worker, &gpu->recover_work);
+ msm_trigger_recovery(gpu);
}
static irqreturn_t a6xx_gmu_irq(int irq, void *data)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 92e8c8abb86d..bcb177a99c67 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -519,6 +519,9 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
get_stats_counter(ring, rbbm_perfctr_cp0, rbmemptr_stats(ring, index, cpcycles_start));
get_stats_counter(ring, cp_always_on_context, rbmemptr_stats(ring, index, alwayson_start));
+ get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_CONTEXT,
+ rbmemptr(ring, last_job_start_ctx));
+
OUT_PKT7(ring, CP_THREAD_CONTROL, 1);
OUT_RING(ring, CP_SET_THREAD_BOTH);
@@ -1842,13 +1845,10 @@ static void a6xx_fault_detect_irq(struct msm_gpu *gpu)
gpu_read64(gpu, REG_A6XX_CP_IB2_BASE),
gpu_read(gpu, REG_A6XX_CP_IB2_REM_SIZE));
- /* Turn off the hangcheck timer to keep it from bothering us */
- timer_delete(&gpu->hangcheck_timer);
-
/* Turn off interrupts to avoid triggering recovery again */
gpu_write(gpu, REG_A6XX_RBBM_INT_0_MASK, 0);
- kthread_queue_work(gpu->worker, &gpu->recover_work);
+ msm_trigger_recovery(gpu);
}
static void a7xx_sw_fuse_violation_irq(struct msm_gpu *gpu)
@@ -1865,11 +1865,8 @@ static void a7xx_sw_fuse_violation_irq(struct msm_gpu *gpu)
* to legacy blending.
*/
if (status & (A7XX_CX_MISC_SW_FUSE_VALUE_RAYTRACING |
- A7XX_CX_MISC_SW_FUSE_VALUE_LPAC)) {
- timer_delete(&gpu->hangcheck_timer);
-
- kthread_queue_work(gpu->worker, &gpu->recover_work);
- }
+ A7XX_CX_MISC_SW_FUSE_VALUE_LPAC))
+ msm_trigger_recovery(gpu);
}
static void a6xx_gpu_keepalive_vote(struct msm_gpu *gpu, bool on)
@@ -2297,6 +2294,43 @@ static u64 a6xx_get_timestamp(struct msm_gpu *gpu)
return gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER);
}
+static int a6xx_get_ctx_timestamp(struct msm_ringbuffer *ring, uint64_t *value)
+{
+ struct msm_gpu *gpu = ring->gpu;
+ struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
+ struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
+ int ret = 0;
+
+ /* Inhibit IFPC while accessing registers: */
+ if (gpu->funcs->sysprof_setup)
+ gpu->funcs->sysprof_setup(gpu, true);
+
+ /*
+ * a6xx_gmu_set_oob cannot be called while holding a spinlock.
+ * Limit the scope.
+ */
+ {
+ guard(spinlock_irqsave)(&a6xx_gpu->eval_lock);
+
+ /*
+ * Make sure the GMU keeps the GPU on while we read the register
+ *
+ * This should normally not be waking up the gpu since the
+ * hangcheck timer shouldn't fire when the gpu is idle.
+ */
+ if (a6xx_in_preempt(a6xx_gpu) || ring != a6xx_gpu->cur_ring)
+ return -EBUSY;
+
+ *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_CONTEXT);
+ }
+
+ /* Re-enable IFPC: */
+ if (gpu->funcs->sysprof_setup)
+ gpu->funcs->sysprof_setup(gpu, false);
+
+ return ret;
+}
+
static struct msm_ringbuffer *a6xx_active_ring(struct msm_gpu *gpu)
{
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
@@ -2825,6 +2859,7 @@ const struct adreno_gpu_funcs a6xx_gpu_funcs = {
.progress = a6xx_progress,
.sysprof_setup = a6xx_gmu_sysprof_setup,
.perfcntr_configure = a6xx_perfcntr_configure,
+ .get_ctx_timestamp = a6xx_get_ctx_timestamp,
},
.init = a6xx_gpu_init,
.get_timestamp = a6xx_gmu_get_timestamp,
@@ -2859,6 +2894,7 @@ const struct adreno_gpu_funcs a6xx_gmuwrapper_funcs = {
.get_rptr = a6xx_get_rptr,
.progress = a6xx_progress,
.perfcntr_configure = a6xx_perfcntr_configure,
+ .get_ctx_timestamp = a6xx_get_ctx_timestamp,
},
.init = a6xx_gpu_init,
.get_timestamp = a6xx_get_timestamp,
@@ -2896,6 +2932,7 @@ const struct adreno_gpu_funcs a7xx_gpu_funcs = {
.progress = a6xx_progress,
.sysprof_setup = a6xx_gmu_sysprof_setup,
.perfcntr_configure = a6xx_perfcntr_configure,
+ .get_ctx_timestamp = a6xx_get_ctx_timestamp,
},
.init = a6xx_gpu_init,
.get_timestamp = a6xx_gmu_get_timestamp,
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h
index 79912a33e17c..0aec2e825090 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h
@@ -105,6 +105,7 @@ struct a6xx_gpu {
struct drm_gem_object *preempt_postamble_bo;
void *preempt_postamble_ptr;
uint64_t preempt_postamble_iova;
+ uint64_t preempt_postamble_cntreset_end;
uint64_t preempt_postamble_len;
bool postamble_enabled;
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_preempt.c b/drivers/gpu/drm/msm/adreno/a6xx_preempt.c
index 1e599d4ddea1..263fec8e6e9b 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_preempt.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_preempt.c
@@ -20,15 +20,18 @@ static void a6xx_preempt_timer(struct timer_list *t)
if (!try_preempt_state(a6xx_gpu, PREEMPT_TRIGGERED, PREEMPT_FAULTED))
return;
- dev_err(dev->dev, "%s: preemption timed out\n", gpu->name);
- kthread_queue_work(gpu->worker, &gpu->recover_work);
+ msm_trigger_recovery(gpu);
}
-static void preempt_prepare_postamble(struct a6xx_gpu *a6xx_gpu)
+static void preempt_prepare_postamble(struct a6xx_gpu *a6xx_gpu, struct msm_ringbuffer *ring)
{
u32 *postamble = a6xx_gpu->preempt_postamble_ptr;
+ uint64_t last_active_ctxcycles;
u32 count = 0;
+ if (ring)
+ last_active_ctxcycles = rbmemptr(ring, last_active_ctxcycles);
+
postamble[count++] = PKT7(CP_REG_RMW, 3);
postamble[count++] = REG_A6XX_RBBM_PERFCTR_SRAM_INIT_CMD;
postamble[count++] = 0;
@@ -43,6 +46,15 @@ static void preempt_prepare_postamble(struct a6xx_gpu *a6xx_gpu)
postamble[count++] = CP_WAIT_REG_MEM_4_MASK(0x1);
postamble[count++] = CP_WAIT_REG_MEM_5_DELAY_LOOP_CYCLES(0);
+ a6xx_gpu->preempt_postamble_cntreset_end = count;
+
+ postamble[count++] = PKT7(ring ? CP_REG_TO_MEM : CP_NOP, 3);
+ postamble[count++] = CP_REG_TO_MEM_0_REG(REG_A6XX_CP_ALWAYS_ON_CONTEXT) |
+ CP_REG_TO_MEM_0_CNT(2) |
+ CP_REG_TO_MEM_0_IS_64B;
+ postamble[count++] = lower_32_bits(last_active_ctxcycles);
+ postamble[count++] = upper_32_bits(last_active_ctxcycles);
+
a6xx_gpu->preempt_postamble_len = count;
a6xx_gpu->postamble_enabled = true;
@@ -54,9 +66,9 @@ static void preempt_disable_postamble(struct a6xx_gpu *a6xx_gpu)
/*
* Disable the postamble by replacing the first packet header with a NOP
- * that covers the whole buffer.
+ * that skips the counters reset part.
*/
- *postamble = PKT7(CP_NOP, (a6xx_gpu->preempt_postamble_len - 1));
+ *postamble = PKT7(CP_NOP, (a6xx_gpu->preempt_postamble_cntreset_end - 1));
a6xx_gpu->postamble_enabled = false;
}
@@ -263,8 +275,8 @@ void a6xx_preempt_trigger(struct msm_gpu *gpu)
/* Enable or disable postamble as needed */
sysprof = msm_gpu_sysprof_no_perfcntr_zap(gpu);
- if (!sysprof && !a6xx_gpu->postamble_enabled)
- preempt_prepare_postamble(a6xx_gpu);
+ if (!sysprof)
+ preempt_prepare_postamble(a6xx_gpu, ring);
if (sysprof && a6xx_gpu->postamble_enabled)
preempt_disable_postamble(a6xx_gpu);
@@ -382,7 +394,7 @@ void a6xx_preempt_init(struct msm_gpu *gpu)
if (IS_ERR(a6xx_gpu->preempt_postamble_ptr))
goto fail;
- preempt_prepare_postamble(a6xx_gpu);
+ preempt_prepare_postamble(a6xx_gpu, NULL);
timer_setup(&a6xx_gpu->preempt_timer, a6xx_preempt_timer, 0);
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index dadfe4c69438..9218fc567144 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -335,7 +335,8 @@ int adreno_fault_handler(struct msm_gpu *gpu, unsigned long iova, int flags,
struct msm_gpu_fault_info fault_info = {};
/* Turn off the hangcheck timer to keep it from bothering us */
- timer_delete(&gpu->hangcheck_timer);
+ for (int i = 0; i < gpu->nr_rings; i++)
+ timer_delete(&gpu->rb[i]->hangcheck_timer);
/* Let any concurrent GMU transactions know that the MMU may be
* blocked for a while and they should wait on us.
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 0c2c35636251..6417bef187b5 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -467,7 +467,9 @@ static void recover_worker(struct kthread_work *work)
struct drm_device *dev = gpu->dev;
struct msm_drm_private *priv = dev->dev_private;
struct msm_gem_submit *submit;
- struct msm_ringbuffer *cur_ring = gpu->funcs->active_ring(gpu);
+ struct msm_ringbuffer *cur_ring = gpu->hung_ring ?
+ gpu->hung_ring : gpu->funcs->active_ring(gpu);
+ gpu->hung_ring = NULL;
char *comm = NULL, *cmd = NULL;
unsigned int noreclaim_flag;
struct task_struct *task;
@@ -629,11 +631,11 @@ void msm_gpu_fault_crashstate_capture(struct msm_gpu *gpu, struct msm_gpu_fault_
mutex_unlock(&gpu->lock);
}
-static void hangcheck_timer_reset(struct msm_gpu *gpu)
+static void hangcheck_ring_timer_reset(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
{
struct msm_drm_private *priv = gpu->dev->dev_private;
- mod_timer(&gpu->hangcheck_timer,
- round_jiffies_up(jiffies + msecs_to_jiffies(priv->hangcheck_period)));
+ mod_timer(&ring->hangcheck_timer,
+ round_jiffies_up(jiffies + msecs_to_jiffies(priv->hangcheck_period)));
}
static bool made_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
@@ -651,11 +653,32 @@ static bool made_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
return true;
}
-static void hangcheck_handler(struct timer_list *t)
+static bool check_ring_timeout(struct msm_ringbuffer *ring, unsigned long timeout)
{
- struct msm_gpu *gpu = timer_container_of(gpu, t, hangcheck_timer);
+ struct msm_gpu *gpu = ring->gpu;
+ u64 start, end;
+ int ret;
+
+ if (!gpu->funcs->get_ctx_timestamp)
+ return !made_progress(gpu, ring);
+
+ start = ring->memptrs->last_job_start_ctx;
+
+ if (gpu->funcs->get_ctx_timestamp(ring, &end))
+ end = ring->memptrs->last_active_ctxcycles;
+
+ if (end >= start)
+ return (end - start) > timeout;
+ else
+ return false;
+}
+
+static void hangcheck_worker(struct kthread_work *work)
+{
+ struct msm_ringbuffer *ring = container_of(work, struct msm_ringbuffer, hangcheck_work);
+ struct msm_gpu *gpu = ring->gpu;
+ struct msm_drm_private *priv = gpu->dev->dev_private;
struct drm_device *dev = gpu->dev;
- struct msm_ringbuffer *ring = gpu->funcs->active_ring(gpu);
uint32_t fence = ring->memptrs->fence;
if (fence != ring->hangcheck_fence) {
@@ -663,7 +686,7 @@ static void hangcheck_handler(struct timer_list *t)
ring->hangcheck_fence = fence;
ring->hangcheck_progress_retries = 0;
} else if (fence_before(fence, ring->fctx->last_fence) &&
- !made_progress(gpu, ring)) {
+ check_ring_timeout(ring, priv->hangcheck_period * 192000)) {
/* no progress and not done.. hung! */
ring->hangcheck_fence = fence;
ring->hangcheck_progress_retries = 0;
@@ -674,17 +697,26 @@ static void hangcheck_handler(struct timer_list *t)
DRM_DEV_ERROR(dev->dev, "%s: submitted fence: %u\n",
gpu->name, ring->fctx->last_fence);
+ gpu->hung_ring = ring;
kthread_queue_work(gpu->worker, &gpu->recover_work);
}
/* if still more pending work, reset the hangcheck timer: */
if (fence_after(ring->fctx->last_fence, ring->hangcheck_fence))
- hangcheck_timer_reset(gpu);
+ hangcheck_ring_timer_reset(gpu, ring);
/* workaround for missing irq: */
msm_gpu_retire(gpu);
}
+static void hangcheck_handler(struct timer_list *t)
+{
+ struct msm_ringbuffer *ring = timer_container_of(ring, t, hangcheck_timer);
+ struct msm_gpu *gpu = ring->gpu;
+
+ kthread_queue_work(gpu->worker, &ring->hangcheck_work);
+}
+
/*
* Cmdstream submission/retirement:
*/
@@ -826,7 +858,7 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
submit->ring->cur_ctx_seqno = submit->queue->ctx->seqno;
pm_runtime_put(&gpu->pdev->dev);
- hangcheck_timer_reset(gpu);
+ hangcheck_ring_timer_reset(gpu, submit->ring);
}
/*
@@ -923,8 +955,6 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
if (funcs->progress)
priv->hangcheck_period /= 2;
- timer_setup(&gpu->hangcheck_timer, hangcheck_handler, 0);
-
/* Map registers: */
gpu->mmio = msm_ioremap(pdev, config->ioname);
if (IS_ERR(gpu->mmio)) {
@@ -1006,6 +1036,9 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
goto fail;
}
+ timer_setup(&gpu->rb[i]->hangcheck_timer, hangcheck_handler, 0);
+ kthread_init_work(&gpu->rb[i]->hangcheck_work, hangcheck_worker);
+
memptrs += sizeof(struct msm_rbmemptrs);
memptrs_iova += sizeof(struct msm_rbmemptrs);
}
diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h
index d27d54bdb7a7..98a64e18ab66 100644
--- a/drivers/gpu/drm/msm/msm_gpu.h
+++ b/drivers/gpu/drm/msm/msm_gpu.h
@@ -101,6 +101,7 @@ struct msm_gpu_funcs {
/* Flush perfcntrs before reading (optional): */
void (*perfcntr_flush)(struct msm_gpu *gpu);
+ int (*get_ctx_timestamp)(struct msm_ringbuffer *ring, uint64_t *value);
};
/* Additional state for iommu faults: */
@@ -241,6 +242,8 @@ struct msm_gpu {
/* work for handling GPU recovery: */
struct kthread_work recover_work;
+ struct msm_ringbuffer *hung_ring;
+
/** retire_event: notified when submits are retired: */
wait_queue_head_t retire_event;
@@ -794,6 +797,14 @@ static inline void msm_gpu_crashstate_put(struct msm_gpu *gpu)
mutex_unlock(&gpu->lock);
}
+static inline void msm_trigger_recovery(struct msm_gpu *gpu)
+{
+ for (int i = 0; i < gpu->nr_rings; i++)
+ timer_delete(&gpu->rb[i]->hangcheck_timer);
+
+ kthread_queue_work(gpu->worker, &gpu->recover_work);
+}
+
void msm_gpu_fault_crashstate_capture(struct msm_gpu *gpu, struct msm_gpu_fault_info *fault_info);
/*
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.h b/drivers/gpu/drm/msm/msm_ringbuffer.h
index 0bfb6b0f42fa..6209c2fd3e67 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.h
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.h
@@ -39,6 +39,9 @@ struct msm_rbmemptrs {
volatile u32 context_idr;
volatile u32 perfcntr_fence;
+
+ volatile u64 last_job_start_ctx;
+ volatile u64 last_active_ctxcycles;
};
struct msm_cp_state {
@@ -77,6 +80,13 @@ struct msm_ringbuffer {
uint64_t memptrs_iova;
struct msm_fence_context *fctx;
+ /* Hang and Inactivity Detection:
+ */
+ struct timer_list hangcheck_timer;
+
+ /* work for handling GPU hangcheck: */
+ struct kthread_work hangcheck_work;
+
/**
* hangcheck_progress_retries:
*
---
base-commit: d024361c631b3f020a26c07d683e5103404b0fbf
change-id: 20250911-preemption_aware_hangcheck-8b9b3708efcc
Best regards,
--
Anna Maniscalco <anna.maniscalco2000@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] drm/msm: preemption aware hangcheck
2026-10-29 18:41 [PATCH v2] drm/msm: preemption aware hangcheck Anna Maniscalco
@ 2026-10-30 15:24 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-10-30 15:24 UTC (permalink / raw)
To: Anna Maniscalco, Rob Clark, Sean Paul, Konrad Dybcio,
Dmitry Baryshkov, Abhinav Kumar, Marijn Suijten, David Airlie,
Simona Vetter, Jessica Zhang
Cc: llvm, oe-kbuild-all, linux-arm-msm, dri-devel, freedreno,
linux-kernel, Anna Maniscalco, Akhil P Oommen
Hi Anna,
kernel test robot noticed the following build warnings:
[auto build test WARNING on d024361c631b3f020a26c07d683e5103404b0fbf]
url: https://github.com/intel-lab-lkp/linux/commits/Anna-Maniscalco/drm-msm-preemption-aware-hangcheck/20261029-194101
base: d024361c631b3f020a26c07d683e5103404b0fbf
patch link: https://lore.kernel.org/r/20261029-preemption_aware_hangcheck-v2-1-be0056e1f02d%40gmail.com
patch subject: [PATCH v2] drm/msm: preemption aware hangcheck
config: arm-defconfig (https://download.01.org/0day-ci/archive/20261030/202610302317.4PKDvDwV-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project c2ea4440d4b64c148de4fdfca1fc2c437a0701e4)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261030/202610302317.4PKDvDwV-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610302317.4PKDvDwV-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/msm/msm_gpu.c:660:6: warning: unused variable 'ret' [-Wunused-variable]
660 | int ret;
| ^~~
1 warning generated.
--
>> drivers/gpu/drm/msm/adreno/a6xx_preempt.c:18:21: warning: unused variable 'dev' [-Wunused-variable]
18 | struct drm_device *dev = gpu->dev;
| ^~~
>> drivers/gpu/drm/msm/adreno/a6xx_preempt.c:32:6: warning: variable 'last_active_ctxcycles' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
32 | if (ring)
| ^~~~
drivers/gpu/drm/msm/adreno/a6xx_preempt.c:55:37: note: uninitialized use occurs here
55 | postamble[count++] = lower_32_bits(last_active_ctxcycles);
| ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/msm/adreno/a6xx_preempt.c:32:2: note: remove the 'if' if its condition is always true
32 | if (ring)
| ^~~~~~~~~
33 | last_active_ctxcycles = rbmemptr(ring, last_active_ctxcycles);
drivers/gpu/drm/msm/adreno/a6xx_preempt.c:29:32: note: initialize the variable 'last_active_ctxcycles' to silence this warning
29 | uint64_t last_active_ctxcycles;
| ^
| = 0
2 warnings generated.
vim +/ret +660 drivers/gpu/drm/msm/msm_gpu.c
655
656 static bool check_ring_timeout(struct msm_ringbuffer *ring, unsigned long timeout)
657 {
658 struct msm_gpu *gpu = ring->gpu;
659 u64 start, end;
> 660 int ret;
661
662 if (!gpu->funcs->get_ctx_timestamp)
663 return !made_progress(gpu, ring);
664
665 start = ring->memptrs->last_job_start_ctx;
666
667 if (gpu->funcs->get_ctx_timestamp(ring, &end))
668 end = ring->memptrs->last_active_ctxcycles;
669
670 if (end >= start)
671 return (end - start) > timeout;
672 else
673 return false;
674 }
675
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-30 15:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29 18:41 [PATCH v2] drm/msm: preemption aware hangcheck Anna Maniscalco
2026-10-30 15:24 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®