[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250930095728.2a35a4af334cf860cc476823@hugovil.com>
Date: Tue, 30 Sep 2025 09:57:28 -0400
From: Hugo Villeneuve <hugo@...ovil.com>
To: Jiri Slaby <jirislaby@...nel.org>
Cc: gregkh@...uxfoundation.org, fvallee@...rea.fr,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org, Hugo Villeneuve
<hvilleneuve@...onoff.com>
Subject: Re: [PATCH 05/15] serial: sc16is7xx: use guards for simple mutex
locks
Hi Jiri,
On Tue, 30 Sep 2025 06:01:35 +0200
Jiri Slaby <jirislaby@...nel.org> 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.
Powered by blists - more mailing lists