Re: [PATCH 05/15] serial: sc16is7xx: use guards for simple mutex locks
From: Hugo Villeneuve
Date: Tue Sep 30 2025 - 09:57:33 EST
Hi Jiri,
On Tue, 30 Sep 2025 06:01:35 +0200
Jiri Slaby <jirislaby@xxxxxxxxxx> wrote:
> On 30. 09. 25, 2:27, Hugo Villeneuve wrote:
> >>> @@ -943,9 +937,8 @@ static void sc16is7xx_ms_proc(struct kthread_work *ws)
> >>> struct sc16is7xx_port *s = dev_get_drvdata(one->port.dev);
> >>>
> >>> if (one->port.state) {
> >>> - mutex_lock(&one->lock);
> >>> + guard(mutex)(&one->lock);
> >>> sc16is7xx_update_mlines(one);
> >>> - mutex_unlock(&one->lock);
> >>>
> >>> kthread_queue_delayed_work(&s->kworker, &one->ms_work, HZ);
> >>
> >> Now the lock is held till here. R U sure it is OK?
> >
> > Now that you mention it, I am sure its not OK :)
> >
> > I will restore this one to the original lock/unlock code in V2.
>
> Or use a scoped lock ;).
Cool, will use that.
Thank you,
Hugo.