[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1iTnr8-00059T-Fs@rmk-PC.armlinux.org.uk>
Date: Sun, 10 Nov 2019 14:06:18 +0000
From: Russell King <rmk+kernel@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: [PATCH net-next 02/17] net: sfp: move tx disable on device down to
main state machine
Move the tx disable assertion on device down to the main state
machine.
Signed-off-by: Russell King <rmk+kernel@...linux.org.uk>
---
drivers/net/phy/sfp.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index f0e325324b23..47f204b227e8 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1491,15 +1491,8 @@ static void sfp_sm_device(struct sfp *sfp, unsigned int event)
break;
case SFP_DEV_UP:
- if (event == SFP_E_DEV_DOWN) {
- /* If the module has a PHY, avoid raising TX disable
- * as this resets the PHY. Otherwise, raise it to
- * turn the laser off.
- */
- if (!sfp->mod_phy)
- sfp_module_tx_disable(sfp);
+ if (event == SFP_E_DEV_DOWN)
sfp->sm_dev_state = SFP_DEV_DOWN;
- }
break;
}
}
@@ -1561,6 +1554,7 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event)
sfp_sm_link_down(sfp);
if (sfp->mod_phy)
sfp_sm_phy_detach(sfp);
+ sfp_module_tx_disable(sfp);
sfp_sm_next(sfp, SFP_S_DOWN, 0);
return;
}
--
2.20.1
Powered by blists - more mailing lists