2020-03-03 07:44:54

by Oleksij Rempel

[permalink] [raw]
Subject: [PATCH v1] net: dsa: sja1105: add 100baseT1_Full support

Validate 100baseT1_Full to make this driver work with TJA1102 PHY.

Signed-off-by: Oleksij Rempel <[email protected]>
---
drivers/net/dsa/sja1105/sja1105_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index 34544b1c30dc..7b5a80ba12bd 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -866,6 +866,7 @@ static void sja1105_phylink_validate(struct dsa_switch *ds, int port,
phylink_set(mask, MII);
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Full);
+ phylink_set(mask, 100baseT1_Full);
if (mii->xmii_mode[port] == XMII_MODE_RGMII)
phylink_set(mask, 1000baseT_Full);

--
2.25.0


2020-03-03 10:05:03

by Vladimir Oltean

[permalink] [raw]
Subject: Re: [PATCH v1] net: dsa: sja1105: add 100baseT1_Full support

On Tue, 3 Mar 2020 at 09:44, Oleksij Rempel <[email protected]> wrote:
>
> Validate 100baseT1_Full to make this driver work with TJA1102 PHY.
>
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---

I was expecting this patch sooner or later.

Acked-by: Vladimir Oltean <[email protected]>

I should take this opportunity and express the fact that it is strange
for MAC drivers to have to sign off all possible copper and fiber
media types in their .phylink_validate method. Sooner or later
somebody is going to want to add 1000Base-T1 too. I don't think it is
going to scale very well. Russell, with your plan to make MAC drivers
just populate a bitmap of phy_modes (MII side), is it also going to
get rid of media side validation?

> drivers/net/dsa/sja1105/sja1105_main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
> index 34544b1c30dc..7b5a80ba12bd 100644
> --- a/drivers/net/dsa/sja1105/sja1105_main.c
> +++ b/drivers/net/dsa/sja1105/sja1105_main.c
> @@ -866,6 +866,7 @@ static void sja1105_phylink_validate(struct dsa_switch *ds, int port,
> phylink_set(mask, MII);
> phylink_set(mask, 10baseT_Full);
> phylink_set(mask, 100baseT_Full);
> + phylink_set(mask, 100baseT1_Full);
> if (mii->xmii_mode[port] == XMII_MODE_RGMII)
> phylink_set(mask, 1000baseT_Full);
>
> --
> 2.25.0
>

Regards,
-Vladimir

2020-03-03 13:48:35

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH v1] net: dsa: sja1105: add 100baseT1_Full support

On Tue, Mar 03, 2020 at 12:04:04PM +0200, Vladimir Oltean wrote:
> On Tue, 3 Mar 2020 at 09:44, Oleksij Rempel <[email protected]> wrote:
> >
> > Validate 100baseT1_Full to make this driver work with TJA1102 PHY.
> >
> > Signed-off-by: Oleksij Rempel <[email protected]>
> > ---
>
> I was expecting this patch sooner or later.
>
> Acked-by: Vladimir Oltean <[email protected]>
>
> I should take this opportunity and express the fact that it is strange
> for MAC drivers to have to sign off all possible copper and fiber
> media types in their .phylink_validate method. Sooner or later
> somebody is going to want to add 1000Base-T1 too. I don't think it is
> going to scale very well. Russell, with your plan to make MAC drivers
> just populate a bitmap of phy_modes (MII side), is it also going to
> get rid of media side validation?

You're touching on a concern I've had for some time that the link modes
mix together several different parameters: speed, duplex, and media.

What we actually want for a MAC is to know which speeds and duplexes
they support for each interface mode, and then translate that to the
ethtool link modes as appropriate. That isn't a problem I've addressed
yet, but something that could be addressed.

I've just updated my net-queue with a bunch of stuff that's been
sitting in other branches (some published, some not), which includes
the PHY_INTERFACE_MODE bitmap changes - everything from and including
"net: mvpp2: add port support helpers" concerns the bitmap stuff.

At the moment, it has to support both the new bitmap solution and the
legacy solution, but hopefully in time we can drop the legacy solution.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

2020-03-03 22:55:36

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v1] net: dsa: sja1105: add 100baseT1_Full support

From: Oleksij Rempel <[email protected]>
Date: Tue, 3 Mar 2020 08:44:14 +0100

> Validate 100baseT1_Full to make this driver work with TJA1102 PHY.
>
> Signed-off-by: Oleksij Rempel <[email protected]>

Applied to net-next, thank you.