forked from Openwrt-EcoNet/openwrt
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.88 Manually rebased: - bcm27xx/patches-6.6/950-0327-media-i2c-ov7251-Make-the-enable-GPIO-optional.patch[1] - bcm27xx/patches-6.6/950-0521-PCI-brcmstb-Add-BCM2712-support.patch[2] - generic/hack-6.6/610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch[3] - generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch[4] All other patches automatically rebased. 1. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.88&id=f249c05416ea0bef24c9dbed0e653d2fad87b127 2. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.88&id=1fea7726276e5d6526ecd4e7ccb4c91a6135deb5 3. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.88&id=95f17738b86fd198924d874a5639bcdc49c7e5b8 4. https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.88&id=a2874f0dff63829d1f540003e2d83adb610ee64a Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Link: https://github.com/openwrt/openwrt/pull/18607 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
86 lines
2.8 KiB
Diff
86 lines
2.8 KiB
Diff
From e9301af385e7864dea353f5e58cad7339dd6c718 Mon Sep 17 00:00:00 2001
|
|
From: Marek Behún <kabel@kernel.org>
|
|
Date: Tue, 19 Dec 2023 17:24:15 +0100
|
|
Subject: net: sfp: fix PHY discovery for FS SFP-10G-T module
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Commit 2f3ce7a56c6e ("net: sfp: rework the RollBall PHY waiting code")
|
|
changed the long wait before accessing RollBall / FS modules into
|
|
probing for PHY every 1 second, and trying 25 times.
|
|
|
|
Wei Lei reports that this does not work correctly on FS modules: when
|
|
initializing, they may report values different from 0xffff in PHY ID
|
|
registers for some MMDs, causing get_phy_c45_ids() to find some bogus
|
|
MMD.
|
|
|
|
Fix this by adding the module_t_wait member back, and setting it to 4
|
|
seconds for FS modules.
|
|
|
|
Fixes: 2f3ce7a56c6e ("net: sfp: rework the RollBall PHY waiting code")
|
|
Reported-by: Wei Lei <quic_leiwei@quicinc.com>
|
|
Signed-off-by: Marek Behún <kabel@kernel.org>
|
|
Tested-by: Lei Wei <quic_leiwei@quicinc.com>
|
|
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
---
|
|
drivers/net/phy/sfp.c | 17 +++++++++++++----
|
|
1 file changed, 13 insertions(+), 4 deletions(-)
|
|
|
|
--- a/drivers/net/phy/sfp.c
|
|
+++ b/drivers/net/phy/sfp.c
|
|
@@ -274,6 +274,7 @@ struct sfp {
|
|
struct sfp_eeprom_id id;
|
|
unsigned int module_power_mW;
|
|
unsigned int module_t_start_up;
|
|
+ unsigned int module_t_wait;
|
|
unsigned int phy_t_retry;
|
|
|
|
unsigned int rate_kbd;
|
|
@@ -373,6 +374,12 @@ static void sfp_fixup_fs_10gt(struct sfp
|
|
{
|
|
sfp_fixup_10gbaset_30m(sfp);
|
|
sfp_fixup_rollball(sfp);
|
|
+
|
|
+ /* The RollBall fixup is not enough for FS modules, the AQR chip inside
|
|
+ * them does not return 0xffff for PHY ID registers in all MMDs for the
|
|
+ * while initializing. They need a 4 second wait before accessing PHY.
|
|
+ */
|
|
+ sfp->module_t_wait = msecs_to_jiffies(4000);
|
|
}
|
|
|
|
static void sfp_fixup_halny_gsfp(struct sfp *sfp)
|
|
@@ -2320,6 +2327,7 @@ static int sfp_sm_mod_probe(struct sfp *
|
|
mask |= SFP_F_RS1;
|
|
|
|
sfp->module_t_start_up = T_START_UP;
|
|
+ sfp->module_t_wait = T_WAIT;
|
|
sfp->phy_t_retry = T_PHY_RETRY;
|
|
|
|
sfp->state_ignore_mask = 0;
|
|
@@ -2556,9 +2564,10 @@ static void sfp_sm_main(struct sfp *sfp,
|
|
|
|
/* We need to check the TX_FAULT state, which is not defined
|
|
* while TX_DISABLE is asserted. The earliest we want to do
|
|
- * anything (such as probe for a PHY) is 50ms.
|
|
+ * anything (such as probe for a PHY) is 50ms (or more on
|
|
+ * specific modules).
|
|
*/
|
|
- sfp_sm_next(sfp, SFP_S_WAIT, T_WAIT);
|
|
+ sfp_sm_next(sfp, SFP_S_WAIT, sfp->module_t_wait);
|
|
break;
|
|
|
|
case SFP_S_WAIT:
|
|
@@ -2572,8 +2581,8 @@ static void sfp_sm_main(struct sfp *sfp,
|
|
* deasserting.
|
|
*/
|
|
timeout = sfp->module_t_start_up;
|
|
- if (timeout > T_WAIT)
|
|
- timeout -= T_WAIT;
|
|
+ if (timeout > sfp->module_t_wait)
|
|
+ timeout -= sfp->module_t_wait;
|
|
else
|
|
timeout = 1;
|
|
|