Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu/userq: unpin and unref doorbell and wptr outside mutex

In amdgpu_userq_destroy once unmap_helpder is called within mutex
there is no need to hold mutex.

This helps in avoiding a deadlock between doorbell and wptr ww mutex
and we could unpin and unref these bos outside mutex safely.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sunil Khatri and committed by
Alex Deucher
b250a43b d3a9fe45

+5 -5
+5 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
··· 444 444 queue->fence_drv = NULL; 445 445 queue->userq_mgr = NULL; 446 446 list_del(&queue->userq_va_list); 447 - kfree(queue); 448 447 449 448 up_read(&adev->reset_domain->sem); 450 449 } ··· 649 650 queue->state = AMDGPU_USERQ_STATE_HUNG; 650 651 } 651 652 653 + atomic_dec(&uq_mgr->userq_count[queue->queue_type]); 654 + amdgpu_userq_cleanup(queue); 655 + mutex_unlock(&uq_mgr->userq_mutex); 656 + 652 657 amdgpu_bo_reserve(queue->db_obj.obj, true); 653 658 amdgpu_bo_unpin(queue->db_obj.obj); 654 659 amdgpu_bo_unreserve(queue->db_obj.obj); ··· 662 659 amdgpu_bo_unpin(queue->wptr_obj.obj); 663 660 amdgpu_bo_unreserve(queue->wptr_obj.obj); 664 661 amdgpu_bo_unref(&queue->wptr_obj.obj); 662 + kfree(queue); 665 663 666 - atomic_dec(&uq_mgr->userq_count[queue->queue_type]); 667 - 668 - amdgpu_userq_cleanup(queue); 669 - mutex_unlock(&uq_mgr->userq_mutex); 670 664 pm_runtime_put_autosuspend(adev_to_drm(adev)->dev); 671 665 672 666 return r;