On Wed, Jul 30, 2025 at 03:13:31AM +0000, dm...@proton.me wrote:
> From: Denis Mukhin <dmuk...@ford.com> 
> 
> As it stands, polling timer is kept in the list of timers even after the
> interrupts have been enabled / polling disabled on ns16550-compatible UART.
> 
> Ensure polling timer is removed from the timer list once UART interrupts are
> enabled.
> 
> Signed-off-by: Denis Mukhin <dmuk...@ford.com>
> ---
>  xen/drivers/char/ns16550.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
> index df7fff7f81df..299773d80065 100644
> --- a/xen/drivers/char/ns16550.c
> +++ b/xen/drivers/char/ns16550.c
> @@ -191,6 +191,10 @@ static void cf_check ns16550_interrupt(int irq, void 
> *dev_id)
>      struct serial_port *port = dev_id;
>      struct ns16550 *uart = port->uart;
>  
> +    /* Ensure polling timer is disarmed and removed from the timer list. */
> +    if ( !uart->intr_works )
> +        kill_timer(&uart->timer);

I think if anything you should issue a stop_timer() call, but not a
kill_timer() one, otherwise the uart code will hit an ASSERT when
calling set_timer() from ns16550_setup_postirq()? (that's from
_ns16550_resume()).

Thanks, Roger.

Reply via email to