[PATCH 2/2] drm/amdgpu: Check late_init status before set cg/pg state

Alex Deucher alexdeucher at gmail.com
Thu Oct 4 03:41:59 UTC 2018


On Wed, Oct 3, 2018 at 6:56 AM Rex Zhu <Rex.Zhu at amd.com> wrote:
>
> Fix cg/pg unexpected set in hw init failed case.
>
> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>

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


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index eda3d1e..94c92f5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1656,7 +1656,7 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev,
>
>         for (j = 0; j < adev->num_ip_blocks; j++) {
>                 i = state == AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;
> -               if (!adev->ip_blocks[i].status.valid)
> +               if (!adev->ip_blocks[i].status.late_initialized)
>                         continue;
>                 /* skip CG for VCE/UVD, it's handled specially */
>                 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
> @@ -1686,7 +1686,7 @@ static int amdgpu_device_set_pg_state(struct amdgpu_device *adev, enum amd_power
>
>         for (j = 0; j < adev->num_ip_blocks; j++) {
>                 i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;
> -               if (!adev->ip_blocks[i].status.valid)
> +               if (!adev->ip_blocks[i].status.late_initialized)
>                         continue;
>                 /* skip CG for VCE/UVD, it's handled specially */
>                 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
> --
> 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