[PATCH] drm/amdgpu: use spin_lock_irqsave to protect vm_manager.pasid_idr

Christian König ckoenig.leichtzumerken at gmail.com
Thu Jan 31 14:58:59 UTC 2019


Am 31.01.19 um 15:25 schrieb Yang, Philip:
> amdgpu_vm_get_task_info is called from interrupt handler and sched timeout
> workqueue, so it is needed to use irq version spin_lock to avoid deadlock.
>
> Change-Id: Ifedd4b97535bf0b5d3936edd2d9688957020efd4

Good catch, but your signed-of-by line is missing.

With that fixed the patch is Reviewed-by: Christian König 
<christian.koenig at amd.com>

Regards,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 8f394a20a9eb..bfeb9007e100 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -3386,14 +3386,15 @@ void amdgpu_vm_get_task_info(struct amdgpu_device *adev, unsigned int pasid,
>   			 struct amdgpu_task_info *task_info)
>   {
>   	struct amdgpu_vm *vm;
> +	unsigned long flags;
>   
> -	spin_lock(&adev->vm_manager.pasid_lock);
> +	spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags);
>   
>   	vm = idr_find(&adev->vm_manager.pasid_idr, pasid);
>   	if (vm)
>   		*task_info = vm->task_info;
>   
> -	spin_unlock(&adev->vm_manager.pasid_lock);
> +	spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags);
>   }
>   
>   /**



More information about the amd-gfx mailing list