Re: [RFC PATCH 07/28] media: mali-vpu: implement TRY_FMT and S_FMT ioctls

From: Charvi Mehta

Date: Wed Nov 25 2026 - 07:37:52 EST



On 11/24/26 17:39, Nicolas Dufresne wrote:
This is suspicious, the vb queue already do some locking in most of the vidioc
call.
Both queues assign `&sess->vq_lock` to `vb2_queue::lock`, but
`video_device::lock`
is unset. The V4L2 core acquires it for queue-management ioctls marked
INFO_FL_QUEUE, but not for G_FMT, TRY_FMT or S_FMT.

video_device::lock is unset, as this driver uses per-session locking and
format ioctls are not required to be serialized among different sessions.
The explicit locks therefore protect format access against queue operations
and asynchronous firmware updates, which use the same mutex. They do not
reacquire a lock already held by the ioctl core.
I missed that in the review, please document carefully your locking somewhere in
text.
The session mutex is already documented in mali-vpu-session.h. I’ll expand
that description to cover format state and asynchronous firmware updates.

Regards,
Charvi