]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/msm/a6xx: Correct OOB usage
authorAkhil P Oommen <akhilpo@oss.qualcomm.com>
Fri, 27 Mar 2026 00:13:53 +0000 (05:43 +0530)
committerRob Clark <robin.clark@oss.qualcomm.com>
Tue, 31 Mar 2026 20:47:29 +0000 (13:47 -0700)
During the GMU resume sequence, using another OOB other than OOB_GPU may
confuse the internal state of GMU firmware. To align more strictly with
the downstream sequence, move the sysprof related OOB setup after the
OOB_GPU is cleared.

Fixes: 62cd0fa6990b ("drm/msm/adreno: Disable IFPC when sysprof is active")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/714659/
Message-ID: <20260327-a8xx-gpu-batch2-v2-4-2b53c38d2101@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
drivers/gpu/drm/msm/adreno/a6xx_gmu.c
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
drivers/gpu/drm/msm/adreno/a8xx_gpu.c

index 9662201cd2e9d075425ac98bfa7c60989d00337d..690d3e53e27384dac094448f731e0c71f91804bc 100644 (file)
@@ -1236,11 +1236,6 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
        /* Set the GPU to the current freq */
        a6xx_gmu_set_initial_freq(gpu, gmu);
 
-       if (refcount_read(&gpu->sysprof_active) > 1) {
-               ret = a6xx_gmu_set_oob(gmu, GMU_OOB_PERFCOUNTER_SET);
-               if (!ret)
-                       set_bit(GMU_STATUS_OOB_PERF_SET, &gmu->status);
-       }
 out:
        /* On failure, shut down the GMU to leave it in a good state */
        if (ret) {
index 29cbebbb46cb7325caa4fc437e5e31b05de6fb4a..ae1d418ed0ab5b85a93c432e5ed3918c7e16a35c 100644 (file)
@@ -1605,6 +1605,12 @@ out:
                a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_BOOT_SLUMBER);
        }
 
+       if (!ret && (refcount_read(&gpu->sysprof_active) > 1)) {
+               ret = a6xx_gmu_set_oob(gmu, GMU_OOB_PERFCOUNTER_SET);
+               if (!ret)
+                       set_bit(GMU_STATUS_OOB_PERF_SET, &gmu->status);
+       }
+
        return ret;
 }
 
index 07bc4747caad1a70e164b94f302f5a4e9b93485f..d5c547d347e248dbac941824b8142a36d662c979 100644 (file)
@@ -721,6 +721,12 @@ out:
         */
        a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_GPU_SET);
 
+       if (!ret && (refcount_read(&gpu->sysprof_active) > 1)) {
+               ret = a6xx_gmu_set_oob(gmu, GMU_OOB_PERFCOUNTER_SET);
+               if (!ret)
+                       set_bit(GMU_STATUS_OOB_PERF_SET, &gmu->status);
+       }
+
        return ret;
 }