[PATCH 3/3] drm/amdgpu: move iommu_resume before ip init/resume

Felix Kuehling felix.kuehling at amd.com
Tue Sep 7 16:48:51 UTC 2021


Am 2021-09-07 um 12:07 p.m. schrieb James Zhu:
> Separate iommu_resume from kfd_resume, and move it before
> other amdgpu ip init/resume.
>
> Fixed Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211277
I think the change is OK. But I don't understand how the IOMMUv2
initialization sequence could affect a crash in DM. The display should
not depend on IOMMUv2 at all. What am I missing?

Regards,
  Felix


>
> Signed-off-by: James Zhu <James.Zhu at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 653bd8f..e3f0308 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2393,6 +2393,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
>  	if (r)
>  		goto init_failed;
>  
> +	r = amdgpu_amdkfd_resume_iommu(adev);
> +	if (r)
> +		goto init_failed;
> +
>  	r = amdgpu_device_ip_hw_init_phase1(adev);
>  	if (r)
>  		goto init_failed;
> @@ -3147,6 +3151,10 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
>  {
>  	int r;
>  
> +	r = amdgpu_amdkfd_resume_iommu(adev);
> +	if (r)
> +		return r;
> +
>  	r = amdgpu_device_ip_resume_phase1(adev);
>  	if (r)
>  		return r;
> @@ -4602,6 +4610,10 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
>  				dev_warn(tmp_adev->dev, "asic atom init failed!");
>  			} else {
>  				dev_info(tmp_adev->dev, "GPU reset succeeded, trying to resume\n");
> +				r = amdgpu_amdkfd_resume_iommu(tmp_adev);
> +				if (r)
> +					goto out;
> +
>  				r = amdgpu_device_ip_resume_phase1(tmp_adev);
>  				if (r)
>  					goto out;


More information about the amd-gfx mailing list