Linux Serial subsystem development
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@kernel.org>, "Kees Cook" <kees@kernel.org>,
	"Osama Abdelkader" <osama.abdelkader@gmail.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Joseph Tilahun" <jtilahun@astranis.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	linux-serial <linux-serial@vger.kernel.org>
Subject: Re: [PATCH tty v5 3/3] serial: 8250: Add support for console flow control
Date: Tue, 12 May 2026 11:35:06 +0206	[thread overview]
Message-ID: <87h5od9dst.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <f9f408c5-72f5-4be8-7471-e9aee2935a5b@linux.intel.com>

On 2026-05-11, Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> wrote:
>> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
>> index 4f7bbdd900176..17fcff466e301 100644
>> --- a/include/linux/serial_core.h
>> +++ b/include/linux/serial_core.h
>> @@ -1175,6 +1175,14 @@ static inline bool uart_cons_flow_enabled(const struct uart_port *uport)
>>  	return uport->cons_flow;
>>  }
>>  
>> +static inline bool uart_console_hwflow_active(struct uart_port *uport)
>> +{
>> +	return uart_console(uport) &&
>> +	       !(uport->rs485.flags & SER_RS485_ENABLED) &&
>> +	       uart_cons_flow_enabled(uport) &&
>> +	       uart_cts_enabled(uport);
>> +}
>> +
>>  /*
>>   * The following are helper functions for the low level drivers.
>>   */
>
> Did you miss Andy's comments or choose to not act on them?

You mean these [0]? For the getter, yes. (Although I left the "is_" off
so that it matches other existing flag checking functions.)

For the setter, Andy suggested explicit enable/disable
variants. However, all the users enable/disable based on some
condition. That would mean that there would be a repeated pattern of:

	if (condition)
		uart_cons_flow_enable();
	else
		uart_cons_flow_disable();

So I decided to keep a single setter.

	uart_set_cons_flow_enabled(condition);

I renamed the setter so that it is clearer that only the enabled flag is
being set and not any other special procedures.

John Ogness

[0] https://lore.kernel.org/lkml/CAHp75Vf4YZVqXa7eH-RFeVsycdzoHijcWFnUbGv2PSmtPya1-w@mail.gmail.com

      reply	other threads:[~2026-05-12  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 15:26 [PATCH tty v5 0/3] 8250: Add console flow control John Ogness
2026-05-11 15:27 ` [PATCH tty v5 1/3] serial: 8250: Set cons_flow on port registration John Ogness
2026-05-11 15:27 ` [PATCH tty v5 2/3] serial: 8250: Check LSR timeout on console flow control John Ogness
2026-05-11 15:27 ` [PATCH tty v5 3/3] serial: 8250: Add support for " John Ogness
2026-05-11 16:07   ` Ilpo Järvinen
2026-05-12  9: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=87h5od9dst.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=jtilahun@astranis.com \
    --cc=kees@kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=mingo@kernel.org \
    --cc=osama.abdelkader@gmail.com \
    --cc=rdunlap@infradead.org \
    --cc=tglx@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