From: "Russell King (Oracle)" <linux@armlinux.org.uk> Date: 2022-02-25 16:05:33
Hi,
This series updates the Ocelot DSA driver for some of the recent
phylink changes. Specifically, we fill in the supported_interfaces
fields, convert to mac_select_pcs and mark the driver as non-legacy.
We do not convert to phylink_generic_validate() as Ocelot has
special support for its rate adapting PCS which makes the generic
validate method unsuitable for this driver.
The three changes mentioned above are implemented in their own
separate patches with one additional cleanup:
1) Populate the supported_interfaces bitmap
2) Remove the now unnecessary interface checks in the validate methods
3) Convert from phylink_set_pcs() to .mac_select_pcs.
4) Mark the driver as non-legacy
Thanks.
RFC -> non-RFC: add reviewed-by/tested-by's, update patch 1 to set the
supported_interfaces bitmap in felix.c rather than the sub-drivers as
requested by Vladimir.
drivers/net/dsa/ocelot/felix.c | 30 ++++++++++++++++++++++++------
drivers/net/dsa/ocelot/felix_vsc9959.c | 7 -------
drivers/net/dsa/ocelot/seville_vsc9953.c | 7 -------
3 files changed, 24 insertions(+), 20 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
From: Russell King (Oracle) <hidden> Date: 2022-02-25 16:06:45
Populate the supported interfaces bitmap for the Ocelot DSA switches.
Since all sub-drivers only support a single interface mode, defined by
ocelot_port->phy_mode, we can handle this in the main driver code
without reference to the sub-driver.
Signed-off-by: Russell King (Oracle) <redacted>
---
drivers/net/dsa/ocelot/felix.c | 10 ++++++++++
1 file changed, 10 insertions(+)
From: Russell King (Oracle) <hidden> Date: 2022-02-25 16:06:52
When the supported interfaces bitmap is populated, phylink will itself
check that the interface mode is present in this bitmap. Drivers no
longer need to perform this check themselves. Remove these checks.
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Russell King (Oracle) <redacted>
---
drivers/net/dsa/ocelot/felix_vsc9959.c | 7 -------
drivers/net/dsa/ocelot/seville_vsc9953.c | 7 -------
2 files changed, 14 deletions(-)
From: Russell King (Oracle) <hidden> Date: 2022-02-25 16:06:56
Convert the PCS selection to use mac_select_pcs, which allows the PCS
to perform any validation it needs, and removes the need to set the PCS
in the mac_config() callback, delving into the higher DSA levels to do
so.
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Russell King (Oracle) <redacted>
---
drivers/net/dsa/ocelot/felix.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
From: Russell King (Oracle) <hidden> Date: 2022-02-25 16:07:05
The ocelot DSA driver does not make use of the speed, duplex, pause or
advertisement in its phylink_mac_config() implementation, so it can be
marked as a non-legacy driver.
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Russell King (Oracle) <redacted>
---
drivers/net/dsa/ocelot/felix.c | 6 ++++++
1 file changed, 6 insertions(+)
@@ -783,6 +783,12 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port,{structocelot*ocelot=ds->priv;+/* This driver does not make use of the speed, duplex, pause or the+*advertisementinitsmac_config,soitissafetomarkthisdriver+*asnon-legacy.+*/+config->legacy_pre_march2020=false;+__set_bit(ocelot->ports[port].phy_mode,config->supported_interfaces);}
From: "Russell King (Oracle)" <linux@armlinux.org.uk> Date: 2022-02-25 16:14:31
On Fri, Feb 25, 2022 at 04:06:36PM +0000, Russell King (Oracle) wrote:
quoted hunk
Populate the supported interfaces bitmap for the Ocelot DSA switches.
Since all sub-drivers only support a single interface mode, defined by
ocelot_port->phy_mode, we can handle this in the main driver code
without reference to the sub-driver.
Signed-off-by: Russell King (Oracle) <redacted>
---
drivers/net/dsa/ocelot/felix.c | 10 ++++++++++
1 file changed, 10 insertions(+)