From: David Wu Date: Fri, 28 Apr 2017 09:41:43 +0000 (+0800) Subject: net: stmmac: The netif_device_attach() should be called after napi_enable() X-Git-Tag: release-20171130_firefly~4^2~631 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b9ca500f210b5d2998de89c24621cb07c0dc1915;p=firefly-linux-kernel-4.4.55.git net: stmmac: The netif_device_attach() should be called after napi_enable() If the netif_device_attach() is called earlier, the state of dev_queue is waked, txtimer might be modified, and the txtimer is added at same time. It might make run_timer_softirq crashed, because the timer is be detached twice together. Change-Id: I31dde4e940bddcc36372ca1f4a8313c0389d4e6b Signed-off-by: David Wu --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 9c2daa87b6d5..e2305197ad49 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3110,8 +3110,6 @@ int stmmac_resume(struct net_device *ndev) stmmac_mdio_reset(priv->mii); } - netif_device_attach(ndev); - spin_lock_irqsave(&priv->lock, flags); priv->cur_rx = 0; @@ -3128,6 +3126,8 @@ int stmmac_resume(struct net_device *ndev) netif_start_queue(ndev); + netif_device_attach(ndev); + spin_unlock_irqrestore(&priv->lock, flags); if (priv->phydev)