Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25ff96a9 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller
Browse files

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: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f087b506
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -458,6 +458,8 @@ void xgbe_deconfig_netdev(struct xgbe_prv_data *pdata)
	if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
	if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
		xgbe_ptp_unregister(pdata);
		xgbe_ptp_unregister(pdata);


	unregister_netdev(netdev);

	pdata->phy_if.phy_exit(pdata);
	pdata->phy_if.phy_exit(pdata);


	flush_workqueue(pdata->an_workqueue);
	flush_workqueue(pdata->an_workqueue);
@@ -465,8 +467,6 @@ void xgbe_deconfig_netdev(struct xgbe_prv_data *pdata)


	flush_workqueue(pdata->dev_workqueue);
	flush_workqueue(pdata->dev_workqueue);
	destroy_workqueue(pdata->dev_workqueue);
	destroy_workqueue(pdata->dev_workqueue);

	unregister_netdev(netdev);
}
}


static int __init xgbe_mod_init(void)
static int __init xgbe_mod_init(void)
+0 −2
Original line number Original line Diff line number Diff line
@@ -1533,8 +1533,6 @@ static int xgbe_phy_best_advertised_speed(struct xgbe_prv_data *pdata)


static void xgbe_phy_exit(struct xgbe_prv_data *pdata)
static void xgbe_phy_exit(struct xgbe_prv_data *pdata)
{
{
	xgbe_phy_stop(pdata);

	pdata->phy_if.phy_impl.exit(pdata);
	pdata->phy_if.phy_impl.exit(pdata);
}
}