710-net-phy-sfp-re-probe-modules-on-DEV_UP-event.patch 906 B

1234567891011121314151617181920212223242526
  1. From a381ac0aa281fdb0b41a39d8a2bc08fd88f6db92 Mon Sep 17 00:00:00 2001
  2. From: Antoine Tenart <[email protected]>
  3. Date: Tue, 25 Feb 2020 16:32:37 +0100
  4. Subject: [PATCH 1/3] net: phy: sfp: re-probe modules on DEV_UP event
  5. Signed-off-by: Antoine Tenart <[email protected]>
  6. ---
  7. drivers/net/phy/sfp.c | 7 +++++++
  8. 1 file changed, 7 insertions(+)
  9. --- a/drivers/net/phy/sfp.c
  10. +++ b/drivers/net/phy/sfp.c
  11. @@ -2160,6 +2160,13 @@ static void sfp_sm_module(struct sfp *sf
  12. return;
  13. }
  14. + /* Re-probe the SFP modules when an interface is brought up, as the MAC
  15. + * do not report its link status (This means Phylink wouldn't be
  16. + * triggered if the PHY had a link before a MAC is brought up).
  17. + */
  18. + if (event == SFP_E_DEV_UP && sfp->sm_mod_state == SFP_MOD_PRESENT)
  19. + sfp_sm_mod_next(sfp, SFP_MOD_PROBE, T_SERIAL);
  20. +
  21. switch (sfp->sm_mod_state) {
  22. default:
  23. if (event == SFP_E_INSERT) {