[PATCH 04/20] net: stmmac: Assert reset control after MDIO de-registration
From: Serge Semin
Date: Mon Feb 08 2021 - 09:22:53 EST
Indeed it's unlikely but MDIO de-registration may still require an access
to the core registers, which obviously won't be possible in case if the
interface has been put into the reset state. So move the reset control
assertion to be executed after the MDIO bus is de-registered.
Signed-off-by: Serge Semin <Sergey.Semin@xxxxxxxxxxxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d45af1ea2565..1c40dc26fbf7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5159,10 +5159,10 @@ int stmmac_dvr_remove(struct device *dev)
stmmac_exit_fs(ndev);
#endif
phylink_destroy(priv->phylink);
- reset_control_assert(priv->plat->stmmac_rst);
if (priv->hw->pcs != STMMAC_PCS_TBI &&
priv->hw->pcs != STMMAC_PCS_RTBI)
stmmac_mdio_unregister(ndev);
+ reset_control_assert(priv->plat->stmmac_rst);
destroy_workqueue(priv->wq);
mutex_destroy(&priv->lock);
--
2.29.2