diff mbox series

[net-next] net: sfp: add quirk for FS SFP-10GM-T copper SFP+ module

Message ID 20250226141002.1214000-1-ms@dev.tdt.de (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: sfp: add quirk for FS SFP-10GM-T copper SFP+ module | 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: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
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: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 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

Commit Message

Martin Schiller Feb. 26, 2025, 2:10 p.m. UTC
Add quirk for a copper SFP that identifies itself as "FS" "SFP-10GM-T".
It uses RollBall protocol to talk to the PHY and needs 4 sec wait before
probing the PHY.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
---
 drivers/net/phy/sfp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Russell King (Oracle) Feb. 26, 2025, 2:38 p.m. UTC | #1
On Wed, Feb 26, 2025 at 03:10:02PM +0100, Martin Schiller wrote:
> Add quirk for a copper SFP that identifies itself as "FS" "SFP-10GM-T".
> It uses RollBall protocol to talk to the PHY and needs 4 sec wait before
> probing the PHY.
> 
> Signed-off-by: Martin Schiller <ms@dev.tdt.de>
> ---
>  drivers/net/phy/sfp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
> index 9369f5297769..15284be4c38c 100644
> --- a/drivers/net/phy/sfp.c
> +++ b/drivers/net/phy/sfp.c
> @@ -479,9 +479,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.
> +	// Fiberstore SFP-2.5G-T and SFP-10GM-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),
> +	SFP_QUIRK_F("FS", "SFP-10GM-T", sfp_fixup_fs_2_5gt),

Which makes sfp_fixup_fs_2_5gt mis-named. Please rename.
Martin Schiller Feb. 26, 2025, 2:50 p.m. UTC | #2
On 2025-02-26 15:38, Russell King (Oracle) wrote:
> On Wed, Feb 26, 2025 at 03:10:02PM +0100, Martin Schiller wrote:
>> Add quirk for a copper SFP that identifies itself as "FS" 
>> "SFP-10GM-T".
>> It uses RollBall protocol to talk to the PHY and needs 4 sec wait 
>> before
>> probing the PHY.
>> 
>> Signed-off-by: Martin Schiller <ms@dev.tdt.de>
>> ---
>>  drivers/net/phy/sfp.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
>> index 9369f5297769..15284be4c38c 100644
>> --- a/drivers/net/phy/sfp.c
>> +++ b/drivers/net/phy/sfp.c
>> @@ -479,9 +479,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.
>> +	// Fiberstore SFP-2.5G-T and SFP-10GM-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),
>> +	SFP_QUIRK_F("FS", "SFP-10GM-T", sfp_fixup_fs_2_5gt),
> 
> Which makes sfp_fixup_fs_2_5gt mis-named. Please rename.

OK, I'll rename it to sfp_fixup_rollball_wait.
Kory Maincent Feb. 26, 2025, 3:26 p.m. UTC | #3
On Wed, 26 Feb 2025 15:50:46 +0100
Martin Schiller <ms@dev.tdt.de> wrote:

> On 2025-02-26 15:38, Russell King (Oracle) wrote:
> > On Wed, Feb 26, 2025 at 03:10:02PM +0100, Martin Schiller wrote:  
> >> Add quirk for a copper SFP that identifies itself as "FS" 
> >> "SFP-10GM-T".
> >> It uses RollBall protocol to talk to the PHY and needs 4 sec wait 
> >> before
> >> probing the PHY.
> >> 
> >> Signed-off-by: Martin Schiller <ms@dev.tdt.de>
> >> ---
> >>  drivers/net/phy/sfp.c | 5 +++--
> >>  1 file changed, 3 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
> >> index 9369f5297769..15284be4c38c 100644
> >> --- a/drivers/net/phy/sfp.c
> >> +++ b/drivers/net/phy/sfp.c
> >> @@ -479,9 +479,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.
> >> +	// Fiberstore SFP-2.5G-T and SFP-10GM-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),
> >> +	SFP_QUIRK_F("FS", "SFP-10GM-T", sfp_fixup_fs_2_5gt),  
> > 
> > Which makes sfp_fixup_fs_2_5gt mis-named. Please rename.  
> 
> OK, I'll rename it to sfp_fixup_rollball_wait.

I would prefer sfp_fixup_fs_rollball_wait to keep the name of the manufacturer.
It can't be a generic fixup as other FSP could have other waiting time values
like the Turris RTSFP-10G which needs 25s.
Martin Schiller Feb. 26, 2025, 3:55 p.m. UTC | #4
On 2025-02-26 16:26, Kory Maincent wrote:
> On Wed, 26 Feb 2025 15:50:46 +0100
> Martin Schiller <ms@dev.tdt.de> wrote:
> 
>> On 2025-02-26 15:38, Russell King (Oracle) wrote:
>> > On Wed, Feb 26, 2025 at 03:10:02PM +0100, Martin Schiller wrote:
>> >> Add quirk for a copper SFP that identifies itself as "FS"
>> >> "SFP-10GM-T".
>> >> It uses RollBall protocol to talk to the PHY and needs 4 sec wait
>> >> before
>> >> probing the PHY.
>> >>
>> >> Signed-off-by: Martin Schiller <ms@dev.tdt.de>
>> >> ---
>> >>  drivers/net/phy/sfp.c | 5 +++--
>> >>  1 file changed, 3 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
>> >> index 9369f5297769..15284be4c38c 100644
>> >> --- a/drivers/net/phy/sfp.c
>> >> +++ b/drivers/net/phy/sfp.c
>> >> @@ -479,9 +479,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.
>> >> +	// Fiberstore SFP-2.5G-T and SFP-10GM-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),
>> >> +	SFP_QUIRK_F("FS", "SFP-10GM-T", sfp_fixup_fs_2_5gt),
>> >
>> > Which makes sfp_fixup_fs_2_5gt mis-named. Please rename.
>> 
>> OK, I'll rename it to sfp_fixup_rollball_wait.
> 
> I would prefer sfp_fixup_fs_rollball_wait to keep the name of the 
> manufacturer.
> It can't be a generic fixup as other FSP could have other waiting time 
> values
> like the Turris RTSFP-10G which needs 25s.

I think you're getting two things mixed up.
The phy still has 25 seconds to wake up. With sfp_fixup_rollball_wait
there simply is an additional 4s wait at the beginning before we start
searching for a phy.
Kory Maincent Feb. 26, 2025, 4:27 p.m. UTC | #5
On Wed, 26 Feb 2025 16:55:38 +0100
Martin Schiller <ms@dev.tdt.de> wrote:

> On 2025-02-26 16:26, Kory Maincent wrote:
> > On Wed, 26 Feb 2025 15:50:46 +0100
> > Martin Schiller <ms@dev.tdt.de> wrote:
> >   
> >> On 2025-02-26 15:38, Russell King (Oracle) wrote:  
>  [...]  
>  [...]  
>  [...]  
> >> 
> >> OK, I'll rename it to sfp_fixup_rollball_wait.  
> > 
> > I would prefer sfp_fixup_fs_rollball_wait to keep the name of the 
> > manufacturer.
> > It can't be a generic fixup as other FSP could have other waiting time 
> > values
> > like the Turris RTSFP-10G which needs 25s.  
> 
> I think you're getting two things mixed up.
> The phy still has 25 seconds to wake up. With sfp_fixup_rollball_wait
> there simply is an additional 4s wait at the beginning before we start
> searching for a phy.

Indeed you are right, I was looking in older Linux sources, sorry.
Still, the additional 4s wait seems relevant only for FS SFP, so it should
be included in the function naming to avoid confusion.

Regards,
Martin Schiller Feb. 26, 2025, 4:51 p.m. UTC | #6
On 2025-02-26 17:27, Kory Maincent wrote:
> On Wed, 26 Feb 2025 16:55:38 +0100
> Martin Schiller <ms@dev.tdt.de> wrote:
> 
>> On 2025-02-26 16:26, Kory Maincent wrote:
>> > On Wed, 26 Feb 2025 15:50:46 +0100
>> > Martin Schiller <ms@dev.tdt.de> wrote:
>> >
>> >> On 2025-02-26 15:38, Russell King (Oracle) wrote:
>>  [...]
>>  [...]
>>  [...]
>> >>
>> >> OK, I'll rename it to sfp_fixup_rollball_wait.
>> >
>> > I would prefer sfp_fixup_fs_rollball_wait to keep the name of the
>> > manufacturer.
>> > It can't be a generic fixup as other FSP could have other waiting time
>> > values
>> > like the Turris RTSFP-10G which needs 25s.
>> 
>> I think you're getting two things mixed up.
>> The phy still has 25 seconds to wake up. With sfp_fixup_rollball_wait
>> there simply is an additional 4s wait at the beginning before we start
>> searching for a phy.
> 
> Indeed you are right, I was looking in older Linux sources, sorry.
> Still, the additional 4s wait seems relevant only for FS SFP, so it 
> should
> be included in the function naming to avoid confusion.
> 

You may be right for the moment. But perhaps there will soon be SFP
modules from other manufacturers that also need this quirk.

There is also the function sfp_fixup_rollball_cc, which is currently
only used for modules with vendor string “OEM”. However, the function is
not called sfp_fixup_oem_rollball_cc.

Regards,
Martin
Andrew Lunn Feb. 26, 2025, 4:56 p.m. UTC | #7
On Wed, Feb 26, 2025 at 05:51:42PM +0100, Martin Schiller wrote:
> On 2025-02-26 17:27, Kory Maincent wrote:
> > On Wed, 26 Feb 2025 16:55:38 +0100
> > Martin Schiller <ms@dev.tdt.de> wrote:
> > 
> > > On 2025-02-26 16:26, Kory Maincent wrote:
> > > > On Wed, 26 Feb 2025 15:50:46 +0100
> > > > Martin Schiller <ms@dev.tdt.de> wrote:
> > > >
> > > >> On 2025-02-26 15:38, Russell King (Oracle) wrote:
> > >  [...]
> > >  [...]
> > >  [...]
> > > >>
> > > >> OK, I'll rename it to sfp_fixup_rollball_wait.
> > > >
> > > > I would prefer sfp_fixup_fs_rollball_wait to keep the name of the
> > > > manufacturer.
> > > > It can't be a generic fixup as other FSP could have other waiting time
> > > > values
> > > > like the Turris RTSFP-10G which needs 25s.
> > > 
> > > I think you're getting two things mixed up.
> > > The phy still has 25 seconds to wake up. With sfp_fixup_rollball_wait
> > > there simply is an additional 4s wait at the beginning before we start
> > > searching for a phy.
> > 
> > Indeed you are right, I was looking in older Linux sources, sorry.
> > Still, the additional 4s wait seems relevant only for FS SFP, so it
> > should
> > be included in the function naming to avoid confusion.
> > 
> 
> You may be right for the moment. But perhaps there will soon be SFP
> modules from other manufacturers that also need this quirk.

Since these are all kernel internal implementation details, we can
rename them any time we want. There is no kernel ABI involved. So
please use a name based on what we know now. If such a module does
appear sometime in the future, we can change the name at that point.

       Andrew
Kory Maincent Feb. 26, 2025, 5 p.m. UTC | #8
On Wed, 26 Feb 2025 17:51:42 +0100
Martin Schiller <ms@dev.tdt.de> wrote:

> On 2025-02-26 17:27, Kory Maincent wrote:
> > On Wed, 26 Feb 2025 16:55:38 +0100
> > Martin Schiller <ms@dev.tdt.de> wrote:
> >   
> >> On 2025-02-26 16:26, Kory Maincent wrote:  
>  [...]  
>  [...]  
> >>  [...]
> >>  [...]
> >>  [...]  
>  [...]  
>  [...]  
> >> 
> >> I think you're getting two things mixed up.
> >> The phy still has 25 seconds to wake up. With sfp_fixup_rollball_wait
> >> there simply is an additional 4s wait at the beginning before we start
> >> searching for a phy.  
> > 
> > Indeed you are right, I was looking in older Linux sources, sorry.
> > Still, the additional 4s wait seems relevant only for FS SFP, so it 
> > should
> > be included in the function naming to avoid confusion.
> >   
> 
> You may be right for the moment. But perhaps there will soon be SFP
> modules from other manufacturers that also need this quirk.
> 
> There is also the function sfp_fixup_rollball_cc, which is currently
> only used for modules with vendor string “OEM”. However, the function is
> not called sfp_fixup_oem_rollball_cc.

Indeed. As you prefer then.

Regards,
diff mbox series

Patch

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 9369f5297769..15284be4c38c 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -479,9 +479,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.
+	// Fiberstore SFP-2.5G-T and SFP-10GM-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),
+	SFP_QUIRK_F("FS", "SFP-10GM-T", sfp_fixup_fs_2_5gt),
 
 	// Fiberstore GPON-ONU-34-20BI can operate at 2500base-X, but report 1.2GBd
 	// NRZ in their EEPROM