[PATCH] change add_timer to mod_timer
authorLi, Ning <ning.li@intel.com>
Tue, 8 May 2012 07:41:00 +0000 (15:41 +0800)
committerbuildbot <buildbot@intel.com>
Sat, 12 May 2012 05:02:19 +0000 (22:02 -0700)
BZ: 34961

HSU driver might delete timer without sync in tasklet. The pending
timer might exist before next add_timer. It is better to use
mod_timer instead of add_timer.

Change-Id: I5762791f70a011b05e9e57d614a6e041ad27a400
Signed-off-by: Bin Yang <bin.yang@intel.com>
Reviewed-on: http://android.intel.com:8080/47762
Reviewed-by: Cai, Stanley W <stanley.w.cai@intel.com>
Reviewed-by: Kuppuswamy, Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Tested-by: Wang, Zhifeng <zhifeng.wang@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/tty/serial/mfd.c

index 56796cc..2a93275 100644 (file)
@@ -605,9 +605,8 @@ static void hsu_dma_rx_tasklet(unsigned long data)
                chan_writel(chan, HSU_CH_CR, 0x3);
 
                if (dmarx_need_timer()) {
-                       chan->rx_timer.expires =
-                                       jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ;
-                       add_timer(&chan->rx_timer);
+                       mod_timer(&chan->rx_timer,
+                               jiffies + HSU_DMA_TIMEOUT_CHECK_FREQ);
                        runtime_suspend_delay(up);
                }