diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2008-04-24 16:36:47 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-04-24 16:36:47 -0400 |
commit | 0a2784233785226fe5882c8af15118476f89e98e (patch) | |
tree | 4c7a3fd55bb719822d9fdf703356f1a619ac6560 /drivers | |
parent | 50e2e15afaac59c955f43d78d0a1e53cf8a76370 (diff) |
Blackfin Serial Driver: fix bug - use mod_timer to replace only add_timer.
http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=4045
If adding timer in both timer handler and rx interrupt, a timer may be
added when it is till in the pending list.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 47ca7b0267df..5f55534a290b 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -506,8 +506,7 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) | |||
506 | uart->rx_dma_buf.tail = uart->rx_dma_buf.head; | 506 | uart->rx_dma_buf.tail = uart->rx_dma_buf.head; |
507 | } | 507 | } |
508 | 508 | ||
509 | uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES; | 509 | mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES); |
510 | add_timer(&(uart->rx_dma_timer)); | ||
511 | } | 510 | } |
512 | 511 | ||
513 | static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id) | 512 | static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id) |
@@ -550,9 +549,7 @@ static irqreturn_t bfin_serial_dma_rx_int(int irq, void *dev_id) | |||
550 | clear_dma_irqstat(uart->rx_dma_channel); | 549 | clear_dma_irqstat(uart->rx_dma_channel); |
551 | spin_unlock(&uart->port.lock); | 550 | spin_unlock(&uart->port.lock); |
552 | 551 | ||
553 | del_timer(&(uart->rx_dma_timer)); | 552 | mod_timer(&(uart->rx_dma_timer), jiffies); |
554 | uart->rx_dma_timer.expires = jiffies; | ||
555 | add_timer(&(uart->rx_dma_timer)); | ||
556 | 553 | ||
557 | return IRQ_HANDLED; | 554 | return IRQ_HANDLED; |
558 | } | 555 | } |