diff mbox series

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

Message ID 20200813185450.19387-1-jonathan@marek.ca (mailing list archive)
State New, archived
Headers show
Series [RESEND] drm/msm/a6xx: fix frequency not always being restored on GMU resume | expand

Commit Message

Jonathan Marek Aug. 13, 2020, 6:54 p.m. UTC
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")

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Akhil P Oommen Aug. 17, 2020, 12:51 p.m. UTC | #1
Why don't we move the early return in a6xx_gmu_set_freq() to 
msm_devfreq_target() instead?

-Akhil.

On 8/14/2020 12:24 AM, Jonathan Marek wrote:
> 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")
> 
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
>   drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index b67b38c8fadf..bbbd00020f92 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -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);
>   }
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index b67b38c8fadf..bbbd00020f92 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -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);
 }