[PATCH 15/20] net: stmmac: Discard STMMAC_RESETING flag
Serge Semin
Sergey.Semin at baikalelectronics.ru
Mon Feb 8 09:03:36 EST 2021
That flag is totally useless. It's set inside a non-reentrant
mutex-protected section. For the same reason the test-and-set loop is also
pointless. The flag is also unused anywhere else in the driver. So just
drop it.
Signed-off-by: Serge Semin <Sergey.Semin at baikalelectronics.ru>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 -
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ---
2 files changed, 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index e444b1b237c0..3e2bf7e2dafb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -248,7 +248,6 @@ struct stmmac_priv {
enum stmmac_state {
STMMAC_DOWN,
STMMAC_RESET_REQUESTED,
- STMMAC_RESETING,
STMMAC_SERVICE_SCHED,
};
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index abe8db9965f4..16e08cfaadf0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4669,14 +4669,11 @@ static void stmmac_reset_subtask(struct stmmac_priv *priv)
rtnl_lock();
netif_trans_update(priv->dev);
- while (test_and_set_bit(STMMAC_RESETING, &priv->state))
- usleep_range(1000, 2000);
set_bit(STMMAC_DOWN, &priv->state);
dev_close(priv->dev);
dev_open(priv->dev, NULL);
clear_bit(STMMAC_DOWN, &priv->state);
- clear_bit(STMMAC_RESETING, &priv->state);
rtnl_unlock();
}
--
2.29.2
More information about the linux-arm-kernel
mailing list