Skip to content

drm/amdgpu/userq: fix a leaked fence driver and an unlocked doorbell walk

Junrui Luo amd-gfx b4-sent dri-devel linux-media lkml stable 1 version In review

Get series with b4
b4 am [email protected] change-id 20260816-amdgpu-fixes-18d9598a85ca

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/amdgpu/userq: cancel linked fences on fence driver freedrivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c+46 -250 replies
2/2drm/amdgpu/userq: hold the doorbell xa lock during hang resetdrivers/gpu/drm/amd/amdgpu/mes_userqueue.c+11 -23 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] drm/amdgpu/userq: fix a leaked fence driver and an unlocked doorbell walk

Patch 1 cancels the fences still linked on a queue's fence driver when the queue goes away. Each of them holds a reference on the driver, so its refcount never reaches zero and the seq64 slot stays allocated for the lifetime of the device.

Patch 2 holds xa_lock_irqsave() across the doorbell xarray walk in mes_userq_detect_and_reset(). That xarray is device wide, so the walk dereferences queues owned by other drm_files, and nothing keeps them alive for its duration.

---
Junrui Luo (2):
drm/amdgpu/userq: cancel linked fences on fence driver free drm/amdgpu/userq: hold the doorbell xa lock during hang reset

 drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 71 ++++++++++++++++---------
 drivers/gpu/drm/amd/amdgpu/mes_userqueue.c      | 13 ++++-
 2 files changed, 57 insertions(+), 27 deletions(-)

---
base-commit: f5bbbfec59b4e2fb7520a91de3df8a6174325d6a
change-id: 20260816-amdgpu-fixes-18d9598a85ca

Best regards,

Signature · 1 line
Junrui Luo <[email protected]>