Sometimes booting time is delayed as waiting in tty for closing_wait
value when tty device is closed during do tx.
The tty driver requests to wakeup waiting process if pending tx data is
handled by tty driver, then above waiting should be stopped. BTW now
without stop, the waiting is kept until closing_wait value.
I'm not sure, but this problem seems be occured by processing about tx
data without any synchronization.
This patch adds locking for tx in sprd serial driver, then this problem
is gone.
Change-Id: Icb9d774c4d989c09b666be6951d01a820bb17be5
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
static irqreturn_t serial_sprd_interrupt_chars(int irq, void *dev_id)
{
struct uart_port *port = (struct uart_port *)dev_id;
+ unsigned long flags;
u32 int_status;
int_status = serial_in(port, ARM_UART_STS2);
serial_sprd_rx_chars(irq, port);
}
if (int_status & UART_STS_TX_FIFO_EMPTY) {
+ spin_lock_irqsave(&port->lock, flags);
serial_sprd_tx_chars(irq, port);
+ spin_unlock_irqrestore(&port->lock, flags);
}
return IRQ_HANDLED;