2
0

754-net-sfp-fix-unbind.patch 848 B

12345678910111213141516171819202122232425262728
  1. From 729fd05aac22cdf1e502fbf1bf80e5ebba0d9fbc Mon Sep 17 00:00:00 2001
  2. From: Russell King <[email protected]>
  3. Date: Tue, 3 Dec 2019 17:48:28 +0000
  4. Subject: [PATCH] net: sfp: fix unbind
  5. When unbinding, we don't correctly tear down the module state, leaving
  6. (for example) the hwmon registration behind. Ensure everything is
  7. properly removed by sending a remove event at unbind.
  8. Fixes: 6b0da5c9c1a3 ("net: sfp: track upstream's attachment state in state machine")
  9. Signed-off-by: Russell King <[email protected]>
  10. ---
  11. drivers/net/phy/sfp.c | 4 ++++
  12. 1 file changed, 4 insertions(+)
  13. --- a/drivers/net/phy/sfp.c
  14. +++ b/drivers/net/phy/sfp.c
  15. @@ -2344,6 +2344,10 @@ static int sfp_remove(struct platform_de
  16. sfp_unregister_socket(sfp->sfp_bus);
  17. + rtnl_lock();
  18. + sfp_sm_event(sfp, SFP_E_REMOVE);
  19. + rtnl_unlock();
  20. +
  21. return 0;
  22. }