All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 1/4] serial: revert guards in uart_wait_modem_status()
Date: Mon, 7 Sep 2026 09:37:58 +0200	[thread overview]
Message-ID: <ap5p1qzbLn1mVLrb@hovoldconsulting.com> (raw)
In-Reply-To: <b504b8a5-8bc3-49f2-a01d-4f24f46f84a0@kernel.org>

On Mon, Sep 07, 2026 at 08:51:26AM +0200, Jiri Slaby wrote:
> On 07. 09. 26, 8:47, Jiri Slaby wrote:
> > On 07. 09. 26, 8:44, Johan Hovold wrote:
> >> Mixing scope-based and regular cleanup is discouraged and
> >> uart_port_deref() used by uart_wait_modem_status() falls in the latter
> >> category.
> >>
> >> Revert the premature guard conversion in preparation for fixing a hangup
> >> race.
> > 
> > It's not premature. Just convert uart_port_ref() to guards too. Gotos suck.
> 
> (Or don't use gotos and I will.)

I guess you meant "don't use guards" here. :)

Gotos don't suck. Obscure driver-specific guard constructs do, though.

So I'm with netdev here, who discourage its use. [1]

I haven't missed your fondness of them, though, and if you want to
continue that path I think it's best if you do it as a follow-on change
(e.g. to facilitate backporting and as it is a larger change to the
driver, unrelated to the fix).

Johan


[1] https://docs.kernel.org/process/maintainer-netdev.html#using-device-managed-and-cleanup-h-constructs

  reply	other threads:[~2026-09-07  7:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  6:44 [PATCH v3 0/4] serial: fix ioctl hangup race Johan Hovold
2026-09-07  6:44 ` [PATCH v3 1/4] serial: revert guards in uart_wait_modem_status() Johan Hovold
2026-09-07  6:47   ` Jiri Slaby
2026-09-07  6:51     ` Jiri Slaby
2026-09-07  7:37       ` Johan Hovold [this message]
2026-09-07  6:51   ` sashiko-bot
2026-09-07  6:44 ` [PATCH v3 2/4] serial: fix ioctl hangup race Johan Hovold
2026-09-07  7:00   ` sashiko-bot
2026-09-07  7:14     ` Johan Hovold
2026-09-07  6:44 ` [PATCH v3 3/4] serial: fix TIOCMIWAIT race Johan Hovold
2026-09-07  6:50   ` sashiko-bot
2026-09-07  6:44 ` [PATCH v3 4/4] serial: abort TIOCMIWAIT on hangup Johan Hovold
2026-09-07  6:51   ` sashiko-bot

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=ap5p1qzbLn1mVLrb@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.