diff options
author | Aubrey Li <aubrey.li@analog.com> | 2007-05-21 06:09:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-21 12:50:23 -0400 |
commit | 5c4e472b0af57553f9584e0b33c491b168ac1dff (patch) | |
tree | 5719717c4aa23ba8deca7e2d43d9ef7278268341 /drivers | |
parent | 9d7b6677ac35fdfee93e8f50589e04bcc95649c1 (diff) |
Blackfin serial driver: fix overhead issue
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 408390f93db9..a8271d9c6202 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -240,24 +240,30 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart) | |||
240 | bfin_serial_stop_tx(&uart->port); | 240 | bfin_serial_stop_tx(&uart->port); |
241 | } | 241 | } |
242 | 242 | ||
243 | static irqreturn_t bfin_serial_int(int irq, void *dev_id) | 243 | static irqreturn_t bfin_serial_rx_int(int irq, void *dev_id) |
244 | { | ||
245 | struct bfin_serial_port *uart = dev_id; | ||
246 | |||
247 | spin_lock(&uart->port.lock); | ||
248 | while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_RX_READY) | ||
249 | bfin_serial_rx_chars(uart); | ||
250 | spin_unlock(&uart->port.lock); | ||
251 | return IRQ_HANDLED; | ||
252 | } | ||
253 | |||
254 | static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id) | ||
244 | { | 255 | { |
245 | struct bfin_serial_port *uart = dev_id; | 256 | struct bfin_serial_port *uart = dev_id; |
246 | unsigned short status; | 257 | unsigned short status; |
247 | 258 | ||
248 | spin_lock(&uart->port.lock); | 259 | spin_lock(&uart->port.lock); |
249 | status = UART_GET_IIR(uart); | 260 | while ((UART_GET_IIR(uart) & IIR_STATUS) == IIR_TX_READY) |
250 | do { | 261 | bfin_serial_tx_chars(uart); |
251 | if ((status & IIR_STATUS) == IIR_TX_READY) | ||
252 | bfin_serial_tx_chars(uart); | ||
253 | if ((status & IIR_STATUS) == IIR_RX_READY) | ||
254 | bfin_serial_rx_chars(uart); | ||
255 | status = UART_GET_IIR(uart); | ||
256 | } while (status & (IIR_TX_READY | IIR_RX_READY)); | ||
257 | spin_unlock(&uart->port.lock); | 262 | spin_unlock(&uart->port.lock); |
258 | return IRQ_HANDLED; | 263 | return IRQ_HANDLED; |
259 | } | 264 | } |
260 | 265 | ||
266 | |||
261 | static void bfin_serial_do_work(struct work_struct *work) | 267 | static void bfin_serial_do_work(struct work_struct *work) |
262 | { | 268 | { |
263 | struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); | 269 | struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); |
@@ -545,14 +551,14 @@ static int bfin_serial_startup(struct uart_port *port) | |||
545 | add_timer(&(uart->rx_dma_timer)); | 551 | add_timer(&(uart->rx_dma_timer)); |
546 | #else | 552 | #else |
547 | if (request_irq | 553 | if (request_irq |
548 | (uart->port.irq, bfin_serial_int, IRQF_DISABLED, | 554 | (uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED, |
549 | "BFIN_UART_RX", uart)) { | 555 | "BFIN_UART_RX", uart)) { |
550 | printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); | 556 | printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); |
551 | return -EBUSY; | 557 | return -EBUSY; |
552 | } | 558 | } |
553 | 559 | ||
554 | if (request_irq | 560 | if (request_irq |
555 | (uart->port.irq+1, bfin_serial_int, IRQF_DISABLED, | 561 | (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, |
556 | "BFIN_UART_TX", uart)) { | 562 | "BFIN_UART_TX", uart)) { |
557 | printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n"); | 563 | printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n"); |
558 | free_irq(uart->port.irq, uart); | 564 | free_irq(uart->port.irq, uart); |