diff options
author | Philip Yang <Philip.Yang@amd.com> | 2024-08-02 11:28:45 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-08-13 10:43:16 -0400 |
commit | a1fc9f584c4aaf8bc1ebfa459fc57a3f26a290d8 (patch) | |
tree | 92f73c1a86f4892b86270f03f518285bae2d2360 /drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | |
parent | 70f83e7706e57200edb8ffa36883b2f43d214142 (diff) |
drm/amdkfd: Handle queue destroy buffer access race
Add helper function kfd_queue_unreference_buffers to reduce queue buffer
refcount, separate it from release queue buffers.
Because it is circular locking to hold dqm_lock to take vm lock,
kfd_ioctl_destroy_queue should take vm lock, unreference queue buffers
first, but not release queue buffers, to handle error in case failed to
hold vm lock. Then hold dqm_lock to remove queue from queue list and
then release queue buffers.
Restore process worker restore queue hold dqm_lock, will always find
the queue with valid queue buffers.
v2 (Felix):
- renamed kfd_queue_unreference_buffer(s) to kfd_queue_unref_bo_va(s)
- added two FIXME comments for follow up
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c')
0 files changed, 0 insertions, 0 deletions