Re: [PATCH v2 08/17] drm/msm/adreno: Coredump on GPU/GMU init failures

From: Akhil P Oommen

Date: Mon Mar 30 2026 - 16:58:28 EST


On 3/27/2026 5:05 PM, Konrad Dybcio wrote:
> On 3/27/26 1:13 AM, Akhil P Oommen wrote:
>> Capture coredump on GPU or GMU errors during initialization to help in
>> debugging the issues. To be consistent with the locks while calling
>> msm_gpu_crashstate_capture(), call pm_runtime_get(gpu) always with
>> msm_gpu->lock.
>>
>> Signed-off-by: Akhil P Oommen <akhilpo@xxxxxxxxxxxxxxxx>
>> ---
>
> [...]
>
>
>> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
>> @@ -391,10 +391,13 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx,
>> return 0;
>> case MSM_PARAM_TIMESTAMP:
>> if (adreno_gpu->funcs->get_timestamp) {
>> + mutex_lock(&gpu->lock);
>> pm_runtime_get_sync(&gpu->pdev->dev);
>> +
>> *value = adreno_gpu->funcs->get_timestamp(gpu);
>> - pm_runtime_put_autosuspend(&gpu->pdev->dev);
>>
>> + pm_runtime_put_autosuspend(&gpu->pdev->dev);
>> + mutex_unlock(&gpu->lock);
>
> This is something to take care of in a separate patch, but get_sync may
> fail and then the read could crash the device (GMU may be off too)
>
> put_autosuspend could theroetically fail too, but perhaps -edontcarethatmuch

Right. That is something we should fix everywhere separately.

-Akhil.

>
> Konrad