mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 01:11:14 +00:00
f032601ed7
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>
45 lines
1.3 KiB
Diff
45 lines
1.3 KiB
Diff
From 5eb0df5023c6ae8a71a7848fd5e1f788d86e51ae Mon Sep 17 00:00:00 2001
|
|
From: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Date: Tue, 3 Dec 2019 18:46:04 +0000
|
|
Subject: [PATCH] net: sfp: fix hwmon
|
|
|
|
The referenced commit below allowed more than one hwmon device to be
|
|
created per SFP, which is definitely not what we want. Avoid this by
|
|
only creating the hwmon device just as we transition to WAITDEV state.
|
|
|
|
Fixes: 139d3a212a1f ("net: sfp: allow modules with slow diagnostics to probe")
|
|
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
---
|
|
drivers/net/phy/sfp.c | 13 ++++---------
|
|
1 file changed, 4 insertions(+), 9 deletions(-)
|
|
|
|
--- a/drivers/net/phy/sfp.c
|
|
+++ b/drivers/net/phy/sfp.c
|
|
@@ -1883,6 +1883,10 @@ static void sfp_sm_module(struct sfp *sf
|
|
break;
|
|
}
|
|
|
|
+ err = sfp_hwmon_insert(sfp);
|
|
+ if (err)
|
|
+ dev_warn(sfp->dev, "hwmon probe failed: %d\n", err);
|
|
+
|
|
sfp_sm_mod_next(sfp, SFP_MOD_WAITDEV, 0);
|
|
/* fall through */
|
|
case SFP_MOD_WAITDEV:
|
|
@@ -1932,15 +1936,6 @@ static void sfp_sm_module(struct sfp *sf
|
|
case SFP_MOD_ERROR:
|
|
break;
|
|
}
|
|
-
|
|
-#if IS_ENABLED(CONFIG_HWMON)
|
|
- if (sfp->sm_mod_state >= SFP_MOD_WAITDEV &&
|
|
- IS_ERR_OR_NULL(sfp->hwmon_dev)) {
|
|
- err = sfp_hwmon_insert(sfp);
|
|
- if (err)
|
|
- dev_warn(sfp->dev, "hwmon probe failed: %d\n", err);
|
|
- }
|
|
-#endif
|
|
}
|
|
|
|
static void sfp_sm_main(struct sfp *sfp, unsigned int event)
|