From fa3b8e0c40cc5aed9fdd9f2411d6b83f3ef912f6 Mon Sep 17 00:00:00 2001 From: David Wu Date: Fri, 28 Apr 2017 17:41:43 +0800 Subject: [PATCH] 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 --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index f10fca4d9dc8..0e95802a6fc4 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4566,8 +4566,6 @@ int stmmac_resume(struct device *dev) stmmac_mdio_reset(priv->mii); } - netif_device_attach(ndev); - mutex_lock(&priv->lock); stmmac_reset_queues_param(priv); @@ -4582,6 +4580,8 @@ int stmmac_resume(struct device *dev) stmmac_start_all_queues(priv); + netif_device_attach(ndev); + mutex_unlock(&priv->lock); if (ndev->phydev)