[PATCH 1/2] drm/amdgpu: return EINVAL instead of ENOENT in the VM code

Christian König ckoenig.leichtzumerken at gmail.com
Wed Jan 22 18:52:25 UTC 2020


Am 22.01.20 um 19:11 schrieb Luben Tuikov:
> Do we have user-space/libs rely on this errno in particular?

No, userspace can't even directly call this function.

The problem was rather that during debugging I called the function with 
fixed parameters and wondered for quite a while why it can't find the 
table in the tree structure.

Turned out that the table was perfectly fine, but my parameters had a 0 
to much and so was outside of the valid range.

Regards,
Christian.

>
> On 2020-01-22 9:03 a.m., Christian König wrote:
>> That we can't find a PD above the root is expected can only happen if
>> we try to update a larger range than actually managed by the VM.
>>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 5cb182231f5d..8119f32ca94d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -1475,7 +1475,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
>>   			 * shift we should go up one level and check it again.
>>   			 */
>>   			if (!amdgpu_vm_pt_ancestor(&cursor))
>> -				return -ENOENT;
>> +				return -EINVAL;
>>   			continue;
>>   		}
>>   
>>



More information about the amd-gfx mailing list