diff mbox series

[v1,07/10] drm/msm/adreno: Retry on gpu resume failure

Message ID 20220302225551.v1.7.I55e39e28375b64455d1605f67453d5e91b0c2710@changeid (mailing list archive)
State New, archived
Headers show
Series Support for GMU coredump and some related improvements | expand

Commit Message

Akhil P Oommen March 2, 2022, 5:27 p.m. UTC
Retry infinitely on resume failure because there is nothing much we can
do if GPU is not ON. Also, this helps us to avoid checking for the
return value of pm_runtime_get() to see if GPU is ON.

Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---

 drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

AngeloGioacchino Del Regno March 3, 2022, 9:21 a.m. UTC | #1
Il 02/03/22 18:27, Akhil P Oommen ha scritto:
> Retry infinitely on resume failure because there is nothing much we can
> do if GPU is not ON. Also, this helps us to avoid checking for the
> return value of pm_runtime_get() to see if GPU is ON.
> 
> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
> ---
> 
>   drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
> index 89cfd84..abcc553 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
> @@ -603,8 +603,16 @@ static const struct of_device_id dt_match[] = {
>   static int adreno_resume(struct device *dev)
>   {
>   	struct msm_gpu *gpu = dev_to_gpu(dev);
> +	int ret;
> +
> +	/* What hope do we have for the future if we can't turn ON gpu */

Hello Akhil,

the hope for the future would be to at least not lock up everything with
an infinite loop, so, please change this to have a limited amount of retries.

My guess would be that a maximum of 10 is already a lot of retries, but
feel free to choose an appropriate number.

Regards,
Angelo

> +	while (true) {
> +		ret = gpu->funcs->pm_resume(gpu);
> +		if (!ret)
> +			break;
> +	}
>   
> -	return gpu->funcs->pm_resume(gpu);
> +	return 0;
>   }
>   
>   static int active_submits(struct msm_gpu *gpu)
Akhil P Oommen March 4, 2022, 7:22 p.m. UTC | #2
On 3/3/2022 2:51 PM, AngeloGioacchino Del Regno wrote:
> Il 02/03/22 18:27, Akhil P Oommen ha scritto:
>> Retry infinitely on resume failure because there is nothing much we can
>> do if GPU is not ON. Also, this helps us to avoid checking for the
>> return value of pm_runtime_get() to see if GPU is ON.
>>
>> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
>> ---
>>
>>   drivers/gpu/drm/msm/adreno/adreno_device.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c 
>> b/drivers/gpu/drm/msm/adreno/adreno_device.c
>> index 89cfd84..abcc553 100644
>> --- a/drivers/gpu/drm/msm/adreno/adreno_device.c
>> +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
>> @@ -603,8 +603,16 @@ static const struct of_device_id dt_match[] = {
>>   static int adreno_resume(struct device *dev)
>>   {
>>       struct msm_gpu *gpu = dev_to_gpu(dev);
>> +    int ret;
>> +
>> +    /* What hope do we have for the future if we can't turn ON gpu */
>
> Hello Akhil,
>
> the hope for the future would be to at least not lock up everything with
> an infinite loop, so, please change this to have a limited amount of 
> retries.
>
> My guess would be that a maximum of 10 is already a lot of retries, but
> feel free to choose an appropriate number.

Thanks for the feedback, Angelo. I will revisit this.

-Akhil.
>
> Regards,
> Angelo
>
>> +    while (true) {
>> +        ret = gpu->funcs->pm_resume(gpu);
>> +        if (!ret)
>> +            break;
>> +    }
>>   -    return gpu->funcs->pm_resume(gpu);
>> +    return 0;
>>   }
>>     static int active_submits(struct msm_gpu *gpu)
>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 89cfd84..abcc553 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -603,8 +603,16 @@  static const struct of_device_id dt_match[] = {
 static int adreno_resume(struct device *dev)
 {
 	struct msm_gpu *gpu = dev_to_gpu(dev);
+	int ret;
+
+	/* What hope do we have for the future if we can't turn ON gpu */
+	while (true) {
+		ret = gpu->funcs->pm_resume(gpu);
+		if (!ret)
+			break;
+	}
 
-	return gpu->funcs->pm_resume(gpu);
+	return 0;
 }
 
 static int active_submits(struct msm_gpu *gpu)