openwrt/target/linux/generic/hack-5.15/790-SFP-GE-T-ignore-TX_FAULT.patch
John Audia 3887a55909 kernel: bump 5.15 to 5.15.108
Removed upstreamed:
	backport-5.15/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch[1]
	backport-5.15/612-v6.3-skbuff-Fix-a-race-between-coalescing-and-releasing-S.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.108&id=85d7a7044b759d865d10395a357632af00de5867
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.108&id=906a6689bb0191ad2a44131a3377006aa098af59

Build system: x86_64
Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-22 01:10:24 +02:00

66 lines
2.3 KiB
Diff

From 7cc39a6bedbd85f3ff7e16845f310e4ce8d9833f Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Tue, 6 Sep 2022 00:31:19 +0100
Subject: [PATCH] net: sfp: add quirk for ATS SFP-GE-T 1000Base-TX module
To: netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Russell King <linux@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>
Cc: David S. Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Josef Schlehofer <pepe.schlehofer@gmail.com>
This copper module comes with broken TX_FAULT indicator which must be
ignored for it to work. Implement ignoring TX_FAULT state bit also
during reset/insertion and mute the warning telling the user that the
module indicates TX_FAULT.
Co-authored-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
drivers/net/phy/sfp.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -383,6 +383,11 @@ static const struct sfp_quirk sfp_quirks
.modes = sfp_quirk_2500basex,
.fixup = sfp_fixup_ignore_tx_fault,
}, {
+ // OEM SFP-GE-T is 1000Base-T module
+ .vendor = "OEM",
+ .part = "SFP-GE-T",
+ .fixup = sfp_fixup_ignore_tx_fault,
+ }, {
// Lantech 8330-262D-E can operate at 2500base-X, but
// incorrectly report 2500MBd NRZ in their EEPROM
.vendor = "Lantech",
@@ -2312,7 +2317,8 @@ static void sfp_sm_main(struct sfp *sfp,
* or t_start_up, so assume there is a fault.
*/
sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT,
- sfp->sm_fault_retries == N_FAULT_INIT);
+ !sfp->tx_fault_ignore &&
+ (sfp->sm_fault_retries == N_FAULT_INIT));
} else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) {
init_done:
sfp->sm_phy_retries = R_PHY_RETRY;
@@ -2535,10 +2541,12 @@ static void sfp_check_state(struct sfp *
mutex_lock(&sfp->st_mutex);
state = sfp_get_state(sfp);
changed = state ^ sfp->state;
- if (sfp->tx_fault_ignore)
+ if (sfp->tx_fault_ignore) {
changed &= SFP_F_PRESENT | SFP_F_LOS;
- else
+ state &= ~SFP_F_TX_FAULT;
+ } else {
changed &= SFP_F_PRESENT | SFP_F_LOS | SFP_F_TX_FAULT;
+ }
for (i = 0; i < GPIO_MAX; i++)
if (changed & BIT(i))