From 10b12b5d687215d4f9dfd3bb4012d861ebdad84f Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 4 Dec 2019 23:09:41 +0100 Subject: kernel: sfp: add two fixes submitted to upstream Add two small fixes for SFP that were submitted upstream. Signed-off-by: Jonas Gorski --- .../pending-4.19/754-net-sfp-fix-unbind.patch | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 target/linux/generic/pending-4.19/754-net-sfp-fix-unbind.patch (limited to 'target/linux/generic/pending-4.19/754-net-sfp-fix-unbind.patch') diff --git a/target/linux/generic/pending-4.19/754-net-sfp-fix-unbind.patch b/target/linux/generic/pending-4.19/754-net-sfp-fix-unbind.patch new file mode 100644 index 0000000000..3172249a10 --- /dev/null +++ b/target/linux/generic/pending-4.19/754-net-sfp-fix-unbind.patch @@ -0,0 +1,28 @@ +From 729fd05aac22cdf1e502fbf1bf80e5ebba0d9fbc Mon Sep 17 00:00:00 2001 +From: Russell King +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 +--- + drivers/net/phy/sfp.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -2242,6 +2242,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; + } + -- cgit v1.2.3