mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-20 02:34:23 +08:00
serial: Take uart port lock for direct *_enable_ms()
Three UART drivers (8250, atmel & amba-pl010) directly call their enable_ms() method; the uart port lock must be acquired before any h/w programming. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
732a84a037
commit
d41510ce2f
@ -2613,7 +2613,9 @@ serial8250_set_ldisc(struct uart_port *port, struct ktermios *termios)
|
||||
{
|
||||
if (termios->c_line == N_PPS) {
|
||||
port->flags |= UPF_HARDPPS_CD;
|
||||
spin_lock_irq(&port->lock);
|
||||
serial8250_enable_ms(port);
|
||||
spin_unlock_irq(&port->lock);
|
||||
} else
|
||||
port->flags &= ~UPF_HARDPPS_CD;
|
||||
}
|
||||
|
@ -483,7 +483,9 @@ static void pl010_set_ldisc(struct uart_port *port, struct ktermios *termios)
|
||||
{
|
||||
if (termios->c_line == N_PPS) {
|
||||
port->flags |= UPF_HARDPPS_CD;
|
||||
spin_lock_irq(&port->lock);
|
||||
pl010_enable_ms(port);
|
||||
spin_unlock_irq(&port->lock);
|
||||
} else
|
||||
port->flags &= ~UPF_HARDPPS_CD;
|
||||
}
|
||||
|
@ -2060,7 +2060,9 @@ static void atmel_set_ldisc(struct uart_port *port, struct ktermios *termios)
|
||||
{
|
||||
if (termios->c_line == N_PPS) {
|
||||
port->flags |= UPF_HARDPPS_CD;
|
||||
spin_lock_irq(&port->lock);
|
||||
atmel_enable_ms(port);
|
||||
spin_unlock_irq(&port->lock);
|
||||
} else {
|
||||
port->flags &= ~UPF_HARDPPS_CD;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user