<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 7e89b737c97a9e7a81dd1584000bc136b92f12fd Mon Sep 17 00:00:00 2001
From: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Date: Fri, 11 Oct 2019 22:14:47 +0100
Subject: [PATCH 619/660] 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 &lt;rmk+kernel@armlinux.org.uk&gt;
---
 drivers/net/phy/sfp.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1554,15 +1554,8 @@ static void sfp_sm_device(struct sfp *sf
 		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-&gt;mod_phy)
-				sfp_module_tx_disable(sfp);
+		if (event == SFP_E_DEV_DOWN)
 			sfp-&gt;sm_dev_state = SFP_DEV_DOWN;
-		}
 		break;
 	}
 }
@@ -1624,6 +1617,7 @@ static void sfp_sm_main(struct sfp *sfp,
 			sfp_sm_link_down(sfp);
 		if (sfp-&gt;mod_phy)
 			sfp_sm_phy_detach(sfp);
+		sfp_module_tx_disable(sfp);
 		sfp_sm_next(sfp, SFP_S_DOWN, 0);
 		return;
 	}
</pre></body></html>