Re: [PATCH v2] serial: 8250_dw: Prefer SRBR in bogus RX timeout workaround if available
From: Andy Shevchenko
Date: Tue Sep 08 2026 - 06:31:54 EST
On Mon, Sep 07, 2026 at 03:40:35PM +0800, Yicong Yang wrote:
> The DW uart could get into the cases where a bogus RX timeout
> interrupt is asserted but no available data. This could be
> workaround by doing a bogus read.
>
> Currently the driver's using the standard RBR (receive buffer
> register) for this bogus read. However the reading of RBR
> in this case is allowed to raise a hardware error if vendor
> choose to implement in this way (our platform). It's also
> allowed to do the bogus read using SRBR (shadow RBR) for
> workaround which won't raise the hardware error. So change
> to use the SRBR to workaround the issue if it's available.
...
> struct dw8250_port_data {
>
> /* RS485 variables */
> bool hw_rs485_support;
>
> + /* Shadow RBR offset, fallback to RBR if no shadow register support */
This comment is for "section", so split it to two
/* Register offsets */
/* Shadow RBR (if not defined RBR will be used) */
> + unsigned int srbr;
In APIs this defined as int, I would follow (however I agree that ideally in
all of them it should be unsigned).
int srbr;
> };
--
With Best Regards,
Andy Shevchenko