All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G
@ 2019-02-21 16:54 ` Maxime Chevallier
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Chevallier @ 2019-02-21 16:54 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King,
	linux-arm-kernel, Antoine Tenart, thomas.petazzoni

Some Marvell Alaska PHYs support 2.5G, 5G and 10G BaseT links. Their
default behaviour is to advertise all of these modes, but at the moment,
only 10GBaseT is supported. To prevent link partners from establishing
link at that speed, clear these modes upon configuring aneg parameters.

Fixes: 20b2af32ff3f ("net: phy: add Marvell Alaska X 88X3310 10Gigabit PHY support")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reported-by: Russell King <linux@armlinux.org.uk>
---

Dave,

This patch will conflict when merging net into net-next, and is actually
not needed there. In net-next, this issue is fixed by the recent work
done by Andrew and Heiner, that introduce more generic ways to handle aneg
configuration for C45 PHYs.

The commit fixing this would be :
3de97f3c6308 ("net: phy: marvell10g: use genphy_c45_an_config_aneg")

However this fix should be backported, hence why it was implemented in a
small standalone patch here.

Please tell me if you have any issue with this.

Thanks,

Maxime

 drivers/net/phy/marvell10g.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 82ab6ed3b74e..6bac602094bd 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -26,6 +26,8 @@
 #include <linux/marvell_phy.h>
 #include <linux/phy.h>
 
+#define MDIO_AN_10GBT_CTRL_ADV_NBT_MASK	0x01e0
+
 enum {
 	MV_PCS_BASE_T		= 0x0000,
 	MV_PCS_BASE_R		= 0x1000,
@@ -386,8 +388,10 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	else
 		reg = 0;
 
+	/* Make sure we clear unsupported 2.5G/5G advertising */
 	ret = mv3310_modify(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
-			    MDIO_AN_10GBT_CTRL_ADV10G, reg);
+			    MDIO_AN_10GBT_CTRL_ADV10G |
+			    MDIO_AN_10GBT_CTRL_ADV_NBT_MASK, reg);
 	if (ret < 0)
 		return ret;
 	if (ret > 0)
-- 
2.19.2


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

* [PATCH net] net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G
@ 2019-02-21 16:54 ` Maxime Chevallier
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Chevallier @ 2019-02-21 16:54 UTC (permalink / raw)
  To: davem
  Cc: Andrew Lunn, Florian Fainelli, Antoine Tenart, netdev,
	linux-kernel, Maxime Chevallier, thomas.petazzoni, Russell King,
	linux-arm-kernel, Heiner Kallweit

Some Marvell Alaska PHYs support 2.5G, 5G and 10G BaseT links. Their
default behaviour is to advertise all of these modes, but at the moment,
only 10GBaseT is supported. To prevent link partners from establishing
link at that speed, clear these modes upon configuring aneg parameters.

Fixes: 20b2af32ff3f ("net: phy: add Marvell Alaska X 88X3310 10Gigabit PHY support")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reported-by: Russell King <linux@armlinux.org.uk>
---

Dave,

This patch will conflict when merging net into net-next, and is actually
not needed there. In net-next, this issue is fixed by the recent work
done by Andrew and Heiner, that introduce more generic ways to handle aneg
configuration for C45 PHYs.

The commit fixing this would be :
3de97f3c6308 ("net: phy: marvell10g: use genphy_c45_an_config_aneg")

However this fix should be backported, hence why it was implemented in a
small standalone patch here.

Please tell me if you have any issue with this.

Thanks,

Maxime

 drivers/net/phy/marvell10g.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
index 82ab6ed3b74e..6bac602094bd 100644
--- a/drivers/net/phy/marvell10g.c
+++ b/drivers/net/phy/marvell10g.c
@@ -26,6 +26,8 @@
 #include <linux/marvell_phy.h>
 #include <linux/phy.h>
 
+#define MDIO_AN_10GBT_CTRL_ADV_NBT_MASK	0x01e0
+
 enum {
 	MV_PCS_BASE_T		= 0x0000,
 	MV_PCS_BASE_R		= 0x1000,
@@ -386,8 +388,10 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	else
 		reg = 0;
 
+	/* Make sure we clear unsupported 2.5G/5G advertising */
 	ret = mv3310_modify(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
-			    MDIO_AN_10GBT_CTRL_ADV10G, reg);
+			    MDIO_AN_10GBT_CTRL_ADV10G |
+			    MDIO_AN_10GBT_CTRL_ADV_NBT_MASK, reg);
 	if (ret < 0)
 		return ret;
 	if (ret > 0)
-- 
2.19.2


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

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

* Re: [PATCH net] net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G
  2019-02-21 16:54 ` Maxime Chevallier
@ 2019-02-23 21:28   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-23 21:28 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: netdev, linux-kernel, andrew, f.fainelli, hkallweit1, linux,
	linux-arm-kernel, antoine.tenart, thomas.petazzoni

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Thu, 21 Feb 2019 17:54:11 +0100

> Some Marvell Alaska PHYs support 2.5G, 5G and 10G BaseT links. Their
> default behaviour is to advertise all of these modes, but at the moment,
> only 10GBaseT is supported. To prevent link partners from establishing
> link at that speed, clear these modes upon configuring aneg parameters.
> 
> Fixes: 20b2af32ff3f ("net: phy: add Marvell Alaska X 88X3310 10Gigabit PHY support")
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Reported-by: Russell King <linux@armlinux.org.uk>
> ---
> 
> Dave,
> 
> This patch will conflict when merging net into net-next, and is actually
> not needed there. In net-next, this issue is fixed by the recent work
> done by Andrew and Heiner, that introduce more generic ways to handle aneg
> configuration for C45 PHYs.
> 
> The commit fixing this would be :
> 3de97f3c6308 ("net: phy: marvell10g: use genphy_c45_an_config_aneg")
> 
> However this fix should be backported, hence why it was implemented in a
> small standalone patch here.
> 
> Please tell me if you have any issue with this.

Understood, this is fine.

Applied and queued up for -stable.

Thanks.

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

* Re: [PATCH net] net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G
@ 2019-02-23 21:28   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-23 21:28 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: andrew, f.fainelli, antoine.tenart, netdev, linux, linux-kernel,
	thomas.petazzoni, linux-arm-kernel, hkallweit1

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Thu, 21 Feb 2019 17:54:11 +0100

> Some Marvell Alaska PHYs support 2.5G, 5G and 10G BaseT links. Their
> default behaviour is to advertise all of these modes, but at the moment,
> only 10GBaseT is supported. To prevent link partners from establishing
> link at that speed, clear these modes upon configuring aneg parameters.
> 
> Fixes: 20b2af32ff3f ("net: phy: add Marvell Alaska X 88X3310 10Gigabit PHY support")
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Reported-by: Russell King <linux@armlinux.org.uk>
> ---
> 
> Dave,
> 
> This patch will conflict when merging net into net-next, and is actually
> not needed there. In net-next, this issue is fixed by the recent work
> done by Andrew and Heiner, that introduce more generic ways to handle aneg
> configuration for C45 PHYs.
> 
> The commit fixing this would be :
> 3de97f3c6308 ("net: phy: marvell10g: use genphy_c45_an_config_aneg")
> 
> However this fix should be backported, hence why it was implemented in a
> small standalone patch here.
> 
> Please tell me if you have any issue with this.

Understood, this is fine.

Applied and queued up for -stable.

Thanks.

_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2019-02-23 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 16:54 [PATCH net] net: phy: marvell10g: Fix Multi-G advertisement to only advertise 10G Maxime Chevallier
2019-02-21 16:54 ` Maxime Chevallier
2019-02-23 21:28 ` David Miller
2019-02-23 21:28   ` 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.