Openwrt/target/linux/generic/pending-5.4/754-net-sfp-fix-unbind.patch
Vladimir Markovets f032601ed7 kernel: backport workaround for Realtek RTL8672 and RTL9601C chips
Adds support for GPON SFP modules based on the Realtek RTL8672 and
RTL9601C chips, including but not limited to:
* V-SOL V2801F
* C-Data FD511GX-RM0
* OPTON GP801R
* BAUDCOM BD-1234-SFM
* CPGOS03-0490 v2.0
* Ubiquiti U-Fiber Instant
* EXOT EGS1

Signed-off-by: Vladimir Markovets <abam_a@yahoo.com>
2021-07-25 13:52:38 +02:00

29 lines
848 B
Diff

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