On Fri, Mar 27, 2026 at 6:40 AM Lijo Lazar <[email protected]> wrote:
>
> For a mode-1 reset done at the end of S4 on PSPv11 dGPUs, only check if
> TOS is unloaded.
>
> Fixes: 32f73741d6ee ("drm/amdgpu: Wait for bootloader after PSPv11 reset")
> Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/4853
>
> Signed-off-by: Lijo Lazar <[email protected]>

Reviewed-by: Alex Deucher <[email protected]>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++--
>  drivers/gpu/drm/amd/amdgpu/psp_v11_0.c  | 3 ++-
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index a44baa9ee78d..8ed637f92322 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2683,8 +2683,12 @@ static int amdgpu_pmops_freeze(struct device *dev)
>         if (r)
>                 return r;
>
> -       if (amdgpu_acpi_should_gpu_reset(adev))
> -               return amdgpu_asic_reset(adev);
> +       if (amdgpu_acpi_should_gpu_reset(adev)) {
> +               amdgpu_device_lock_reset_domain(adev->reset_domain);
> +               r = amdgpu_asic_reset(adev);
> +               amdgpu_device_unlock_reset_domain(adev->reset_domain);
> +               return r;
> +       }
>         return 0;
>  }
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c 
> b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> index 9aa988982304..fb7aaf5ae05c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> @@ -170,7 +170,8 @@ static int psp_v11_0_wait_for_bootloader(struct 
> psp_context *psp)
>         int retry_loop;
>
>         /* For a reset done at the end of S3, only wait for TOS to be 
> unloaded */
> -       if (adev->in_s3 && !(adev->flags & AMD_IS_APU) && 
> amdgpu_in_reset(adev))
> +       if ((adev->in_s4 || adev->in_s3) && !(adev->flags & AMD_IS_APU) &&
> +           amdgpu_in_reset(adev))
>                 return psp_v11_wait_for_tos_unload(psp);
>
>         for (retry_loop = 0; retry_loop < 20; retry_loop++) {
> --
> 2.49.0
>

Reply via email to