Modified: branches/2008R1/drivers/serial/bfin_5xx.c (5334 => 5335)
--- branches/2008R1/drivers/serial/bfin_5xx.c 2008-09-25 06:08:29 UTC (rev 5334)
+++ branches/2008R1/drivers/serial/bfin_5xx.c 2008-09-25 06:32:47 UTC (rev 5335)
@@ -95,6 +95,7 @@
static void bfin_serial_start_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
+ int flags;
#ifdef CONFIG_SERIAL_BFIN_DMA
if (uart->tx_done)
@@ -381,6 +382,7 @@
}
#endif
+ spin_lock_irqsave(&uart->port.lock, flags);
#ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
{
@@ -427,6 +429,7 @@
#else
UART_PUT_IER(uart, UART_GET_IER(uart)|ETBEI);
#endif
+ spin_unlock_irqrestore(&uart->port.lock, flags);
}
static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
@@ -479,8 +482,10 @@
void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
{
- int x_pos, pos;
+ int x_pos, pos, flags;
+ spin_lock_irqsave(&uart->port.lock, flags);
+
uart->rx_dma_nrows = get_dma_curr_ycount(uart->rx_dma_channel);
x_pos = get_dma_curr_xcount(uart->rx_dma_channel);
uart->rx_dma_nrows = DMA_RX_YCOUNT - uart->rx_dma_nrows;
@@ -497,6 +502,8 @@
uart->rx_dma_buf.tail = uart->rx_dma_buf.head;
}
+ spin_unlock_irqrestore(&uart->port.lock, flags);
+
mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES);
}
@@ -535,10 +542,9 @@
spin_lock(&uart->port.lock);
irqstat = get_dma_curr_irqstat(uart->rx_dma_channel);
clear_dma_irqstat(uart->rx_dma_channel);
+ bfin_serial_dma_rx_chars(uart);
spin_unlock(&uart->port.lock);
- mod_timer(&(uart->rx_dma_timer), jiffies);
-
return IRQ_HANDLED;
}
#endif