Skip to content

Commit

Permalink
Blackfin Serial Driver: fix bug - use mod_timer to replace only add_t…
Browse files Browse the repository at this point in the history
…imer.

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>
  • Loading branch information
Sonic Zhang authored and Bryan Wu committed Apr 24, 2008
1 parent 50e2e15 commit 0a27842
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0a27842

Please sign in to comment.