Skip to content

Commit 0a5f49c

Browse files
PhilipYangAalexdeucher
authored andcommitted
drm/amdgpu: use spin_lock_irqsave to protect vm_manager.pasid_idr
amdgpu_vm_get_task_info is called from interrupt handler and sched timeout workqueue, we should use irq version spin_lock to avoid deadlock. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 7e4545d commit 0a5f49c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,14 +3363,15 @@ void amdgpu_vm_get_task_info(struct amdgpu_device *adev, unsigned int pasid,
33633363
struct amdgpu_task_info *task_info)
33643364
{
33653365
struct amdgpu_vm *vm;
3366+
unsigned long flags;
33663367

3367-
spin_lock(&adev->vm_manager.pasid_lock);
3368+
spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags);
33683369

33693370
vm = idr_find(&adev->vm_manager.pasid_idr, pasid);
33703371
if (vm)
33713372
*task_info = vm->task_info;
33723373

3373-
spin_unlock(&adev->vm_manager.pasid_lock);
3374+
spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags);
33743375
}
33753376

33763377
/**

0 commit comments

Comments
 (0)