[PATCH] tty/serial: at91: BUG: disable interrupts when !UART_ENABLE_MS()

Peter Hurley peter at hurleysoftware.com
Fri Sep 5 04:06:14 PDT 2014

Hi Nicolas,

On 09/05/2014 05:15 AM, Nicolas Ferre wrote:
> On 03/09/2014 18:09, Richard Genoud :
> Richard,
> Indeed it seems needed:
> Acked-by: Nicolas Ferre <nicolas.ferre at atmel.com>
> But BTW, I see just below a call to the atmel_enable_ms() function in
> atmel_set_ldisc(). My question is, shouldn't we also add this
> atmel_disable_ms() in the alternative that disables the PPS in this
> ldisc function?

I have that change in another series but it has to wait for:

1. another series that fixes races setting and clearing the controlling tty
   (and reduces the footprint of tty_mutex)
2. a series built on that which moves tty_lock() out from under tty_mutex
   when reopening ttys
   This allows the tty_lock to be held while closing the tty.
3. a series which removes the ldisc flush from the serial core, among some
   other locking fixes in the serial core.
   This fixes a lock inversion between the termios_rwsem and the port mutex.

All of which enables the set_ldisc() notification to be safely passed
termios so it can use UART_ENABLE_MS() and also claim the port mutex
to change the UPF_HARDPPS_CD flag, which is currently non-atomic and
may corrupt the uart port flags field.

The series also claims the port lock around the *_enable_ms() in the
various set_ldisc() handlers to protect the hardware re-programming :)

Right now, all of this is temporarily stuck on the most recent patch
series, which hinges on whether the kernel should continue to support
non-atomic byte stores.

Peter Hurley

More information about the linux-arm-kernel mailing list