Re: [PATCH] serial: 8250_dwlib: Restore NOTEMT for em485
From: Ilpo Järvinen
Date: Fri Dec 04 2026 - 09:06:44 EST
On Fri, 4 Dec 2026, Andy Shevchenko wrote:
> 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?
Like limiting collateral damage autoconfig is allowed to do? Doesn't the
autoconfig run too late so we'd need some kind of mask to prevent it from
touching what the driver marks with keep-hands-off?
Perhaps this is just some capabilities = x somewhere where it should only
do capabilities &= ~(BITX|BITY|...BITZ) for the bits it actually
autoconfigures rather than overwriting any capability flags.
--
i.