[PATCH] serial: 8250: Return early in .start_tx() if there are no chars to send

Tony Lindgren tony at atomide.com
Mon Apr 11 02:56:44 PDT 2022


* Tony Lindgren <tony at atomide.com> [220407 13:25]:
> Hi,
> 
> * Uwe Kleine-König <u.kleine-koenig at pengutronix.de> [700101 02:00]:
> > From: Steffen Trumtrar <s.trumtrar at pengutronix.de>
> > 
> > Don't start the whole chain for TX if there is no data to send. This is
> > mostly relevant for rs485 mode as there might be rts-before-send and
> > rts-after-send delays involved.
> > 
> > Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> > ---
> > Hello,
> > 
> > a few other drivers have such an early exit already (imx, stm32-usart).
> > I wonder if it applies to all UART drivers that there is nothing to do
> > in .start_tx() if the circ buffer is empty and there is no x_char to
> > send. In this case it would be more sensible to ensure in serial_core
> > that .start_tx() is only ever called if there is something to do.
> 
> This patch seems to cause a runtime PM regression in v5.18-rc1 where
> 8250 is never idled for omaps.
> 
> Looks like the return added here is not paired with put for the
> serial8250_rpm_get_tx() call above?

FYI I just posted two fixes for these early return cases:

https://lore.kernel.org/linux-serial/20220411094805.45696-1-tony@atomide.com/T/#t

Regards,

Tony



More information about the linux-arm-kernel mailing list