[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0a606585-a7fb-4457-99f5-fe9cc75e366a@kernel.org>
Date: Mon, 29 Sep 2025 08:09:12 +0200
From: Jiri Slaby <jirislaby@...nel.org>
To: Hugo Villeneuve <hugo@...ovil.com>, gregkh@...uxfoundation.org,
fvallee@...rea.fr
Cc: 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
On 24. 09. 25, 17:37, Hugo Villeneuve wrote:
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
...
> @@ -829,9 +827,6 @@ static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
> break;
> }
>
> -out_port_irq:
> - mutex_unlock(&one->lock);
> -
> return rc;
No need for rc now AFAICT.
> }
>
> @@ -874,9 +869,8 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)
> (port->rs485.delay_rts_before_send > 0))
> msleep(port->rs485.delay_rts_before_send);
>
> - mutex_lock(&one->lock);
> + guard(mutex)(&one->lock);
> sc16is7xx_handle_tx(port);
> - mutex_unlock(&one->lock);
> }
>
> static void sc16is7xx_reconf_rs485(struct uart_port *port)
> @@ -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?
thanks,
--
js
suse labs
Powered by blists - more mailing lists