Linux Serial subsystem development
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Eliav Farber <farbere@amazon.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	printk@lists.linux.dev, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, Eliav Farber <farbere@amazon.com>
Subject: Re: [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held
Date: Tue, 01 Dec 2026 17:35:30 +0106	[thread overview]
Message-ID: <87ld696k2d.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20261201145819.10941-1-farbere@amazon.com>

On 2026-12-01, Eliav Farber <farbere@amazon.com> wrote:
> If you want the trylock wrappers reused anyway, this keeps the assert
> valid and leaves the normal path on spin_lock():
>
> 	static inline void uart_port_lock(struct uart_port *up)
> 	{
> 		spin_lock(&up->lock);
> 		if (__uart_port_nbcon_try_acquire(up))
> 			return;
> 		spin_unlock(&up->lock);
>
> 		while (!uart_port_trylock(up))
> 			cpu_relax();
> 	}
>
> Which one do you want in v2?

Thanks for working out the details. My suggestion was a really bad
one. We do not want to convert spinlocks into busy-wait trylocks, even
for the nbcon case.

Your original version looks good. Sorry for the noise.

Reviewed-by: John Ogness <john.ogness@linutronix.de>

      reply	other threads:[~2026-12-01 16:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 15:51 [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held Eliav Farber
2026-11-30 16:09 ` sashiko-bot
2026-11-30 17:28 ` John Ogness
2026-12-01 14:58   ` Eliav Farber
2026-12-01 16:29     ` John Ogness [this message]

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=87ld696k2d.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=farbere@amazon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=printk@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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