Skip to content

Commit

Permalink
[PATCH] Fix timer race
Browse files Browse the repository at this point in the history
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: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Ralf Baechle authored and Jeff Garzik committed Oct 21, 2006
1 parent 089fff2 commit cfadbd2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ioc3-eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ static void ioc3_init(struct net_device *dev)
struct ioc3_private *ip = netdev_priv(dev);
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 */
(void) ioc3_r_emcr(); /* Flush WB */
Expand Down Expand Up @@ -1081,7 +1081,7 @@ static int ioc3_close(struct net_device *dev)
{
struct ioc3_private *ip = netdev_priv(dev);

del_timer(&ip->ioc3_timer);
del_timer_sync(&ip->ioc3_timer);

netif_stop_queue(dev);

Expand Down

0 comments on commit cfadbd2

Please sign in to comment.