Trasmitted characters could be lost or written twice due to a missing lock in the critical section of the isr. The missing lock causes a race condition on SMP systems between ulite_transmit when called from the isr and ulite_start_tx as they can execute simultaneously on separate cores. The call from ulite_start_tx is made from serial_core.c with the lock taken. Signed-off-by: Kris Modrak <krismodrak@xxxxxxxxxxx> --- drivers/tty/serial/uartlite.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 9fc22f4..ee151a2 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -196,9 +196,13 @@ static irqreturn_t ulite_isr(int irq, void *dev_id) int busy, n = 0; do { - int stat = uart_in32(ULITE_STATUS, port); + int stat; + + spin_lock(&port->lock); + stat = uart_in32(ULITE_STATUS, port); busy = ulite_receive(port, stat); busy |= ulite_transmit(port, stat); + spin_unlock(&port->lock); n++; } while (busy); -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html