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/v3d: Remove dedicated fence_lock

Commit adefb2ccea1e ("drm/v3d: create a dedicated lock for dma fence")
split `fence_lock` from `queue_lock` because v3d_job_update_stats() was
taking `queue_lock` to protect `job->file_priv` during stats collection
in the IRQ handler. Using the same lock for both DMA fence signaling and
stats protection in a IRQ context caused issues on PREEMPT_RT.

Since then, the stats infrastructure has been reworked: v3d_stats is now
refcounted and jobs hold their own references to stats objects, so
v3d_job_update_stats() no longer takes `queue_lock` at all.

With the original reason for the split gone, merge `fence_lock` back
into `queue_lock` to simplify the locking scheme.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Link: https://patch.msgid.link/20260306-v3d-reset-locking-improv-v3-6-49864fe00692@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>

+1 -4
-2
drivers/gpu/drm/v3d/v3d_drv.h
··· 71 71 /* Currently active job for this queue */ 72 72 struct v3d_job *active_job; 73 73 spinlock_t queue_lock; 74 - /* Protect dma fence for signalling job completion */ 75 - spinlock_t fence_lock; 76 74 }; 77 75 78 76 /* Performance monitor object. The perform lifetime is controlled by userspace
+1 -1
drivers/gpu/drm/v3d/v3d_fence.c
··· 15 15 fence->dev = &v3d->drm; 16 16 fence->queue = q; 17 17 fence->seqno = ++queue->emit_seqno; 18 - dma_fence_init(&fence->base, &v3d_fence_ops, &queue->fence_lock, 18 + dma_fence_init(&fence->base, &v3d_fence_ops, &queue->queue_lock, 19 19 queue->fence_context, fence->seqno); 20 20 21 21 return &fence->base;
-1
drivers/gpu/drm/v3d/v3d_gem.c
··· 296 296 queue->fence_context = dma_fence_context_alloc(1); 297 297 298 298 spin_lock_init(&queue->queue_lock); 299 - spin_lock_init(&queue->fence_lock); 300 299 } 301 300 302 301 spin_lock_init(&v3d->mm_lock);