All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Antoine Tenart <antoine.tenart@bootlin.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 3/3] net: mvpp2: update mvpp2 validate() implementation
Date: Tue, 17 Dec 2019 11:48:49 +0100	[thread overview]
Message-ID: <20191217104849.GH3160@kwain> (raw)
In-Reply-To: <E1ifpZs-0005kJ-Ll@rmk-PC.armlinux.org.uk>

Hello Russell,

On Fri, Dec 13, 2019 at 06:22:12PM +0000, Russell King wrote:
> Fix up the mvpp2 validate implementation to adopt the same behaviour as
> mvneta:
> - only allow the link modes that the specified PHY interface mode
>   supports with the exception of 1000base-X and 2500base-X.
> - use the basex helper to deal with SFP modules that can be switched
>   between 1000base-X vs 2500base-X.
> 
> This gives consistent behaviour between mvneta and mvpp2.
> 
> This commit depends on "net: phylink: extend clause 45 PHY validation
> workaround" so is not marked for backporting to stable kernels.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Acked-by: Antoine Tenart <antoine.tenart@bootlin.com>

Thanks!
Antoine

> ---
>  .../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 22 +++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index 111b3b8239e1..f09fcbe6ea88 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -4786,6 +4786,8 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
>  			phylink_set(mask, 10000baseER_Full);
>  			phylink_set(mask, 10000baseKR_Full);
>  		}
> +		if (state->interface != PHY_INTERFACE_MODE_NA)
> +			break;
>  		/* Fall-through */
>  	case PHY_INTERFACE_MODE_RGMII:
>  	case PHY_INTERFACE_MODE_RGMII_ID:
> @@ -4796,13 +4798,23 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
>  		phylink_set(mask, 10baseT_Full);
>  		phylink_set(mask, 100baseT_Half);
>  		phylink_set(mask, 100baseT_Full);
> +		phylink_set(mask, 1000baseT_Full);
> +		phylink_set(mask, 1000baseX_Full);
> +		if (state->interface != PHY_INTERFACE_MODE_NA)
> +			break;
>  		/* Fall-through */
>  	case PHY_INTERFACE_MODE_1000BASEX:
>  	case PHY_INTERFACE_MODE_2500BASEX:
> -		phylink_set(mask, 1000baseT_Full);
> -		phylink_set(mask, 1000baseX_Full);
> -		phylink_set(mask, 2500baseT_Full);
> -		phylink_set(mask, 2500baseX_Full);
> +		if (port->comphy ||
> +		    state->interface != PHY_INTERFACE_MODE_2500BASEX) {
> +			phylink_set(mask, 1000baseT_Full);
> +			phylink_set(mask, 1000baseX_Full);
> +		}
> +		if (port->comphy ||
> +		    state->interface == PHY_INTERFACE_MODE_2500BASEX) {
> +			phylink_set(mask, 2500baseT_Full);
> +			phylink_set(mask, 2500baseX_Full);
> +		}
>  		break;
>  	default:
>  		goto empty_set;
> @@ -4811,6 +4823,8 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
>  	bitmap_and(supported, supported, mask, __ETHTOOL_LINK_MODE_MASK_NBITS);
>  	bitmap_and(state->advertising, state->advertising, mask,
>  		   __ETHTOOL_LINK_MODE_MASK_NBITS);
> +
> +	phylink_helper_basex_speed(state);
>  	return;
>  
>  empty_set:
> -- 
> 2.20.1
> 

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2019-12-17 10:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 17:54 [PATCH net-next v2 0/3] improve clause 45 support in phylink Russell King - ARM Linux admin
2019-12-13 18:22 ` [PATCH net-next v2 1/3] net: phylink: improve clause 45 PHY ksettings_set implementation Russell King
2019-12-13 18:22 ` [PATCH net-next v2 2/3] net: phylink: extend clause 45 PHY validation workaround Russell King
2019-12-13 18:22 ` [PATCH net-next v2 3/3] net: mvpp2: update mvpp2 validate() implementation Russell King
2019-12-17 10:48   ` Antoine Tenart [this message]
2019-12-17 21:26 ` [PATCH net-next v2 0/3] improve clause 45 support in phylink David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191217104849.GH3160@kwain \
    --to=antoine.tenart@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.