diff mbox series

[net-next,v2,2/2] net: sfp: enhance quirk for Fibrestore 2.5G copper SFP module

Message ID 20240423085039.26957-2-kabel@kernel.org (mailing list archive)
State Accepted
Commit cd4a32e60061789676f7f018a94fcc9ec56732a0
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2,1/2] net: sfp: update comment for FS SFP-10G-T quirk | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: pabeni@redhat.com kuba@kernel.org edumazet@google.com
netdev/build_clang success Errors and warnings before: 937 this patch: 937
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 45 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-24--15-00 (tests: 995)

Commit Message

Marek Behún April 23, 2024, 8:50 a.m. UTC
Enhance the quirk for Fibrestore 2.5G copper SFP module. The original
commit e27aca3760c0 ("net: sfp: add quirk for FS's 2.5G copper SFP")
introducing the quirk says that the PHY is inaccessible, but that is
not true.

The module uses Rollball protocol to talk to the PHY, and needs a 4
second wait before probing it, same as FS 10G module.

The PHY inside the module is Realtek RTL8221B-VB-CG PHY. The realtek
driver recently gained support to set it up via clause 45 accesses.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
This patch depends on realtek driver changes merged in
  c31bd5b6ff6f ("Merge branch 'rtl8226b-serdes-switching'")
which are currently only in net-next.
---
 drivers/net/phy/sfp.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Comments

Jiri Pirko April 23, 2024, 11:41 a.m. UTC | #1
Tue, Apr 23, 2024 at 10:50:39AM CEST, kabel@kernel.org wrote:
>Enhance the quirk for Fibrestore 2.5G copper SFP module. The original
>commit e27aca3760c0 ("net: sfp: add quirk for FS's 2.5G copper SFP")
>introducing the quirk says that the PHY is inaccessible, but that is
>not true.
>
>The module uses Rollball protocol to talk to the PHY, and needs a 4
>second wait before probing it, same as FS 10G module.
>
>The PHY inside the module is Realtek RTL8221B-VB-CG PHY. The realtek
>driver recently gained support to set it up via clause 45 accesses.
>
>Signed-off-by: Marek Behún <kabel@kernel.org>
>---
>This patch depends on realtek driver changes merged in
>  c31bd5b6ff6f ("Merge branch 'rtl8226b-serdes-switching'")
>which are currently only in net-next.

I don't follow. You are targetting net-next (by patch subject), what's
the point of this comment?

Otherwise looks ok to me.
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Marek Behún April 23, 2024, 11:45 a.m. UTC | #2
On Tue, 23 Apr 2024 13:41:33 +0200
Jiri Pirko <jiri@resnulli.us> wrote:

> Tue, Apr 23, 2024 at 10:50:39AM CEST, kabel@kernel.org wrote:
> >Enhance the quirk for Fibrestore 2.5G copper SFP module. The original
> >commit e27aca3760c0 ("net: sfp: add quirk for FS's 2.5G copper SFP")
> >introducing the quirk says that the PHY is inaccessible, but that is
> >not true.
> >
> >The module uses Rollball protocol to talk to the PHY, and needs a 4
> >second wait before probing it, same as FS 10G module.
> >
> >The PHY inside the module is Realtek RTL8221B-VB-CG PHY. The realtek
> >driver recently gained support to set it up via clause 45 accesses.
> >
> >Signed-off-by: Marek Behún <kabel@kernel.org>
> >---
> >This patch depends on realtek driver changes merged in
> >  c31bd5b6ff6f ("Merge branch 'rtl8226b-serdes-switching'")
> >which are currently only in net-next.  
> 
> I don't follow. You are targetting net-next (by patch subject), what's
> the point of this comment?

I wrote that in case someone wanted me to send this to net, instead of
net-next.

Marek
diff mbox series

Patch

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 1af15f2da8a6..7d063cd3c6af 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -385,18 +385,23 @@  static void sfp_fixup_rollball(struct sfp *sfp)
 	sfp->phy_t_retry = msecs_to_jiffies(1000);
 }
 
-static void sfp_fixup_fs_10gt(struct sfp *sfp)
+static void sfp_fixup_fs_2_5gt(struct sfp *sfp)
 {
-	sfp_fixup_10gbaset_30m(sfp);
 	sfp_fixup_rollball(sfp);
 
-	/* The RollBall fixup is not enough for FS modules, the AQR chip inside
+	/* The RollBall fixup is not enough for FS modules, the PHY 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_fs_10gt(struct sfp *sfp)
+{
+	sfp_fixup_10gbaset_30m(sfp);
+	sfp_fixup_fs_2_5gt(sfp);
+}
+
 static void sfp_fixup_halny_gsfp(struct sfp *sfp)
 {
 	/* Ignore the TX_FAULT and LOS signals on this module.
@@ -473,6 +478,10 @@  static const struct sfp_quirk sfp_quirks[] = {
 	// PHY.
 	SFP_QUIRK_F("FS", "SFP-10G-T", sfp_fixup_fs_10gt),
 
+	// Fiberstore SFP-2.5G-T uses Rollball protocol to talk to the PHY and
+	// needs 4 sec wait before probing the PHY.
+	SFP_QUIRK_F("FS", "SFP-2.5G-T", sfp_fixup_fs_2_5gt),
+
 	// Fiberstore GPON-ONU-34-20BI can operate at 2500base-X, but report 1.2GBd
 	// NRZ in their EEPROM
 	SFP_QUIRK("FS", "GPON-ONU-34-20BI", sfp_quirk_2500basex,
@@ -489,9 +498,6 @@  static const struct sfp_quirk sfp_quirks[] = {
 	SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
 		  sfp_fixup_ignore_tx_fault),
 
-	// FS 2.5G Base-T
-	SFP_QUIRK_M("FS", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
-
 	// Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report
 	// 2500MBd NRZ in their EEPROM
 	SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex),