aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/xgbe/xgbe-main.c
diff options
context:
space:
mode:
authorLendacky, Thomas <Thomas.Lendacky@amd.com>2017-08-18 09:02:40 -0500
committerDavid S. Miller <davem@davemloft.net>2017-08-18 16:30:16 -0700
commit25ff96a9dc9c6a5a21778c36cb1e7175128d2071 (patch)
treeaa7791b31dc168f27919b6cd4a5729ff4d4fb3b0 /drivers/net/ethernet/amd/xgbe/xgbe-main.c
parentamd-xgbe: Set the MII control width for the MAC interface (diff)
downloadlinux-dev-25ff96a9dc9c6a5a21778c36cb1e7175128d2071.tar.xz
linux-dev-25ff96a9dc9c6a5a21778c36cb1e7175128d2071.zip
amd-xgbe: Be sure driver shuts down cleanly on module removal
Sometimes when the driver is being unloaded while the devices are still up the driver can issue errors. This is based on timing and the double invocation of some routines. The phy_exit() call needs to be run after the network device has been closed and unregistered from the system. Also, the phy_exit() does not need to invoke phy_stop() since that will be called as part of the device closing, so remove that call. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe/xgbe-main.c')
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index 500147d9e3c8..53a425cc7a2d 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -458,6 +458,8 @@ void xgbe_deconfig_netdev(struct xgbe_prv_data *pdata)
if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
xgbe_ptp_unregister(pdata);
+ unregister_netdev(netdev);
+
pdata->phy_if.phy_exit(pdata);
flush_workqueue(pdata->an_workqueue);
@@ -465,8 +467,6 @@ void xgbe_deconfig_netdev(struct xgbe_prv_data *pdata)
flush_workqueue(pdata->dev_workqueue);
destroy_workqueue(pdata->dev_workqueue);
-
- unregister_netdev(netdev);
}
static int __init xgbe_mod_init(void)