[PATCH] drm/xe/vm: Use xe_vm_lock() helper for locking

Matthew Brost matthew.brost at intel.com
Tue Apr 23 17:12:24 UTC 2024


On Tue, Apr 23, 2024 at 07:35:41PM +0530, Nilawar, Badal wrote:
> 
> 
> On 23-04-2024 12:33, Himal Prasad Ghimiray wrote:
> > There is no change in functionality. Using the helper function
> > defined within the driver.
> > 
> > Cc: Matthew Brost <matthew.brost at intel.com>
> > Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>
> Not sure if Fixes: b06d47be7c83 ("drm/xe: Port Xe to GPUVA") need to be
> added here.

Most definitely not a fixes tag. It was correct in "Port Xe to GPUVA" to
use dma_resv_lock_interruptible as xe_vm_lock depended on VM being
fully initialized.

It wasn't until sometime later when dma-resv was moved to the GPUVM base
class this function is safe to call here.

> Otherwise looks good to me.

The patch is not complete. Replying to another message now with details.

Matt

> Reviewed-by: Badal Nilawar <badal.nilawar at intel.com>
> > ---
> >   drivers/gpu/drm/xe/xe_vm.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> > index 85d6f359142d..e9c8dc6d7b83 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;


More information about the Intel-xe mailing list