[PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Wed Apr 24 03:57:45 UTC 2024


On 24-04-2024 09:24, Matthew Brost wrote:
> On Wed, Apr 24, 2024 at 09:27:55AM +0530, Himal Prasad Ghimiray wrote:
>> There is no change in functionality. Using the helper function
>> defined within the driver.
>>
>> -v2
>> Use xe_vm_unlock() (Ashutosh/Matt)
>>
>> Reviewed-by: Badal Nilawar <badal.nilawar at intel.com>
>> Cc: Matthew Brost <matthew.brost at intel.com>
>> Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_vm.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
>> index 85d6f359142d..c350c561e7d9 100644
>> --- a/drivers/gpu/drm/xe/xe_vm.c
>> +++ b/drivers/gpu/drm/xe/xe_vm.c
>> @@ -1279,7 +1279,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
>>   
>>   	drm_gem_object_put(vm_resv_obj);
>>   
>> -	err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL);
>> +	err = xe_vm_lock(vm, true);
>>   	if (err)
>>   		goto err_close;
>>   
>> @@ -1323,7 +1323,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
>>   
>>   		xe_pt_populate_empty(tile, vm, vm->pt_root[id]);
>>   	}
>> -	dma_resv_unlock(xe_vm_resv(vm));
>> +	xe_vm_unlock(vm);
> There is another dma_resv_unlock below the label 'err_unlock_close' too.
>
> Matt


Thanks Matt, Addressing it in next version.


>
>>   
>>   	/* Kernel migration VM shouldn't have a circular loop.. */
>>   	if (!(flags & XE_VM_FLAG_MIGRATION)) {
>> -- 
>> 2.25.1
>>


More information about the Intel-xe mailing list