Skip to contentSkip to conversation

drm/msm/a6xx: fix frequency not always being restored on GMU resume

PATCH RESEND In review Jonathan Marek 2 participants 2 messages Aug 13, 2020 – Aug 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drm/msm/a6xx: fix frequency not always being restored on GMU resume

The patch reorganizing the set_freq function made it so the gmu resume doesn't always set the frequency, because a6xx_gmu_set_freq() exits early when the frequency hasn't been changed. Note this always happens when resuming GMU after recovering from a hang.

Use a simple workaround to prevent this from happening.

Fixes 1f60d11423db ("drm: msm: a6xx: send opp instead of a frequency")
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -0
index b67b38c8fadf..bbbd00020f92 100644
@@ -845,6 +845,7 @@ static void a6xx_gmu_set_initial_freq(struct msm_gpu *gpu, struct a6xx_gmu *gmu)
 	if (IS_ERR_OR_NULL(gpu_opp))
 		return;
 
+	gmu->freq = 0; /* so a6xx_gmu_set_freq() doesn't exit early */
 	a6xx_gmu_set_freq(gpu, gpu_opp);
 	dev_pm_opp_put(gpu_opp);
 }
Signature · 1 line
2.26.1
#1 lore raw

Why don't we move the early return in a6xx_gmu_set_freq() to msm_devfreq_target() instead?

-Akhil.

Quoted 20 lines · Jonathan Marek

The patch reorganizing the set_freq function made it so the gmu resume doesn't always set the frequency, because a6xx_gmu_set_freq() exits early when the frequency hasn't been changed. Note this always happens when resuming GMU after recovering from a hang.

Use a simple workaround to prevent this from happening.

Fixes 1f60d11423db ("drm: msm: a6xx: send opp instead of a frequency")
---
  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index b67b38c8fadf..bbbd00020f92 100644

drivers/gpu/drm/msm/adreno/a6xx_gmu.c static void a6xx_gmu_set_initial_freq(struct msm_gpu *gpu, struct a6xx_gmu *gmu) · line 851

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -0
@@ -845,6 +845,7 @@ static void a6xx_gmu_set_initial_freq(struct msm_gpu *gpu, struct a6xx_gmu *gmu)
  	if (IS_ERR_OR_NULL(gpu_opp))
  		return;
 
+	gmu->freq = 0; /* so a6xx_gmu_set_freq() doesn't exit early */
  	a6xx_gmu_set_freq(gpu, gpu_opp);
  	dev_pm_opp_put(gpu_opp);
  }

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel