From: Sonic Zhang Date: Thu, 24 Apr 2008 20:36:47 +0000 (+0800) Subject: Blackfin Serial Driver: fix bug - use mod_timer to replace only add_timer. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a2784233785226fe5882c8af15118476f89e98e;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: Bryan Wu --- 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) uart->rx_dma_buf.tail = uart->rx_dma_buf.head; } - uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES; - add_timer(&(uart->rx_dma_timer)); + mod_timer(&(uart->rx_dma_timer), jiffies + DMA_RX_FLUSH_JIFFIES); } 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) clear_dma_irqstat(uart->rx_dma_channel); spin_unlock(&uart->port.lock); - del_timer(&(uart->rx_dma_timer)); - uart->rx_dma_timer.expires = jiffies; - add_timer(&(uart->rx_dma_timer)); + mod_timer(&(uart->rx_dma_timer), jiffies); return IRQ_HANDLED; }