mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Hugo Villeneuve <hugo@hugovil.com>,
	gregkh@linuxfoundation.org, fvallee@eukrea.fr
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: Re: [PATCH 05/15] serial: sc16is7xx: use guards for simple mutex locks
Date: Mon, 29 Sep 2025 08:09:12 +0200	[thread overview]
Message-ID: <0a606585-a7fb-4457-99f5-fe9cc75e366a@kernel.org> (raw)
In-Reply-To: <20250924153740.806444-6-hugo@hugovil.com>

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

  reply	other threads:[~2025-09-29  6:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 15:37 [PATCH 00/15] serial: sc16is7xx: register access fixes and improvements Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 01/15] serial: sc16is7xx: remove useless enable of enhanced features Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 02/15] serial: sc16is7xx: rename LCR macros to better reflect usage Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 03/15] serial: sc16is7xx: rename EFR mutex with generic name Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 04/15] serial: sc16is7xx: define common register access function Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 05/15] serial: sc16is7xx: use guards for simple mutex locks Hugo Villeneuve
2025-09-29  6:09   ` Jiri Slaby [this message]
2025-09-30  0:27     ` Hugo Villeneuve
2025-09-30  4:01       ` Jiri Slaby
2025-09-30 13:57         ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 06/15] serial: sc16is7xx: use dev_err_probe() instead of dev_err() Hugo Villeneuve
2025-09-29  6:10   ` Jiri Slaby
2025-09-30  0:32     ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 07/15] serial: sc16is7xx: declare SPR/TLR/XOFF2 register as volatile Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 08/15] serial: sc16is7xx: move port/channel init to separate function Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 09/15] serial: sc16is7xx: Kconfig: allow building with COMPILE_TEST Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 10/15] serial: sc16is7xx: use KBUILD_MODNAME Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 11/15] serial: sc16is7xx: remove empty line Hugo Villeneuve
2025-09-29  6:14   ` Jiri Slaby
2025-09-30  0:53     ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 12/15] serial: sc16is7xx: add missing space between macro args (checkpatch) Hugo Villeneuve
2025-09-29  6:15   ` Jiri Slaby
2025-09-30 20:08     ` Hugo Villeneuve
2025-10-01  5:16       ` Greg KH
2025-10-01 13:29         ` Hugo Villeneuve
2025-10-02  5:24           ` Greg KH
2025-09-24 15:37 ` [PATCH 13/15] serial: sc16is7xx: change incorrect indentation Hugo Villeneuve
2025-09-26  9:18   ` Maarten Brock
2025-09-26 16:11     ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 14/15] serial: sc16is7xx: reformat comments Hugo Villeneuve
2025-09-29  6:18   ` Jiri Slaby
2025-09-30 19:42     ` Hugo Villeneuve
2025-09-24 15:37 ` [PATCH 15/15] serial: sc16is7xx: add/improve comments Hugo Villeneuve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a606585-a7fb-4457-99f5-fe9cc75e366a@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=fvallee@eukrea.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=hugo@hugovil.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®