Commit f8a5d3f5 authored by Ben Collins's avatar Ben Collins

[SUNZILOG]: Fix locking in cases where UART layer has grabbed the lock already.

parent 18aa7699
...@@ -723,36 +723,28 @@ static void sunzilog_start_tx(struct uart_port *port, unsigned int tty_start) ...@@ -723,36 +723,28 @@ static void sunzilog_start_tx(struct uart_port *port, unsigned int tty_start)
} }
} }
/* The port lock is not held. */ /* The port lock is held. */
static void sunzilog_stop_rx(struct uart_port *port) static void sunzilog_stop_rx(struct uart_port *port)
{ {
struct uart_sunzilog_port *up = UART_ZILOG(port); struct uart_sunzilog_port *up = UART_ZILOG(port);
struct zilog_channel *channel; struct zilog_channel *channel;
unsigned long flags;
if (ZS_IS_CONS(up)) if (ZS_IS_CONS(up))
return; return;
spin_lock_irqsave(&port->lock, flags);
channel = ZILOG_CHANNEL_FROM_PORT(port); channel = ZILOG_CHANNEL_FROM_PORT(port);
/* Disable all RX interrupts. */ /* Disable all RX interrupts. */
up->curregs[R1] &= ~RxINT_MASK; up->curregs[R1] &= ~RxINT_MASK;
sunzilog_maybe_update_regs(up, channel); sunzilog_maybe_update_regs(up, channel);
spin_unlock_irqrestore(&port->lock, flags);
} }
/* The port lock is not held. */ /* The port lock is held. */
static void sunzilog_enable_ms(struct uart_port *port) static void sunzilog_enable_ms(struct uart_port *port)
{ {
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port; struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char new_reg; unsigned char new_reg;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE); new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE);
if (new_reg != up->curregs[R15]) { if (new_reg != up->curregs[R15]) {
...@@ -761,8 +753,6 @@ static void sunzilog_enable_ms(struct uart_port *port) ...@@ -761,8 +753,6 @@ static void sunzilog_enable_ms(struct uart_port *port)
/* NOTE: Not subject to 'transmitter active' rule. */ /* NOTE: Not subject to 'transmitter active' rule. */
write_zsreg(channel, R15, up->curregs[R15]); write_zsreg(channel, R15, up->curregs[R15]);
} }
spin_unlock_irqrestore(&port->lock, flags);
} }
/* The port lock is not held. */ /* The port lock is not held. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment