[PATCH] drm/amdgpu/psp: move psp version specific function pointers to early_init

Lin, Amber Amber.Lin at amd.com
Sat May 11 21:28:35 UTC 2019


Reviewed-by: Amber Lin <Amber.Lin at amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Christian König
Sent: Thursday, May 9, 2019 10:25 AM
To: Alex Deucher <alexdeucher at gmail.com>; amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: Re: [PATCH] drm/amdgpu/psp: move psp version specific function pointers to early_init

Am 09.05.19 um 16:23 schrieb Alex Deucher:
> In case we need to use them for GPU reset prior initializing the asic.  
> Fixes a crash if the driver attempts to reset the GPU at driver load 
> time.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>

Acked-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 905cce1814f3..05897b05766b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -38,18 +38,10 @@ static void psp_set_funcs(struct amdgpu_device *adev);
>   static int psp_early_init(void *handle)
>   {
>       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> +     struct psp_context *psp = &adev->psp;
>
>       psp_set_funcs(adev);
>
> -     return 0;
> -}
> -
> -static int psp_sw_init(void *handle)
> -{
> -     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -     struct psp_context *psp = &adev->psp;
> -     int ret;
> -
>       switch (adev->asic_type) {
>       case CHIP_VEGA10:
>       case CHIP_VEGA12:
> @@ -67,6 +59,15 @@ static int psp_sw_init(void *handle)
>
>       psp->adev = adev;
>
> +     return 0;
> +}
> +
> +static int psp_sw_init(void *handle)
> +{
> +     struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> +     struct psp_context *psp = &adev->psp;
> +     int ret;
> +
>       ret = psp_init_microcode(psp);
>       if (ret) {
>               DRM_ERROR("Failed to load psp firmware!\n");

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list