Re: [PATCH] tty: serial: 8250_omap: do not defer termios changes

From: One Thousand Gnomes
Date: Thu Mar 31 2016 - 10:34:03 EST


> + * TCSANOW requests the change to occur immediately, however
> + * if we have a TX-DMA operation in progress then it has been
> + * observed that it might stall and never complete. Therefore
> + * we wait until DMA completes to prevent this hang from
> + * happening.
> + */
> +
> + dma->tx_running = 2;
> +
> + spin_unlock_irq(&up->port.lock);
> + wait_event_interruptible(priv->termios_wait,
> + dma->tx_running == 3);
> + spin_lock_irq(&up->port.lock);
> + complete_dma = 1;
> + }

This look wrong if a signal is received. termios setting is not an
interruptible event and this would mean for example that a random other
signal to a terminal process would cause mysterious non-setting of
termios changes.

Should this therefore not just be a straight wait_event or even a
completion() handler ?

Alan