[PATCH] drm/amdgpu: Set CPER enabled flag after ring initiailized

Zhou1, Tao Tao.Zhou1 at amd.com
Tue Feb 25 02:20:32 UTC 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>

> -----Original Message-----
> From: Liu, Xiang(Dean) <Xiang.Liu at amd.com>
> Sent: Monday, February 24, 2025 11:02 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Zhou1, Tao
> <Tao.Zhou1 at amd.com>; Dong, Andy <Andy.Dong at amd.com>; Liu, Xiang(Dean)
> <Xiang.Liu at amd.com>
> Subject: [PATCH] drm/amdgpu: Set CPER enabled flag after ring initiailized
>
> Setting cper.enabled to be true only after cper ring is successfully created.
>
> Signed-off-by: Xiang Liu <xiang.liu at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
> index d57e6ba66c44..a39e7efe50b2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
> @@ -535,15 +535,23 @@ static int amdgpu_cper_ring_init(struct amdgpu_device
> *adev)
>
>  int amdgpu_cper_init(struct amdgpu_device *adev)  {
> +     int r;
> +
>       if (!amdgpu_aca_is_enabled(adev))
>               return 0;
>
> +     r = amdgpu_cper_ring_init(adev);
> +     if (r) {
> +             dev_err(adev->dev, "fail to initiailize cper ring, r = %d\n", r);
> +             return r;
> +     }
> +
>       mutex_init(&adev->cper.cper_lock);
>
>       adev->cper.enabled = true;
>       adev->cper.max_count = CPER_MAX_ALLOWED_COUNT;
>
> -     return amdgpu_cper_ring_init(adev);
> +     return 0;
>  }
>
>  int amdgpu_cper_fini(struct amdgpu_device *adev)
> --
> 2.34.1



More information about the amd-gfx mailing list