mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: most: video: document the locks in struct most_video_dev
@ 2026-09-01 17:20 Godana Emiru
  2026-09-03  8:31 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Godana Emiru @ 2026-09-01 17:20 UTC (permalink / raw)
  To: parthiban.veerasooran, christian.gromm, gregkh
  Cc: linux-staging, linux-kernel, 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.

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.

Signed-off-by: Godana Emiru <godanaemiru@gmail.com>
---
 drivers/staging/most/video/video.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index 88892b5db..c354d1820 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -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;
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-03 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01 17:20 [PATCH] staging: most: video: document the locks in struct most_video_dev Godana Emiru
2026-09-03  8:31 ` Greg KH
2026-09-03 13:29   ` Godana Emiru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®