Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Yicong Yang <yang.yicong@picoheart.com>,
	linux-serial <linux-serial@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	geshijian@picoheart.com, yangyang.8776@picoheart.com,
	yanligen@picoheart.com
Subject: Re: [PATCH] serial: 8250_dw: Prefer SRBR in bogus RX timeout workaround if available
Date: Mon, 29 Jun 2026 19:07:54 +0300	[thread overview]
Message-ID: <akKYWjZPHdlgybY8@ashevche-desk.local> (raw)
In-Reply-To: <1ef5a875-2c01-5b4b-7d2b-07e6ea3db2b3@linux.intel.com>

On Mon, Jun 29, 2026 at 06:56:28PM +0300, Ilpo Järvinen wrote:
> On Mon, 29 Jun 2026, Yicong Yang wrote:

...

> > +			if (d->data.shadow_support)
> > +				serial_port_in(p, DW_UART_SRBR_0);
> > +			else
> > +				serial_port_in(p, UART_RX);
> 
> How about:
> 			serial_port_in(p, d->data.shadow_support ? DW_UART_SRBR_0
> 								 : UART_RX);

I was thinking of even just having the value of the register offset somewhere
in dw8250_data and call this unconditionally.

			serial_port_in(p, d->srbr);

Of course this has to be carefully initialised in time with UART_RX.

...

> >  /* Offsets for the DesignWare specific registers */
> > +#define DW_UART_SRBR_0	0x0c /* Shadow Receive Buffer Register */
> >  #define DW_UART_USR	0x1f /* UART Status Register */
> 
> It seems USR and now SRBR_0 are without regshift whereas the reset of 
> the register defines are with it.
> 
> Somewhat unrelated to this patch, I really hate this 
> dw8250_readl/writel_ext() mess even more now... Why are those needed 
> anyway, should the .serial_in/out callbacks handle those byte-order, etc. 
> variations just fine?

Aren't there is a possibility to have the register stride for the first ones as
1 for backward compatibility with 16550, while providing the features like CPR
and UCV that needs a 32-bit accessors? IIRC that was the reason for _ext() IO.

> Are those _ext calls only required for some early things during probe?
> I guess 8250_lpss hasn't setup the callbacks yet before calling 
> dw8250_setup_port() (I'm not even sure where it gets set with it after 
> looking for it for a few minutes)?


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-29 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  7:55 [PATCH] serial: 8250_dw: Prefer SRBR in bogus RX timeout workaround if available Yicong Yang
2026-06-29 14:56 ` Andy Shevchenko
2026-06-29 15:14   ` Ilpo Järvinen
2026-06-29 15:16     ` Andy Shevchenko
2026-06-29 15:56 ` Ilpo Järvinen
2026-06-29 16:07   ` Andy Shevchenko [this message]
2026-06-30 17:51   ` Yicong Yang
2026-06-30 18:18     ` Ilpo Järvinen
2026-06-30 18:42       ` Yicong Yang
2026-07-01  8:45         ` Ilpo Järvinen
2026-07-01 16:13           ` Yicong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=akKYWjZPHdlgybY8@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=geshijian@picoheart.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=yang.yicong@picoheart.com \
    --cc=yangyang.8776@picoheart.com \
    --cc=yanligen@picoheart.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox