Re: [PATCH tty v5 3/3] serial: 8250: Add support for console flow control

From: John Ogness

Date: Tue May 12 2026 - 05:29:32 EST


On 2026-05-11, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx