Re: [PATCH v2] serial: 8250_dw: Prefer SRBR in bogus RX timeout workaround if available

From: Yicong Yang

Date: Tue Sep 08 2026 - 07:52:50 EST


On 9/8/26 6:25 PM, Andy Shevchenko wrote:
> 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
>

sure, will split.

> /* 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;

will make it int. I remembered that I referred to
uart_port::serial_{in, out}() that use unsigned int
for offset, but yes serial_port_{in, out}() use int.

will update in v3.

Thanks.