Commit 780668df authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Rob Clark

drm/msm/a5xx: add devcoredump support to the fault handler

Use adreno_fault_handler() to implement a5xx_fault_handler(). This
enables devcoredump support on a5xx platforms, allowing one to capture
the crashed GPU state at the time of context fault.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/522724/
Link: https://lore.kernel.org/r/20230214123504.3729522-4-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarRob Clark <robdclark@chromium.org>
parent f62ad0f6
...@@ -1096,16 +1096,19 @@ bool a5xx_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring) ...@@ -1096,16 +1096,19 @@ bool a5xx_idle(struct msm_gpu *gpu, struct msm_ringbuffer *ring)
static int a5xx_fault_handler(void *arg, unsigned long iova, int flags, void *data) static int a5xx_fault_handler(void *arg, unsigned long iova, int flags, void *data)
{ {
struct msm_gpu *gpu = arg; struct msm_gpu *gpu = arg;
pr_warn_ratelimited("*** gpu fault: iova=%08lx, flags=%d (%u,%u,%u,%u)\n", struct adreno_smmu_fault_info *info = data;
iova, flags, char block[12] = "unknown";
u32 scratch[] = {
gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(4)), gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(4)),
gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(5)), gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(5)),
gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(6)), gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(6)),
gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(7))); gpu_read(gpu, REG_A5XX_CP_SCRATCH_REG(7)),
};
gpu->aspace->mmu->funcs->resume_translation(gpu->aspace->mmu); if (info)
snprintf(block, sizeof(block), "%x", info->fsynr1);
return 0; return adreno_fault_handler(gpu, iova, flags, info, block, scratch);
} }
static void a5xx_cp_err_irq(struct msm_gpu *gpu) static void a5xx_cp_err_irq(struct msm_gpu *gpu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment