Re: [PATCH] staging: most: video: add comments to mutex and spinlock definitions
From: Muhammad Israr
Date: Sat Sep 12 2026 - 17:24:03 EST
On Sat, Sep 13, 2026 at 01:09:00AM +0000, Dan Carpenter wrote:
> [previous]
One thing before i go further is that the changes i am proposing i
can't test it
on a real MOST hardware as i don't have it i can only do a compile
test and i also did used LLM assistance in understanding
code especially where the race problem happens so according to greg
LLM policy i can't submit this is formal patch.
The possible according me will be use another read->lock:
static ssize_t comp_vdev_read(struct file *filp, char __user *buf,
size_t count, loff_t *pos)
{
...
mutex_lock(&mdev->read_lock);
...
while (count > 0) {
spin_lock_irq(&mdev->list_lock);
if (list_empty(&mdev->pending_mbos)) {
spin_unlock_irq(&mdev->list_lock);
break;
}
mbo = get_top_mbo(mdev);
list_del(&mbo->list);
spin_unlock_irq(&mdev->list_lock);
...
}
mutex_unlock(&mdev->read_lock);
}
If either of you want to take the read_lock approach
forward yourselves, you're welcome to otherwise I'll keep
working on staging drivers I can actually test on real hardware.
thanks
regards,
Muhammad Israr