Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/a6xx: Fix hangcheck for IFPC

From the hangcheck handler, KMD checks a few registers in GX
domain to see if the GPU made any progress. But it cannot access
those registers when IFPC is enabled. Since HW based hang detection
is pretty decent, lets rely on it instead of these registers when
IFPC is enabled.

Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/673378/
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>

authored by

Akhil P Oommen and committed by
Rob Clark
a242ef4a 365075b7

+13 -2
+13 -2
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
··· 2420 2420 2421 2421 static bool a6xx_progress(struct msm_gpu *gpu, struct msm_ringbuffer *ring) 2422 2422 { 2423 - struct msm_cp_state cp_state = { 2423 + struct msm_cp_state cp_state; 2424 + bool progress; 2425 + 2426 + /* 2427 + * With IFPC, KMD doesn't know whether GX power domain is collapsed 2428 + * or not. So, we can't blindly read the below registers in GX domain. 2429 + * Lets trust the hang detection in HW and lie to the caller that 2430 + * there was progress. 2431 + */ 2432 + if (to_adreno_gpu(gpu)->info->quirks & ADRENO_QUIRK_IFPC) 2433 + return true; 2434 + 2435 + cp_state = (struct msm_cp_state) { 2424 2436 .ib1_base = gpu_read64(gpu, REG_A6XX_CP_IB1_BASE), 2425 2437 .ib2_base = gpu_read64(gpu, REG_A6XX_CP_IB2_BASE), 2426 2438 .ib1_rem = gpu_read(gpu, REG_A6XX_CP_IB1_REM_SIZE), 2427 2439 .ib2_rem = gpu_read(gpu, REG_A6XX_CP_IB2_REM_SIZE), 2428 2440 }; 2429 - bool progress; 2430 2441 2431 2442 /* 2432 2443 * Adjust the remaining data to account for what has already been