[PATCH 4/4] drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c

Alex Deucher alexdeucher at gmail.com
Tue Mar 13 15:55:44 UTC 2018


On Mon, Mar 12, 2018 at 8:34 AM, Rex Zhu <Rex.Zhu at amd.com> wrote:
> make it symmetric with the init bo in amd_powerplay.c
>
> refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20"
>
> Change-Id: I0bca00fa2a376cf6539b046eefff2ca3d30c3cae
> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>


Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    | 3 ---
>  drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 7 ++++++-
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index d60ecc5..9aa726e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1485,9 +1485,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
>         }
>
>         for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
> -               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC &&
> -                       adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
> -                       amdgpu_ucode_fini_bo(adev);
>                 if (!adev->ip_blocks[i].status.hw)
>                         continue;
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> index a5bc52c..ed480db 100644
> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
> @@ -201,7 +201,12 @@ static int pp_late_init(void *handle)
>
>  static void pp_late_fini(void *handle)
>  {
> -       amd_powerplay_destroy(handle);
> +       struct amdgpu_device *adev = handle;
> +
> +       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
> +               amdgpu_ucode_fini_bo(adev);
> +
> +       amd_powerplay_destroy(adev);
>  }
>
>
> --
> 1.9.1
>
> _______________________________________________
> 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