serial: uartps: Move the spinlock after the read of the tx empty
Currently we are doing a read of the status register. Move the spinlock after that as the reads need not be spinlock protected. This patch prevents relaxing the cpu with spinlock held. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1f74dfa803
commit
107475685a
@ -686,8 +686,6 @@ static void cdns_uart_set_termios(struct uart_port *port,
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned int ctrl_reg, mode_reg;
|
unsigned int ctrl_reg, mode_reg;
|
||||||
|
|
||||||
spin_lock_irqsave(&port->lock, flags);
|
|
||||||
|
|
||||||
/* Wait for the transmit FIFO to empty before making changes */
|
/* Wait for the transmit FIFO to empty before making changes */
|
||||||
if (!(readl(port->membase + CDNS_UART_CR) &
|
if (!(readl(port->membase + CDNS_UART_CR) &
|
||||||
CDNS_UART_CR_TX_DIS)) {
|
CDNS_UART_CR_TX_DIS)) {
|
||||||
@ -696,6 +694,7 @@ static void cdns_uart_set_termios(struct uart_port *port,
|
|||||||
cpu_relax();
|
cpu_relax();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
spin_lock_irqsave(&port->lock, flags);
|
||||||
|
|
||||||
/* Disable the TX and RX to set baud rate */
|
/* Disable the TX and RX to set baud rate */
|
||||||
ctrl_reg = readl(port->membase + CDNS_UART_CR);
|
ctrl_reg = readl(port->membase + CDNS_UART_CR);
|
||||||
|
Loading…
Reference in New Issue
Block a user