diff mbox series

[net-next,2/8] net: dsa: propagate resolved link config via mac_link_up()

Message ID E1j6Wg0-0000Ss-W7@rmk-PC.armlinux.org.uk (mailing list archive)
State New, archived
Headers show
Series rework phylink interface for split MAC/PCS support | expand

Commit Message

Russell King (Oracle) Feb. 25, 2020, 9:38 a.m. UTC
Propagate the resolved link configuration down via DSA's
phylink_mac_link_up() operation to allow split PCS/MAC to work.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/dsa/b53/b53_common.c       | 4 +++-
 drivers/net/dsa/b53/b53_priv.h         | 4 +++-
 drivers/net/dsa/bcm_sf2.c              | 4 +++-
 drivers/net/dsa/lantiq_gswip.c         | 4 +++-
 drivers/net/dsa/mt7530.c               | 4 +++-
 drivers/net/dsa/mv88e6xxx/chip.c       | 4 +++-
 drivers/net/dsa/sja1105/sja1105_main.c | 4 +++-
 include/net/dsa.h                      | 4 +++-
 net/dsa/port.c                         | 3 ++-
 9 files changed, 26 insertions(+), 9 deletions(-)

Comments

Vladimir Oltean Feb. 25, 2020, 9:09 p.m. UTC | #1
Hi Russell,

On Tue, 25 Feb 2020 at 11:39, Russell King <rmk+kernel@armlinux.org.uk> wrote:
>
> Propagate the resolved link configuration down via DSA's
> phylink_mac_link_up() operation to allow split PCS/MAC to work.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/dsa/b53/b53_common.c       | 4 +++-
>  drivers/net/dsa/b53/b53_priv.h         | 4 +++-
>  drivers/net/dsa/bcm_sf2.c              | 4 +++-
>  drivers/net/dsa/lantiq_gswip.c         | 4 +++-
>  drivers/net/dsa/mt7530.c               | 4 +++-
>  drivers/net/dsa/mv88e6xxx/chip.c       | 4 +++-
>  drivers/net/dsa/sja1105/sja1105_main.c | 4 +++-
>  include/net/dsa.h                      | 4 +++-
>  net/dsa/port.c                         | 3 ++-
>  9 files changed, 26 insertions(+), 9 deletions(-)
>

It looks like you missed the felix_phylink_mac_link_up() conversion in
this patch? (which also makes it fail to build, by the way, I'm
supposed the Kbuild robot didn't already jump)
Nonetheless, I've manually added the missing speed, duplex, tx_pause
and rx_pause parameters, and it appears to work as before.
Same for sja1105.

Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Regards,
-Vladimir
Russell King (Oracle) Feb. 25, 2020, 11:23 p.m. UTC | #2
On Tue, Feb 25, 2020 at 11:09:35PM +0200, Vladimir Oltean wrote:
> Hi Russell,
> 
> On Tue, 25 Feb 2020 at 11:39, Russell King <rmk+kernel@armlinux.org.uk> wrote:
> >
> > Propagate the resolved link configuration down via DSA's
> > phylink_mac_link_up() operation to allow split PCS/MAC to work.
> >
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> > ---
> >  drivers/net/dsa/b53/b53_common.c       | 4 +++-
> >  drivers/net/dsa/b53/b53_priv.h         | 4 +++-
> >  drivers/net/dsa/bcm_sf2.c              | 4 +++-
> >  drivers/net/dsa/lantiq_gswip.c         | 4 +++-
> >  drivers/net/dsa/mt7530.c               | 4 +++-
> >  drivers/net/dsa/mv88e6xxx/chip.c       | 4 +++-
> >  drivers/net/dsa/sja1105/sja1105_main.c | 4 +++-
> >  include/net/dsa.h                      | 4 +++-
> >  net/dsa/port.c                         | 3 ++-
> >  9 files changed, 26 insertions(+), 9 deletions(-)
> >
> 
> It looks like you missed the felix_phylink_mac_link_up() conversion in
> this patch? (which also makes it fail to build, by the way, I'm
> supposed the Kbuild robot didn't already jump)
> Nonetheless, I've manually added the missing speed, duplex, tx_pause
> and rx_pause parameters, and it appears to work as before.
> Same for sja1105.

Quite possibly; the patch was developed against 5.5 plus the phylink
changes, but applied to net-next. Hmm, it seems my coccinelle script
that detects .mac_link_up initialiser prototypes, but not the DSA
equivalent using the old prototype.

Thanks for pointing it out.
Russell King (Oracle) Feb. 26, 2020, 10:39 a.m. UTC | #3
On Tue, Feb 25, 2020 at 11:23:07PM +0000, Russell King - ARM Linux admin wrote:
> On Tue, Feb 25, 2020 at 11:09:35PM +0200, Vladimir Oltean wrote:
> > Hi Russell,
> > 
> > On Tue, 25 Feb 2020 at 11:39, Russell King <rmk+kernel@armlinux.org.uk> wrote:
> > >
> > > Propagate the resolved link configuration down via DSA's
> > > phylink_mac_link_up() operation to allow split PCS/MAC to work.
> > >
> > > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> > > ---
> > >  drivers/net/dsa/b53/b53_common.c       | 4 +++-
> > >  drivers/net/dsa/b53/b53_priv.h         | 4 +++-
> > >  drivers/net/dsa/bcm_sf2.c              | 4 +++-
> > >  drivers/net/dsa/lantiq_gswip.c         | 4 +++-
> > >  drivers/net/dsa/mt7530.c               | 4 +++-
> > >  drivers/net/dsa/mv88e6xxx/chip.c       | 4 +++-
> > >  drivers/net/dsa/sja1105/sja1105_main.c | 4 +++-
> > >  include/net/dsa.h                      | 4 +++-
> > >  net/dsa/port.c                         | 3 ++-
> > >  9 files changed, 26 insertions(+), 9 deletions(-)
> > >
> > 
> > It looks like you missed the felix_phylink_mac_link_up() conversion in
> > this patch? (which also makes it fail to build, by the way, I'm
> > supposed the Kbuild robot didn't already jump)
> > Nonetheless, I've manually added the missing speed, duplex, tx_pause
> > and rx_pause parameters, and it appears to work as before.
> > Same for sja1105.
> 
> Quite possibly; the patch was developed against 5.5 plus the phylink
> changes, but applied to net-next. Hmm, it seems my coccinelle script
> that detects .mac_link_up initialiser prototypes, but not the DSA
> equivalent using the old prototype.
> 
> Thanks for pointing it out.

I've just sent v2 with ocelot and qca included... and some recipients
for patch 2 bounced - the Cc line is now too long!

As far as the kbuild robot goes, you are not the first to notice that
kbuild seems to be flakey... I've noticed it for some time, as has
Greg KH.  It isn't just patches on mailing lists, it's git trees as
well.
diff mbox series

Patch

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 1a69286daa8d..ceafce446317 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1289,7 +1289,9 @@  EXPORT_SYMBOL(b53_phylink_mac_link_down);
 void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
 			     unsigned int mode,
 			     phy_interface_t interface,
-			     struct phy_device *phydev)
+			     struct phy_device *phydev,
+			     int speed, int duplex,
+			     bool tx_pause, bool rx_pause)
 {
 	struct b53_device *dev = ds->priv;
 
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 3c30f3a7eb29..3d42318bc3f1 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -338,7 +338,9 @@  void b53_phylink_mac_link_down(struct dsa_switch *ds, int port,
 void b53_phylink_mac_link_up(struct dsa_switch *ds, int port,
 			     unsigned int mode,
 			     phy_interface_t interface,
-			     struct phy_device *phydev);
+			     struct phy_device *phydev,
+			     int speed, int duplex,
+			     bool tx_pause, bool rx_pause);
 int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering);
 int b53_vlan_prepare(struct dsa_switch *ds, int port,
 		     const struct switchdev_obj_port_vlan *vlan);
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 6feaf8cb0809..a1110133dadf 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -652,7 +652,9 @@  static void bcm_sf2_sw_mac_link_down(struct dsa_switch *ds, int port,
 static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
 				   unsigned int mode,
 				   phy_interface_t interface,
-				   struct phy_device *phydev)
+				   struct phy_device *phydev,
+				   int speed, int duplex,
+				   bool tx_pause, bool rx_pause)
 {
 	struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
 	struct ethtool_eee *p = &priv->dev->ports[port].eee;
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index 0369c22fe3e1..cf6fa8fede33 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -1517,7 +1517,9 @@  static void gswip_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port,
 				      unsigned int mode,
 				      phy_interface_t interface,
-				      struct phy_device *phydev)
+				      struct phy_device *phydev,
+				      int speed, int duplex,
+				      bool tx_pause, bool rx_pause)
 {
 	struct gswip_priv *priv = ds->priv;
 
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 022466ca1c19..86818ab3bb07 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1482,7 +1482,9 @@  static void mt7530_phylink_mac_link_down(struct dsa_switch *ds, int port,
 static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
 				       unsigned int mode,
 				       phy_interface_t interface,
-				       struct phy_device *phydev)
+				       struct phy_device *phydev,
+				       int speed, int duplex,
+				       bool tx_pause, bool rx_pause)
 {
 	struct mt7530_priv *priv = ds->priv;
 
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 4ec09cc8dcdc..fef3b5e0b291 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -655,7 +655,9 @@  static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
 
 static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
 				  unsigned int mode, phy_interface_t interface,
-				  struct phy_device *phydev)
+				  struct phy_device *phydev,
+				  int speed, int duplex,
+				  bool tx_pause, bool rx_pause)
 {
 	if (mode == MLO_AN_FIXED)
 		mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP);
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index 03ba6d25f7fe..c27cc7b37440 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -786,7 +786,9 @@  static void sja1105_mac_link_down(struct dsa_switch *ds, int port,
 static void sja1105_mac_link_up(struct dsa_switch *ds, int port,
 				unsigned int mode,
 				phy_interface_t interface,
-				struct phy_device *phydev)
+				struct phy_device *phydev,
+				int speed, int duplex,
+				bool tx_pause, bool rx_pause)
 {
 	sja1105_inhibit_tx(ds->priv, BIT(port), false);
 }
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 63495e3443ac..7d3d84f0ef42 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -420,7 +420,9 @@  struct dsa_switch_ops {
 	void	(*phylink_mac_link_up)(struct dsa_switch *ds, int port,
 				       unsigned int mode,
 				       phy_interface_t interface,
-				       struct phy_device *phydev);
+				       struct phy_device *phydev,
+				       int speed, int duplex,
+				       bool tx_pause, bool rx_pause);
 	void	(*phylink_fixed_state)(struct dsa_switch *ds, int port,
 				       struct phylink_link_state *state);
 	/*
diff --git a/net/dsa/port.c b/net/dsa/port.c
index b2f5262b35cf..d4450a454249 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -504,7 +504,8 @@  static void dsa_port_phylink_mac_link_up(struct phylink_config *config,
 		return;
 	}
 
-	ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev);
+	ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev,
+				     speed, duplex, tx_pause, rx_pause);
 }
 
 const struct phylink_mac_ops dsa_port_phylink_mac_ops = {