Skip to contentSkip to conversation

staging: most: video: document the locks in struct most_video_dev

PATCH In review Godana Emiru 2 participants 4 messages Sep 1 – Sep 7

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: most: video: document the locks in struct most_video_dev

Neither lock in struct most_video_dev carries a comment describing what it protects.

list_lock protects the pending_mbos list. Buffers are added by the component's rx_completion callback, comp_rx_data(), which is invoked from the interface driver's completion path (a URB completion handler in the case of the USB HDM), and are removed from process context by comp_vdev_read() and comp_vdev_close(). Note that in the comment, since it is what makes the irq-safe spinlock variants necessary here.

lock is never acquired by this driver directly. comp_register_videodev() installs it as struct video_device::lock, where v4l2_ioctl_get_lock() returns it and video_ioctl2() holds it across ioctl dispatch.

No functional change.

---
 drivers/staging/most/video/video.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/most/video/video.c +2 -0
index 88892b5db..c354d1820 100644
@@ -33,6 +33,7 @@ struct most_video_dev {
 	bool mute;
 
 	struct list_head pending_mbos;
+	/* protects pending_mbos; taken from rx completion (softirq) */
 	spinlock_t list_lock;
 
 	struct v4l2_device v4l2_dev;
@@ -40,6 +41,7 @@ struct most_video_dev {
 	struct video_device *vdev;
 	unsigned int ctrl_input;
 
+	/* serializes V4L2 ioctls; used as struct video_device::lock */
 	struct mutex lock;
 
 	wait_queue_head_t wait_data;
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 10 lines · Godana Emiru

Neither lock in struct most_video_dev carries a comment describing what it protects.

list_lock protects the pending_mbos list. Buffers are added by the component's rx_completion callback, comp_rx_data(), which is invoked from the interface driver's completion path (a URB completion handler in the case of the USB HDM), and are removed from process context by comp_vdev_read() and comp_vdev_close(). Note that in the comment, since it is what makes the irq-safe spinlock variants necessary here.

Quoted 3 lines

lock is never acquired by this driver directly. comp_register_videodev() installs it as struct video_device::lock, where v4l2_ioctl_get_lock() returns it and video_ioctl2() holds it across ioctl dispatch.

What tool did you use to generate this changelog?

thanks,

greg k-h

#2 lore raw

Hi Greg,
I used an LLM (Claude) to help trace the locking and draft the changelog for this patch. I reviewed it and sent it under my own Signed-off-by, but I failed to add the "Assisted-by: LLM" tag required by Documentation/process/coding-assistants.rst. The same applies to my earlier rtl8723bs patch. I apologize for the omission.

I'm happy to resend with the correct tags if the patches are otherwise useful, or drop them if you prefer.

thanks,
Godana

maintainer
#3 lore raw
Quoted 9 lines · Godana Emiru

Hi Greg,
I used an LLM (Claude) to help trace the locking and draft the changelog for this patch. I reviewed it and sent it under my own Signed-off-by, but I failed to add the "Assisted-by: LLM" tag required by Documentation/process/coding-assistants.rst. The same applies to my earlier rtl8723bs patch. I apologize for the omission.

I'm happy to resend with the correct tags if the patches are otherwise useful, or drop them if you prefer.

Please read this:

	https://lore.kernel.org/r/2026080354-skater-urgent-31b2@gregkh