721-v5.5-net-sfp-move-tx-disable-on-device-down-to-main-state.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 7e89b737c97a9e7a81dd1584000bc136b92f12fd Mon Sep 17 00:00:00 2001
  2. From: Russell King <[email protected]>
  3. Date: Fri, 11 Oct 2019 22:14:47 +0100
  4. Subject: [PATCH 619/660] net: sfp: move tx disable on device down to main
  5. state machine
  6. Move the tx disable assertion on device down to the main state
  7. machine.
  8. Signed-off-by: Russell King <[email protected]>
  9. ---
  10. drivers/net/phy/sfp.c | 10 ++--------
  11. 1 file changed, 2 insertions(+), 8 deletions(-)
  12. --- a/drivers/net/phy/sfp.c
  13. +++ b/drivers/net/phy/sfp.c
  14. @@ -1489,15 +1489,8 @@ static void sfp_sm_device(struct sfp *sf
  15. break;
  16. case SFP_DEV_UP:
  17. - if (event == SFP_E_DEV_DOWN) {
  18. - /* If the module has a PHY, avoid raising TX disable
  19. - * as this resets the PHY. Otherwise, raise it to
  20. - * turn the laser off.
  21. - */
  22. - if (!sfp->mod_phy)
  23. - sfp_module_tx_disable(sfp);
  24. + if (event == SFP_E_DEV_DOWN)
  25. sfp->sm_dev_state = SFP_DEV_DOWN;
  26. - }
  27. break;
  28. }
  29. }
  30. @@ -1559,6 +1552,7 @@ static void sfp_sm_main(struct sfp *sfp,
  31. sfp_sm_link_down(sfp);
  32. if (sfp->mod_phy)
  33. sfp_sm_phy_detach(sfp);
  34. + sfp_module_tx_disable(sfp);
  35. sfp_sm_next(sfp, SFP_S_DOWN, 0);
  36. return;
  37. }