提交 cfadbd29 编写于 作者: R Ralf Baechle 提交者: Jeff Garzik

[PATCH] Fix timer race

When closing the driver or reinitializing the hardware there is the
usual del_timer() race condition that exists when timers re-add
themselves.  Fix by conversion to del_timer_sync().
Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 089fff2a
...@@ -1017,7 +1017,7 @@ static void ioc3_init(struct net_device *dev) ...@@ -1017,7 +1017,7 @@ static void ioc3_init(struct net_device *dev)
struct ioc3_private *ip = netdev_priv(dev); struct ioc3_private *ip = netdev_priv(dev);
struct ioc3 *ioc3 = ip->regs; struct ioc3 *ioc3 = ip->regs;
del_timer(&ip->ioc3_timer); /* Kill if running */ del_timer_sync(&ip->ioc3_timer); /* Kill if running */
ioc3_w_emcr(EMCR_RST); /* Reset */ ioc3_w_emcr(EMCR_RST); /* Reset */
(void) ioc3_r_emcr(); /* Flush WB */ (void) ioc3_r_emcr(); /* Flush WB */
...@@ -1081,7 +1081,7 @@ static int ioc3_close(struct net_device *dev) ...@@ -1081,7 +1081,7 @@ static int ioc3_close(struct net_device *dev)
{ {
struct ioc3_private *ip = netdev_priv(dev); struct ioc3_private *ip = netdev_priv(dev);
del_timer(&ip->ioc3_timer); del_timer_sync(&ip->ioc3_timer);
netif_stop_queue(dev); netif_stop_queue(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册