提交 19606eaf 编写于 作者: M Maarten Brock 提交者: Greg Kroah-Hartman

serial-uartlite: Spinlock inside the loop.

Better to hold the spinlock as short as possible.
Signed-off-by: NMaarten Brock <m.brock@vanmierlo.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2905697a
......@@ -193,19 +193,18 @@ static int ulite_transmit(struct uart_port *port, int stat)
static irqreturn_t ulite_isr(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
int busy, n = 0;
int stat, busy, n = 0;
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
do {
int stat = uart_in32(ULITE_STATUS, port);
spin_lock_irqsave(&port->lock, flags);
stat = uart_in32(ULITE_STATUS, port);
busy = ulite_receive(port, stat);
busy |= ulite_transmit(port, stat);
spin_unlock_irqrestore(&port->lock, flags);
n++;
} while (busy);
spin_unlock_irqrestore(&port->lock, flags);
/* work done? */
if (n > 1) {
tty_flip_buffer_push(&port->state->port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册