All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs
@ 2020-02-04 10:08 Madalin Bucur
  2020-02-05 12:53 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Madalin Bucur @ 2020-02-04 10:08 UTC (permalink / raw)
  To: davem; +Cc: andrew, f.fainelli, hkallweit1, netdev, ykaukab, Madalin Bucur

Stop removing modes that are not supported on the system interface
when the connected PHY is capable of rate adaptation. This addresses
an issue with the LS1046ARDB board 10G interface no longer working
with an 1G link partner after autonegotiation support was added
for the Aquantia PHY on board in

commit 09c4c57f7bc4 ("net: phy: aquantia: add support for auto-negotiation configuration")

Before this commit the values advertised by the PHY were not
influenced by the dpaa_eth driver removal of system-side unsupported
modes as the aqr_config_aneg() was basically a no-op. After this
commit, the modes removed by the dpaa_eth driver were no longer
advertised thus autonegotiation with 1G link partners failed.

Reported-by: Mian Yousaf Kaukab <ykaukab@suse.de>
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
---

change in v3: no longer add an API for checking the capability,
  rely on PHY vendor to determine if more modes may be available
  through rate adaptation so stop removing them

 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index 09dbcd819d84..fd93d542f497 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -2453,6 +2453,9 @@ static void dpaa_adjust_link(struct net_device *net_dev)
 	mac_dev->adjust_link(mac_dev);
 }
 
+/* The Aquantia PHYs are capable of performing rate adaptation */
+#define PHY_VEND_AQUANTIA	0x03a1b400
+
 static int dpaa_phy_init(struct net_device *net_dev)
 {
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
@@ -2471,9 +2474,14 @@ static int dpaa_phy_init(struct net_device *net_dev)
 		return -ENODEV;
 	}
 
-	/* Remove any features not supported by the controller */
-	ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support);
-	linkmode_and(phy_dev->supported, phy_dev->supported, mask);
+	/* Unless the PHY is capable of rate adaptation */
+	if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII ||
+	    ((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) {
+		/* remove any features not supported by the controller */
+		ethtool_convert_legacy_u32_to_link_mode(mask,
+							mac_dev->if_support);
+		linkmode_and(phy_dev->supported, phy_dev->supported, mask);
+	}
 
 	phy_support_asym_pause(phy_dev);
 
-- 
2.1.0


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

* Re: [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs
  2020-02-04 10:08 [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs Madalin Bucur
@ 2020-02-05 12:53 ` David Miller
  2020-02-07 13:19 ` Andrew Lunn
  2020-02-07 13:29 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-05 12:53 UTC (permalink / raw)
  To: madalin.bucur; +Cc: andrew, f.fainelli, hkallweit1, netdev, ykaukab

From: Madalin Bucur <madalin.bucur@oss.nxp.com>
Date: Tue,  4 Feb 2020 12:08:58 +0200

> Stop removing modes that are not supported on the system interface
> when the connected PHY is capable of rate adaptation. This addresses
> an issue with the LS1046ARDB board 10G interface no longer working
> with an 1G link partner after autonegotiation support was added
> for the Aquantia PHY on board in
> 
> commit 09c4c57f7bc4 ("net: phy: aquantia: add support for auto-negotiation configuration")
> 
> Before this commit the values advertised by the PHY were not
> influenced by the dpaa_eth driver removal of system-side unsupported
> modes as the aqr_config_aneg() was basically a no-op. After this
> commit, the modes removed by the dpaa_eth driver were no longer
> advertised thus autonegotiation with 1G link partners failed.
> 
> Reported-by: Mian Yousaf Kaukab <ykaukab@suse.de>
> Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
> ---
> 
> change in v3: no longer add an API for checking the capability,
>   rely on PHY vendor to determine if more modes may be available
>   through rate adaptation so stop removing them

There was quite a discussion about the approach that should be used here
in the short term.

Therefore I'd like some reviews and ACKs from interested parties such as
Andrew, Florian, and Heiner.

Thanks.

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

* Re: [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs
  2020-02-04 10:08 [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs Madalin Bucur
  2020-02-05 12:53 ` David Miller
@ 2020-02-07 13:19 ` Andrew Lunn
  2020-02-07 13:29 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-02-07 13:19 UTC (permalink / raw)
  To: Madalin Bucur; +Cc: davem, f.fainelli, hkallweit1, netdev, ykaukab

On Tue, Feb 04, 2020 at 12:08:58PM +0200, Madalin Bucur wrote:
> Stop removing modes that are not supported on the system interface
> when the connected PHY is capable of rate adaptation. This addresses
> an issue with the LS1046ARDB board 10G interface no longer working
> with an 1G link partner after autonegotiation support was added
> for the Aquantia PHY on board in
> 
> commit 09c4c57f7bc4 ("net: phy: aquantia: add support for auto-negotiation configuration")
> 
> Before this commit the values advertised by the PHY were not
> influenced by the dpaa_eth driver removal of system-side unsupported
> modes as the aqr_config_aneg() was basically a no-op. After this
> commit, the modes removed by the dpaa_eth driver were no longer
> advertised thus autonegotiation with 1G link partners failed.
> 
> Reported-by: Mian Yousaf Kaukab <ykaukab@suse.de>
> Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
> ---
> 
> change in v3: no longer add an API for checking the capability,
>   rely on PHY vendor to determine if more modes may be available
>   through rate adaptation so stop removing them
> 
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index 09dbcd819d84..fd93d542f497 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -2453,6 +2453,9 @@ static void dpaa_adjust_link(struct net_device *net_dev)
>  	mac_dev->adjust_link(mac_dev);
>  }
>  
> +/* The Aquantia PHYs are capable of performing rate adaptation */
> +#define PHY_VEND_AQUANTIA	0x03a1b400
> +
>  static int dpaa_phy_init(struct net_device *net_dev)
>  {
>  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
> @@ -2471,9 +2474,14 @@ static int dpaa_phy_init(struct net_device *net_dev)
>  		return -ENODEV;
>  	}
>  
> -	/* Remove any features not supported by the controller */
> -	ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support);
> -	linkmode_and(phy_dev->supported, phy_dev->supported, mask);
> +	/* Unless the PHY is capable of rate adaptation */
> +	if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII ||
> +	    ((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) {
> +		/* remove any features not supported by the controller */
> +		ethtool_convert_legacy_u32_to_link_mode(mask,
> +							mac_dev->if_support);
> +		linkmode_and(phy_dev->supported, phy_dev->supported, mask);
> +	}
>  
>  	phy_support_asym_pause(phy_dev);

This is reasonable until we figure out a clean way to do this.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


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

* Re: [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs
  2020-02-04 10:08 [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs Madalin Bucur
  2020-02-05 12:53 ` David Miller
  2020-02-07 13:19 ` Andrew Lunn
@ 2020-02-07 13:29 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-07 13:29 UTC (permalink / raw)
  To: madalin.bucur; +Cc: andrew, f.fainelli, hkallweit1, netdev, ykaukab

From: Madalin Bucur <madalin.bucur@oss.nxp.com>
Date: Tue,  4 Feb 2020 12:08:58 +0200

> Stop removing modes that are not supported on the system interface
> when the connected PHY is capable of rate adaptation. This addresses
> an issue with the LS1046ARDB board 10G interface no longer working
> with an 1G link partner after autonegotiation support was added
> for the Aquantia PHY on board in
> 
> commit 09c4c57f7bc4 ("net: phy: aquantia: add support for auto-negotiation configuration")
> 
> Before this commit the values advertised by the PHY were not
> influenced by the dpaa_eth driver removal of system-side unsupported
> modes as the aqr_config_aneg() was basically a no-op. After this
> commit, the modes removed by the dpaa_eth driver were no longer
> advertised thus autonegotiation with 1G link partners failed.
> 
> Reported-by: Mian Yousaf Kaukab <ykaukab@suse.de>
> Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
> ---
> 
> change in v3: no longer add an API for checking the capability,
>   rely on PHY vendor to determine if more modes may be available
>   through rate adaptation so stop removing them

Applied and queued up for -stable, thank you.

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 10:08 [PATCH net v3] dpaa_eth: support all modes with rate adapting PHYs Madalin Bucur
2020-02-05 12:53 ` David Miller
2020-02-07 13:19 ` Andrew Lunn
2020-02-07 13:29 ` David Miller

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.