]> git.hungrycats.org Git - linux/commit
drm/amdgpu: reject mapping a reserved doorbell to a new queue
authorZhu Lingshan <lingshan.zhu@amd.com>
Wed, 24 Jun 2026 07:52:35 +0000 (15:52 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 15:28:50 +0000 (11:28 -0400)
commit6244eae22966350db52faf9c1369d3b2ffc5de4e
treead33dcee6fac5a7e1ef94b2cd4b05cb99568f59e
parent4a33d82e224c82e8f493b94b017b1466556db39e
drm/amdgpu: reject mapping a reserved doorbell to a new queue

When creating an user-queue, the user space
provides a doorbell BO handle and an offset within
the bo to obtain a doorbell.

However current implementation using xa_store_irq()
to store a doorbell, which allows a later queue created
with the same BO and offset parameters to overwrite an
existing queue and doorbell mapping.

This can cause problems like misrouting fence IRQ
processing to a wrong queue, and mislead the cleanup
process of one queue erasing the mapping of another queue.

This commit fixes this issue by replacing xa_store_irq with
xa_insert_irq, which rejects mapping a reserved
doorbell to a newly created queue

Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c