[PATCH 2/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

James Zhu jamesz at amd.com
Wed Nov 3 16:27:20 UTC 2021


On 2021-11-02 11:53 p.m., Lazar, Lijo wrote:
>
>
> On 11/3/2021 12:53 AM, James Zhu wrote:
>> From: Yifan Zhang <yifan1.zhang at amd.com>
>>
>> When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2
>> init will fail. But this failure should not block amdgpu driver init.
>>
>> Reported-by: youling <youling257 at gmail.com>
>> Tested-by: youling <youling257 at gmail.com>
>> Signed-off-by: Yifan Zhang <yifan1.zhang at amd.com>
>> Reviewed-by: James Zhu <James.Zhu at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----
>>   drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++
>>   2 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index e56bc925afcf..f77823ce7ae8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -2398,10 +2398,6 @@ static int amdgpu_device_ip_init(struct 
>> amdgpu_device *adev)
>>       if (!adev->gmc.xgmi.pending_reset)
>>           amdgpu_amdkfd_device_init(adev);
>>   -    r = amdgpu_amdkfd_resume_iommu(adev);
>> -    if (r)
>> -        goto init_failed;
>> -
>>       amdgpu_fru_get_product_info(adev);
>>     init_failed:
>> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c 
>> b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
>> index be26c4016ade..7677ced16a27 100644
>> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
>> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
>> @@ -1031,6 +1031,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
>>         svm_migrate_init(kfd->adev);
>>   +    if(kgd2kfd_resume_iommu(kfd))
>> +        goto device_iommu_error;
>> +
>
> This also brings a duplicate iommu resume in the reset path -
> https://elixir.bootlin.com/linux/v5.15/source/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c#L4612 
>

[JZ] Hi Lijo, please help clarify this duplicate case.

Thanks!

James

>
> Thanks,
> Lijo
>>       if (kfd_resume(kfd))
>>           goto kfd_resume_error;
>>


More information about the amd-gfx mailing list