[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <91303556-2632-49ca-be5d-9105c75b8a63@kernel.org>
Date: Wed, 30 Oct 2024 07:13:42 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: John Ogness <john.ogness@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>, Thomas Gleixner <tglx@...utronix.de>,
Esben Haabendal <esben@...nix.com>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"Paul E. McKenney" <paulmck@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Stefan Wahren <wahrenst@....net>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Markus Schneider-Pargmann <msp@...libre.com>,
Ronald Wahl <ronald.wahl@...itan.com>, Udit Kumar <u-kumar1@...com>,
Griffin Kroah-Hartman <griffin@...ah.com>,
Rengarajan S <rengarajan.s@...rochip.com>,
Lino Sanfilippo <l.sanfilippo@...bus.com>,
Serge Semin <fancer.lancer@...il.com>, linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH tty-next v3 4/6] serial: 8250: Specify console context for
rs485_start/stop_tx
On 25. 10. 24, 12:57, John Ogness wrote:
> For RS485 mode, if SER_RS485_RX_DURING_TX is not available, the
> console write callback needs to enable/disable TX. It does this
> by calling the rs485_start/stop_tx() callbacks. However, these
> callbacks will disable/enable interrupts, which is a problem
> for console write, as it must be responsible for
> disabling/enabling interrupts.
>
> Add an argument @in_con to the rs485_start/stop_tx() callbacks
> to specify if they are being called from console write. If so,
> the callbacks will not handle interrupt disabling/enabling.
>
> For all call sites other than console write, there is no
> functional change.
>
> Signed-off-by: John Ogness <john.ogness@...utronix.de>
...
> @@ -1562,12 +1566,20 @@ static inline void __start_tx(struct uart_port *port)
> * stoppable by disabling the UART_IER_RDI interrupt. (Some chips set the
> * UART_LSR_DR bit even when UART_IER_RDI is disabled, foiling this approach.)
> */
> -void serial8250_em485_start_tx(struct uart_8250_port *up)
> +void serial8250_em485_start_tx(struct uart_8250_port *up, bool in_con)
> {
> unsigned char mcr = serial8250_in_MCR(up);
>
> - if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX))
> - serial8250_stop_rx(&up->port);
> + if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX)) {
> + /*
> + * In console context, caller handles interrupt disabling. So
> + * only LSR_DR masking is needed.
> + */
> + if (in_con)
> + __serial8250_stop_rx_mask_dr(&up->port);
> + else
> + serial8250_stop_rx(&up->port);
Would it make sense to propagate in_con into serial8250_stop_rx() and do
the logic there? That would effectively eliminate patch 2/6.
thanks,
--
js
suse labs
Powered by blists - more mailing lists