drm/amd/pm: no pptable resetup on runpm exiting
authorEvan Quan <evan.quan@amd.com>
Tue, 21 Feb 2023 07:21:19 +0000 (15:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Feb 2023 22:35:59 +0000 (17:35 -0500)
It is assumed the pptable used before runpm is same as
the one used afterwards. Thus, we can reuse the stored
copy and do not need to resetup the pptable again.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Feifei Xu <feifei.xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index 834d146..0652b00 100644 (file)
@@ -1202,10 +1202,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)
                return ret;
        }
 
-       ret = smu_setup_pptable(smu);
-       if (ret) {
-               dev_err(adev->dev, "Failed to setup pptable!\n");
-               return ret;
+       /*
+        * It is assumed the pptable used before runpm is same as
+        * the one used afterwards. Thus, we can reuse the stored
+        * copy and do not need to resetup the pptable again.
+        */
+       if (!adev->in_runpm) {
+               ret = smu_setup_pptable(smu);
+               if (ret) {
+                       dev_err(adev->dev, "Failed to setup pptable!\n");
+                       return ret;
+               }
        }
 
        /* smu_dump_pptable(smu); */