summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-10-17 11:12:42 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2019-11-25 12:05:40 +0000
commit585a4996c0b4755c909a87f5ae427360c66fcdce (patch)
tree91920283088bcfef88dbd51a9019b440317eb3a9
parent0240772461349a25b8387b1926ca4fbbcfe43f83 (diff)
net: sfp: control TX_DISABLE and phy only from main state machine
We initialise TX_DISABLE when the sfp cage is probed, and then maintain its state in the main state machine. However, the module state machine: - negates it when detecting a newly inserted module when it's already guaranteed to be negated. - negates it when the module is removed, but the main state machine will do this anyway. Make TX_DISABLE entirely controlled by the main state machine. The main state machine also probes the module for a PHY, and removes the PHY when the the module is removed. Hence, removing the PHY in sfp_sm_module_remove() is also redundant, and is a left-over from when we tried to probe for the PHY from the module state machine. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/sfp.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index d8efa1d3a903..e0bc060bb693 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1557,11 +1557,6 @@ static void sfp_sm_mod_remove(struct sfp *sfp)
sfp_hwmon_remove(sfp);
- if (sfp->mod_phy)
- sfp_sm_phy_detach(sfp);
-
- sfp_module_tx_disable(sfp);
-
memset(&sfp->id, 0, sizeof(sfp->id));
sfp->module_power_mW = 0;
@@ -1599,10 +1594,8 @@ static void sfp_sm_module(struct sfp *sfp, unsigned int event)
switch (sfp->sm_mod_state) {
default:
- if (event == SFP_E_INSERT && sfp->attached) {
- sfp_module_tx_disable(sfp);
+ if (event == SFP_E_INSERT && sfp->attached)
sfp_sm_mod_next(sfp, SFP_MOD_PROBE, T_SERIAL);
- }
break;
case SFP_MOD_PROBE: