OSDN Git Service

drm/msm: Turn off hardware clock gating before reading A5XX registers
authorJordan Crouse <jcrouse@codeaurora.org>
Thu, 27 Jul 2017 16:42:32 +0000 (10:42 -0600)
committerRob Clark <robdclark@gmail.com>
Tue, 1 Aug 2017 23:10:53 +0000 (19:10 -0400)
On A5XX GPU hardware clock gating needs to be turned off before
reading certain GPU registers via AHB. Turn off HWCG before calling
adreno_show() to safely dump all the registers without a system hang.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/a5xx_gpu.c

index c1f8c20..33763b0 100644 (file)
@@ -995,7 +995,14 @@ static void a5xx_show(struct msm_gpu *gpu, struct seq_file *m)
 {
        seq_printf(m, "status:   %08x\n",
                        gpu_read(gpu, REG_A5XX_RBBM_STATUS));
+
+       /*
+        * Temporarily disable hardware clock gating before going into
+        * adreno_show to avoid issues while reading the registers
+        */
+       a5xx_set_hwcg(gpu, false);
        adreno_show(gpu, m);
+       a5xx_set_hwcg(gpu, true);
 }
 #endif