Skip to content

Commit

Permalink
Blackfin Serial Driver: disable dma rx interrupt only rather than all…
Browse files Browse the repository at this point in the history
… irqs

The UART RX handling code isn't exactly speeding, so don't go disabling
all interrupts when processing the buffer.  Just disable the relevant DMA
interrupt.  This greatly improves latency of the system when utilizing the
UART.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Sonic Zhang authored and Linus Torvalds committed Jun 11, 2009
1 parent 8450779 commit 2860b79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
{
int x_pos, pos;
unsigned long flags;

spin_lock_irqsave(&uart->port.lock, flags);
dma_disable_irq(uart->rx_dma_channel);
spin_lock_bh(&uart->port.lock);

/* 2D DMA RX buffer ring is used. Because curr_y_count and
* curr_x_count can't be read as an atomic operation,
Expand Down Expand Up @@ -512,7 +512,8 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
uart->rx_dma_buf.tail = uart->rx_dma_buf.head;
}

spin_unlock_irqrestore(&uart->port.lock, flags);
spin_unlock_bh(&uart->port.lock);
dma_enable_irq(uart->rx_dma_channel);

mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES);
}
Expand Down

0 comments on commit 2860b79

Please sign in to comment.