Re: [PATCH] serial: 8250_dwlib: Restore NOTEMT for em485

From: Andy Shevchenko

Date: Fri Dec 04 2026 - 09:02:40 EST


On Fri, Dec 04, 2026 at 02:56:33PM +0200, Ilpo Järvinen wrote:
> On Fri, 4 Dec 2026, Andy Shevchenko wrote:
> > On Sat, Nov 21, 2026 at 02:35:15PM +0800, Fuyao Kashizuku wrote:

...

> > > +static int dw8250_em485_config(struct uart_port *p, struct ktermios *termios,
> > > + struct serial_rs485 *rs485)
> > > +{
> > > +
> > > + struct uart_8250_port *up = up_to_u8250p(p);
> > > +
> > > + /*
> > > + * Without CPR, 8250 autoconfiguration can overwrite capabilities.
> > > + * Restore NOTEMT before enabling emulation: DW has no TEMT interrupt.
> >
> > Hmm... The end of the phrase raises a Q: Is it true for *all* versions of
> > the DW 8250 IP (there are differences between 4.x and older once which might
> > be related)?
>
> My impression there's no TEMT interrupt in DW UART.
>
> But if I understand the comment correctly, this problem seem to relate
> CPRless HW falling back to autoconfig which overwrites what capabilities
> dwlib set (autoconfig is really annoying as it respects nothing?).

Yes, but shouldn't we do it differently then? Something like having a default
settings somewhere? I would expect perhaps a default "CPR" value that has to
be respected if CPR is absent. Or maybe you have a better ideas?

> > > + */
> > > + up->capabilities |= UART_CAP_NOTEMT;
> > > +
> > > + return serial8250_em485_config(p, termios, rs485);
> > > +}

--
With Best Regards,
Andy Shevchenko