[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] xen/ns16550: detect and preserve UART_IER_UUE



On Mon, Oct 12, 2026 at 02:52:06PM +0200, Jan Beulich wrote:
> On 10.10.2026 05:14, Zhang Zheng wrote:
> > --- a/xen/drivers/char/ns16550.c
> > +++ b/xen/drivers/char/ns16550.c
> > @@ -64,6 +64,7 @@ static struct ns16550 {
> >      bool intr_works;
> >      bool force_polling;
> >      bool dw_usr_bsy;
> > +    bool xscale;
> >  #ifdef NS16550_PCI
> >      /* PCI card parameters. */
> >      bool pb_bdf_enable;     /* if =1, pb-bdf effective, port behind bridge 
> > */
> > @@ -352,6 +353,14 @@ static void ns16550_setup_preirq(struct ns16550 *uart)
> >      /* No interrupts. */
> >      ns_write_reg(uart, UART_IER, 0);
> >  
> > +    uart->xscale = false;
> > +    if ( !(ns_read_reg(uart, UART_IER) & UART_IER_UUE) )
> > +    {
> > +        ns_write_reg(uart, UART_IER, UART_IER_UUE);
> > +        if ( ns_read_reg(uart, UART_IER) & UART_IER_UUE )
> > +            uart->xscale = true;
> > +    }
> 
> Linux'es detection is a little more involved, plus: It doesn't clobber the
> value originally present in the other 7 bits.
> 
> Jan

I noticed that Linux saves the original IER value and clears only UUE:

iersave = serial_in(up, UART_IER);
serial_out(up, UART_IER, iersave & ~UART_IER_UUE);

Xen clears IER immediately before this probe, so I think there is no previous
IER state to preserve. So I did not add `iersave` here.




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.