linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [CFT 0/8] rework phylink interface for split MAC/PCS support
@ 2020-02-17 17:22 Russell King - ARM Linux admin
  2020-02-17 17:33 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-17 17:22 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Heiner Kallweit
  Cc: linux-doc, Thomas Petazzoni, linux-stm32, Felix Fietkau,
	Ioana Radulescu, Jonathan Corbet, Michal Simek, Jose Abreu,
	Jakub Kicinski, Mark Lee, Sean Wang, Alexandre Torgue,
	Hauke Mehrtens, Radhey Shyam Pandey, linux-mediatek, John Crispin,
	Matthias Brugger, Giuseppe Cavallaro, linux-arm-kernel, netdev,
	Vivien Didelot, Maxime Coquelin, Vladimir Oltean, David S. Miller

Hi,

The following series changes the phylink interface to allow us to
better support split MAC / MAC PCS setups.  The fundamental change
required for this turns out to be quite simple.

Today, mac_config() is used for everything to do with setting the
parameters for the MAC, and mac_link_up() is used to inform the
MAC driver that the link is now up (and so to allow packet flow.)
mac_config() also has had a few implementation issues, with folk
who believe that members such as "speed" and "duplex" are always
valid, where "link" gets used inappropriately, etc.

With the proposed patches, all this changes subtly - but in a
backwards compatible way at this stage.

We pass the the full resolved link state (speed, duplex, pause) to
mac_link_up(), and it is now guaranteed that these parameters to
this function will always be valid (no more SPEED_UNKNOWN or
DUPLEX_UNKNOWN here - unless phylink is fed with such things.)

Drivers should convert over to using the state in mac_link_up()
rather than configuring the speed, duplex and pause in the
mac_config() method. The patch series includes a number of MAC
drivers which I've thought have been easy targets - I've left the
remainder as I think they need maintainer input. However, *all*
drivers will need conversion for future phylink development.

 Documentation/networking/sfp-phylink.rst          |  17 +++-
 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                  |  79 +++++++++++++----
 drivers/net/dsa/sja1105/sja1105_main.c            |   4 +-
 drivers/net/ethernet/cadence/macb.h               |   1 -
 drivers/net/ethernet/cadence/macb_main.c          |  53 ++++++-----
 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c  |  61 ++++++++-----
 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h  |   1 +
 drivers/net/ethernet/marvell/mvneta.c             |  63 ++++++++-----
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c   | 102 +++++++++++++---------
 drivers/net/ethernet/mediatek/mtk_eth_soc.c       |   7 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   4 +-
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c |  37 ++++----
 drivers/net/phy/phylink.c                         |   9 +-
 include/linux/phylink.h                           |  57 ++++++++----
 include/net/dsa.h                                 |   4 +-
 net/dsa/port.c                                    |   7 +-
 21 files changed, 350 insertions(+), 176 deletions(-)

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 0/8] rework phylink interface for split MAC/PCS support
  2020-02-17 17:22 [CFT 0/8] rework phylink interface for split MAC/PCS support Russell King - ARM Linux admin
@ 2020-02-17 17:33 ` Andrew Lunn
  2020-02-17 18:51   ` Russell King - ARM Linux admin
       [not found] ` <E1j3k7e-00071q-3R@rmk-PC.armlinux.org.uk>
       [not found] ` <E1j3k7t-00072J-RS@rmk-PC.armlinux.org.uk>
  2 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2020-02-17 17:33 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: linux-doc, Thomas Petazzoni, linux-stm32, Felix Fietkau,
	Florian Fainelli, Ioana Radulescu, Jonathan Corbet, Michal Simek,
	Jose Abreu, Jakub Kicinski, Mark Lee, Sean Wang, Alexandre Torgue,
	Hauke Mehrtens, Radhey Shyam Pandey, linux-mediatek, John Crispin,
	Matthias Brugger, Giuseppe Cavallaro, linux-arm-kernel, netdev,
	Vivien Didelot, Maxime Coquelin, Vladimir Oltean, David S. Miller,
	Heiner Kallweit

On Mon, Feb 17, 2020 at 05:22:43PM +0000, Russell King - ARM Linux admin wrote:
> Hi,
> 
> The following series changes the phylink interface to allow us to
> better support split MAC / MAC PCS setups.  The fundamental change
> required for this turns out to be quite simple.

Hi Russell

Do you have a branch i can pull and test?

Thanks
	Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up()
       [not found] ` <E1j3k7e-00071q-3R@rmk-PC.armlinux.org.uk>
@ 2020-02-17 18:03   ` Matthew Wilcox
  2020-02-17 18:48     ` Russell King - ARM Linux admin
  2020-02-17 21:54   ` Florian Fainelli
  1 sibling, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2020-02-17 18:03 UTC (permalink / raw)
  To: Russell King
  Cc: Andrew Lunn, linux-doc, Thomas Petazzoni, linux-stm32,
	Felix Fietkau, Florian Fainelli, Ioana Radulescu, Jonathan Corbet,
	Michal Simek, Jose Abreu, Jakub Kicinski, Vivien Didelot,
	Radhey Shyam Pandey, Alexandre Torgue, Sean Wang, linux-mediatek,
	John Crispin, Matthias Brugger, Giuseppe Cavallaro,
	linux-arm-kernel, netdev, Mark Lee, Maxime Coquelin,
	David S. Miller, Heiner Kallweit

On Mon, Feb 17, 2020 at 05:23:54PM +0000, Russell King wrote:
> +   Please see :c:func:`mac_link_up` for more information on this.

FYI, Jon recently added the ability to specify functions as

+   Please see mac_link_up() for more information on this.

and it's now the preferred way to do this.  Nothing that should stand in
the way of this patch-set, of course.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up()
  2020-02-17 18:03   ` [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up() Matthew Wilcox
@ 2020-02-17 18:48     ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-17 18:48 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Andrew Lunn, linux-doc, Thomas Petazzoni, linux-stm32,
	Felix Fietkau, Florian Fainelli, Ioana Radulescu, Jonathan Corbet,
	Michal Simek, Jose Abreu, Jakub Kicinski, Vivien Didelot,
	Sean Wang, Alexandre Torgue, Radhey Shyam Pandey, linux-mediatek,
	John Crispin, Matthias Brugger, Giuseppe Cavallaro,
	linux-arm-kernel, netdev, Mark Lee, Maxime Coquelin,
	David S. Miller, Heiner Kallweit

On Mon, Feb 17, 2020 at 10:03:59AM -0800, Matthew Wilcox wrote:
> On Mon, Feb 17, 2020 at 05:23:54PM +0000, Russell King wrote:
> > +   Please see :c:func:`mac_link_up` for more information on this.
> 
> FYI, Jon recently added the ability to specify functions as
> 
> +   Please see mac_link_up() for more information on this.
> 
> and it's now the preferred way to do this.  Nothing that should stand in
> the way of this patch-set, of course.

Thanks for letting me know - it sounds like the subject of a future
patch to convert all instances.  In the mean time, I suggest keeping
to the current style in the file for consistency...

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 0/8] rework phylink interface for split MAC/PCS support
  2020-02-17 17:33 ` Andrew Lunn
@ 2020-02-17 18:51   ` Russell King - ARM Linux admin
  2020-02-18 10:29     ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-17 18:51 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: linux-doc, Thomas Petazzoni, linux-stm32, Felix Fietkau,
	Florian Fainelli, Ioana Radulescu, Jonathan Corbet, Michal Simek,
	Jose Abreu, Jakub Kicinski, Mark Lee, Sean Wang, Alexandre Torgue,
	Hauke Mehrtens, Radhey Shyam Pandey, linux-mediatek, John Crispin,
	Matthias Brugger, Giuseppe Cavallaro, linux-arm-kernel, netdev,
	Vivien Didelot, Maxime Coquelin, Vladimir Oltean, David S. Miller,
	Heiner Kallweit

On Mon, Feb 17, 2020 at 06:33:24PM +0100, Andrew Lunn wrote:
> On Mon, Feb 17, 2020 at 05:22:43PM +0000, Russell King - ARM Linux admin wrote:
> > Hi,
> > 
> > The following series changes the phylink interface to allow us to
> > better support split MAC / MAC PCS setups.  The fundamental change
> > required for this turns out to be quite simple.
> 
> Hi Russell
> 
> Do you have a branch i can pull and test?

Nothing beyond the branches I've mentioned in the previous heads-up as
yet, sorry.

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up()
       [not found] ` <E1j3k7e-00071q-3R@rmk-PC.armlinux.org.uk>
  2020-02-17 18:03   ` [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up() Matthew Wilcox
@ 2020-02-17 21:54   ` Florian Fainelli
  2020-02-18  1:53     ` Russell King - ARM Linux admin
  1 sibling, 1 reply; 11+ messages in thread
From: Florian Fainelli @ 2020-02-17 21:54 UTC (permalink / raw)
  To: Russell King, Andrew Lunn, Heiner Kallweit
  Cc: linux-doc, Thomas Petazzoni, linux-stm32, Felix Fietkau,
	Ioana Radulescu, Jonathan Corbet, Michal Simek, Jose Abreu,
	Jakub Kicinski, Vivien Didelot, Sean Wang, Alexandre Torgue,
	Radhey Shyam Pandey, linux-mediatek, John Crispin,
	Matthias Brugger, Giuseppe Cavallaro, linux-arm-kernel, netdev,
	Mark Lee, Maxime Coquelin, David S. Miller



On 2/17/2020 9:23 AM, Russell King wrote:
> Propagate the resolved link parameters via the mac_link_up() call for
> MACs that do not automatically track their PCS state.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---

[snip]


> -static void macb_mac_link_up(struct phylink_config *config, unsigned int mode,
> -			     phy_interface_t interface, struct phy_device *phy)
> +static void macb_mac_link_up(struct phylink_config *config,
> +			     struct phy_device *phy,
> +			     unsigned int mode, phy_interface_t interface,
> +			     int speed, int duplex,
> +			     bool tx_pause, bool rx_pause)

I have not been able to find an answer so I will ask this question, why
not pass a const struct phylink_link_state reference here instead of
splitting those link settings as individual function parameters? Or
maybe introduce a phylink_link_settings comprised of all of those 4
settings and embed it within phylink_link_state as well?

You would obviously need to squash patch #1 and #2 past this submission
stage to avoid bisection build failures.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up()
  2020-02-17 21:54   ` Florian Fainelli
@ 2020-02-18  1:53     ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-18  1:53 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Andrew Lunn, linux-doc, Thomas Petazzoni, linux-stm32,
	Felix Fietkau, Ioana Radulescu, Jonathan Corbet, Michal Simek,
	Jose Abreu, Jakub Kicinski, Vivien Didelot, Radhey Shyam Pandey,
	Alexandre Torgue, Sean Wang, linux-mediatek, John Crispin,
	Matthias Brugger, Giuseppe Cavallaro, linux-arm-kernel, netdev,
	Mark Lee, Maxime Coquelin, David S. Miller, Heiner Kallweit

On Mon, Feb 17, 2020 at 01:54:19PM -0800, Florian Fainelli wrote:
> 
> 
> On 2/17/2020 9:23 AM, Russell King wrote:
> > Propagate the resolved link parameters via the mac_link_up() call for
> > MACs that do not automatically track their PCS state.
> > 
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> > ---
> 
> [snip]
> 
> 
> > -static void macb_mac_link_up(struct phylink_config *config, unsigned int mode,
> > -			     phy_interface_t interface, struct phy_device *phy)
> > +static void macb_mac_link_up(struct phylink_config *config,
> > +			     struct phy_device *phy,
> > +			     unsigned int mode, phy_interface_t interface,
> > +			     int speed, int duplex,
> > +			     bool tx_pause, bool rx_pause)
> 
> I have not been able to find an answer so I will ask this question, why
> not pass a const struct phylink_link_state reference here instead of
> splitting those link settings as individual function parameters? Or
> maybe introduce a phylink_link_settings comprised of all of those 4
> settings and embed it within phylink_link_state as well?

History of mac_config() has shown that passing something like
struct phylink_link_state results in stuff that should not be used
being used inspite of documentation saying otherwise.  Passing
just the appropriate state ensures that stuff which should not
be used can't be got at.

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 0/8] rework phylink interface for split MAC/PCS support
  2020-02-17 18:51   ` Russell King - ARM Linux admin
@ 2020-02-18 10:29     ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-18 10:29 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: linux-doc, Thomas Petazzoni, linux-stm32, Felix Fietkau,
	Florian Fainelli, Ioana Radulescu, Jonathan Corbet, Michal Simek,
	Jose Abreu, Jakub Kicinski, Vivien Didelot, Sean Wang,
	Alexandre Torgue, Hauke Mehrtens, Radhey Shyam Pandey,
	linux-mediatek, John Crispin, Matthias Brugger,
	Giuseppe Cavallaro, linux-arm-kernel, netdev, Mark Lee,
	Maxime Coquelin, Vladimir Oltean, David S. Miller,
	Heiner Kallweit

On Mon, Feb 17, 2020 at 06:51:31PM +0000, Russell King - ARM Linux admin wrote:
> On Mon, Feb 17, 2020 at 06:33:24PM +0100, Andrew Lunn wrote:
> > On Mon, Feb 17, 2020 at 05:22:43PM +0000, Russell King - ARM Linux admin wrote:
> > > Hi,
> > > 
> > > The following series changes the phylink interface to allow us to
> > > better support split MAC / MAC PCS setups.  The fundamental change
> > > required for this turns out to be quite simple.
> > 
> > Hi Russell
> > 
> > Do you have a branch i can pull and test?
> 
> Nothing beyond the branches I've mentioned in the previous heads-up as
> yet, sorry.

In any case, for any particular network driver, there are three patches
maximum that you need - the first, and the one or two patches specific
to the network driver, depending whether it's a DSA driver or not. You
don't need all 8 patches to test this series. All can be applied on top
of yesterday's net-next, specifically

92df9f8a745e ("Merge branch 'mvneta-xdp-ethtool-stats'")

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 4/8] net: axienet: use resolved link config in mac_link_up()
       [not found] ` <E1j3k7t-00072J-RS@rmk-PC.armlinux.org.uk>
@ 2020-02-20 10:29   ` Russell King - ARM Linux admin
  2020-02-24 12:24   ` Andre Przywara
  1 sibling, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-20 10:29 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Andrew Lunn, Florian Fainelli, netdev, Radhey Shyam Pandey,
	Michal Simek, David S. Miller, linux-arm-kernel, Heiner Kallweit

Hi Andre,

Are you able to give this (along with patch 1) some testing please?
The series can be grabbed from:

  https://patchwork.ozlabs.org/series/159037/mbox/

Strangely, google doesn't find it in the lore.kernel.org archives,
but does in spinics.net archives and patchwork...

On Mon, Feb 17, 2020 at 05:24:09PM +0000, Russell King wrote:
> Convert the Xilinx AXI ethernet driver to use the finalised link
> parameters in mac_link_up() rather than the parameters in mac_config().
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  .../net/ethernet/xilinx/xilinx_axienet_main.c | 38 +++++++++----------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 197740781157..c2f4c5ca2e80 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1440,6 +1440,22 @@ static void axienet_mac_an_restart(struct phylink_config *config)
>  
>  static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
>  			       const struct phylink_link_state *state)
> +{
> +	/* nothing meaningful to do */
> +}
> +
> +static void axienet_mac_link_down(struct phylink_config *config,
> +				  unsigned int mode,
> +				  phy_interface_t interface)
> +{
> +	/* nothing meaningful to do */
> +}
> +
> +static void axienet_mac_link_up(struct phylink_config *config,
> +				struct phy_device *phy,
> +				unsigned int mode, phy_interface_t interface,
> +				int speed, int duplex,
> +				bool tx_pause, bool rx_pause)
>  {
>  	struct net_device *ndev = to_net_dev(config->dev);
>  	struct axienet_local *lp = netdev_priv(ndev);
> @@ -1448,7 +1464,7 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
>  	emmc_reg = axienet_ior(lp, XAE_EMMC_OFFSET);
>  	emmc_reg &= ~XAE_EMMC_LINKSPEED_MASK;
>  
> -	switch (state->speed) {
> +	switch (speed) {
>  	case SPEED_1000:
>  		emmc_reg |= XAE_EMMC_LINKSPD_1000;
>  		break;
> @@ -1467,33 +1483,17 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
>  	axienet_iow(lp, XAE_EMMC_OFFSET, emmc_reg);
>  
>  	fcc_reg = axienet_ior(lp, XAE_FCC_OFFSET);
> -	if (state->pause & MLO_PAUSE_TX)
> +	if (tx_pause)
>  		fcc_reg |= XAE_FCC_FCTX_MASK;
>  	else
>  		fcc_reg &= ~XAE_FCC_FCTX_MASK;
> -	if (state->pause & MLO_PAUSE_RX)
> +	if (rx_pause)
>  		fcc_reg |= XAE_FCC_FCRX_MASK;
>  	else
>  		fcc_reg &= ~XAE_FCC_FCRX_MASK;
>  	axienet_iow(lp, XAE_FCC_OFFSET, fcc_reg);
>  }
>  
> -static void axienet_mac_link_down(struct phylink_config *config,
> -				  unsigned int mode,
> -				  phy_interface_t interface)
> -{
> -	/* nothing meaningful to do */
> -}
> -
> -static void axienet_mac_link_up(struct phylink_config *config,
> -				struct phy_device *phy,
> -				unsigned int mode, phy_interface_t interface,
> -				int speed, int duplex,
> -				bool tx_pause, bool rx_pause)
> -{
> -	/* nothing meaningful to do */
> -}
> -
>  static const struct phylink_mac_ops axienet_phylink_ops = {
>  	.validate = axienet_validate,
>  	.mac_pcs_get_state = axienet_mac_pcs_get_state,
> -- 
> 2.20.1
> 
> 

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 4/8] net: axienet: use resolved link config in mac_link_up()
       [not found] ` <E1j3k7t-00072J-RS@rmk-PC.armlinux.org.uk>
  2020-02-20 10:29   ` [CFT 4/8] net: axienet: use resolved link config in mac_link_up() Russell King - ARM Linux admin
@ 2020-02-24 12:24   ` Andre Przywara
  2020-02-24 13:01     ` Russell King - ARM Linux admin
  1 sibling, 1 reply; 11+ messages in thread
From: Andre Przywara @ 2020-02-24 12:24 UTC (permalink / raw)
  To: Russell King
  Cc: Andrew Lunn, Florian Fainelli, netdev, Radhey Shyam Pandey,
	Michal Simek, David S. Miller, linux-arm-kernel, Heiner Kallweit

On Mon, 17 Feb 2020 17:24:09 +0000
Russell King <rmk+kernel@armlinux.org.uk> wrote:

Hi Russell,

> Convert the Xilinx AXI ethernet driver to use the finalised link
> parameters in mac_link_up() rather than the parameters in mac_config().

Many thanks for this series, a quite neat solution for the problems I saw!

I picked 1/8 and 4/8 on top of net-next/master as of today: c3e042f54107376 ("igmp: remove unused macro IGMP_Vx_UNSOLICITED_REPORT_INTERVAL") and it worked great on my FPGA board using SGMII (but no in-band negotiation over that link). I had the 64-bit DMA patches on top, but that doesn't affect this series.

Tested-by: Andre Przywara <andre.przywara@arm.com>

Is this heading for 5.7?

Cheers,
Andre.

> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  .../net/ethernet/xilinx/xilinx_axienet_main.c | 38 +++++++++----------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 197740781157..c2f4c5ca2e80 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1440,6 +1440,22 @@ static void axienet_mac_an_restart(struct phylink_config *config)
>  
>  static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
>  			       const struct phylink_link_state *state)
> +{
> +	/* nothing meaningful to do */
> +}
> +
> +static void axienet_mac_link_down(struct phylink_config *config,
> +				  unsigned int mode,
> +				  phy_interface_t interface)
> +{
> +	/* nothing meaningful to do */
> +}
> +
> +static void axienet_mac_link_up(struct phylink_config *config,
> +				struct phy_device *phy,
> +				unsigned int mode, phy_interface_t interface,
> +				int speed, int duplex,
> +				bool tx_pause, bool rx_pause)
>  {
>  	struct net_device *ndev = to_net_dev(config->dev);
>  	struct axienet_local *lp = netdev_priv(ndev);
> @@ -1448,7 +1464,7 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
>  	emmc_reg = axienet_ior(lp, XAE_EMMC_OFFSET);
>  	emmc_reg &= ~XAE_EMMC_LINKSPEED_MASK;
>  
> -	switch (state->speed) {
> +	switch (speed) {
>  	case SPEED_1000:
>  		emmc_reg |= XAE_EMMC_LINKSPD_1000;
>  		break;
> @@ -1467,33 +1483,17 @@ static void axienet_mac_config(struct phylink_config *config, unsigned int mode,
>  	axienet_iow(lp, XAE_EMMC_OFFSET, emmc_reg);
>  
>  	fcc_reg = axienet_ior(lp, XAE_FCC_OFFSET);
> -	if (state->pause & MLO_PAUSE_TX)
> +	if (tx_pause)
>  		fcc_reg |= XAE_FCC_FCTX_MASK;
>  	else
>  		fcc_reg &= ~XAE_FCC_FCTX_MASK;
> -	if (state->pause & MLO_PAUSE_RX)
> +	if (rx_pause)
>  		fcc_reg |= XAE_FCC_FCRX_MASK;
>  	else
>  		fcc_reg &= ~XAE_FCC_FCRX_MASK;
>  	axienet_iow(lp, XAE_FCC_OFFSET, fcc_reg);
>  }
>  
> -static void axienet_mac_link_down(struct phylink_config *config,
> -				  unsigned int mode,
> -				  phy_interface_t interface)
> -{
> -	/* nothing meaningful to do */
> -}
> -
> -static void axienet_mac_link_up(struct phylink_config *config,
> -				struct phy_device *phy,
> -				unsigned int mode, phy_interface_t interface,
> -				int speed, int duplex,
> -				bool tx_pause, bool rx_pause)
> -{
> -	/* nothing meaningful to do */
> -}
> -
>  static const struct phylink_mac_ops axienet_phylink_ops = {
>  	.validate = axienet_validate,
>  	.mac_pcs_get_state = axienet_mac_pcs_get_state,


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [CFT 4/8] net: axienet: use resolved link config in mac_link_up()
  2020-02-24 12:24   ` Andre Przywara
@ 2020-02-24 13:01     ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-24 13:01 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Andrew Lunn, Florian Fainelli, netdev, Radhey Shyam Pandey,
	Michal Simek, David S. Miller, linux-arm-kernel, Heiner Kallweit

On Mon, Feb 24, 2020 at 12:24:21PM +0000, Andre Przywara wrote:
> On Mon, 17 Feb 2020 17:24:09 +0000
> Russell King <rmk+kernel@armlinux.org.uk> wrote:
> 
> Hi Russell,
> 
> > Convert the Xilinx AXI ethernet driver to use the finalised link
> > parameters in mac_link_up() rather than the parameters in mac_config().
> 
> Many thanks for this series, a quite neat solution for the problems I saw!
> 
> I picked 1/8 and 4/8 on top of net-next/master as of today: c3e042f54107376 ("igmp: remove unused macro IGMP_Vx_UNSOLICITED_REPORT_INTERVAL") and it worked great on my FPGA board using SGMII (but no in-band negotiation over that link). I had the 64-bit DMA patches on top, but that doesn't affect this series.
> 
> Tested-by: Andre Przywara <andre.przywara@arm.com>

Great, thanks for testing!

> Is this heading for 5.7?

Yes, that is my hope.

-- 
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-02-24 13:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-17 17:22 [CFT 0/8] rework phylink interface for split MAC/PCS support Russell King - ARM Linux admin
2020-02-17 17:33 ` Andrew Lunn
2020-02-17 18:51   ` Russell King - ARM Linux admin
2020-02-18 10:29     ` Russell King - ARM Linux admin
     [not found] ` <E1j3k7e-00071q-3R@rmk-PC.armlinux.org.uk>
2020-02-17 18:03   ` [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up() Matthew Wilcox
2020-02-17 18:48     ` Russell King - ARM Linux admin
2020-02-17 21:54   ` Florian Fainelli
2020-02-18  1:53     ` Russell King - ARM Linux admin
     [not found] ` <E1j3k7t-00072J-RS@rmk-PC.armlinux.org.uk>
2020-02-20 10:29   ` [CFT 4/8] net: axienet: use resolved link config in mac_link_up() Russell King - ARM Linux admin
2020-02-24 12:24   ` Andre Przywara
2020-02-24 13:01     ` Russell King - ARM Linux admin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).