[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXoQwQnt4CYmeElZ@smile.fi.intel.com>
Date: Wed, 28 Jan 2026 15:36:01 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, linux-serial@...r.kernel.org,
qianfan Zhao <qianfanguijin@....com>,
Adriana Nicolae <adriana@...sta.com>, linux-kernel@...r.kernel.org,
"Bandal, Shankar" <shankar.bandal@...el.com>,
"Murthy, Shanth" <shanth.murthy@...el.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2 2/7] serial: 8250_dw: Avoid unnecessary LCR writes
On Wed, Jan 28, 2026 at 12:52:56PM +0200, Ilpo Järvinen wrote:
> When DW UART is configured with BUSY flag, LCR writes may not always
> succeed which can make any LCR write complex and very expensive.
> Performing write directly can trigger IRQ and the driver has to perform
> complex and distruptive sequence while retrying the write.
>
> Therefore, it's better to avoid doing LCR write that would not change
> the value of the LCR register. Add LCR write avoidance code into the
> 8250_dw driver's .serial_out() functions.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
...
> +static bool dw8250_can_skip_reg_write(struct uart_port *p, unsigned int offset, u32 value)
> +{
> + struct dw8250_data *d = to_dw8250_data(p->private_data);
> + u32 lcr;
> +
> + if (offset != UART_LCR || d->uart_16550_compatible)
> + return false;
> +
> + lcr = serial_port_in(p, offset);
> + return lcr == value;
I don't expect the side-effects, but strictly speaking this compares
the 32-bit values, while in some callbacks the only part of that
is being used (often lowest 8 bits).
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists