netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] r8169: fix autoneg issue on resume with RTL8168E
@ 2018-09-20 20:47 Heiner Kallweit
  2018-09-21  2:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2018-09-20 20:47 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers
  Cc: netdev@vger.kernel.org, Neil MacLeod

It was reported that chip version 33 (RTL8168E) ends up with
10MBit/Half on a 1GBit link after resuming from S3 (with different
link partners). For whatever reason the PHY on this chip doesn't
properly start a renegotiation when soft-reset.
Explicitly requesting a renegotiation fixes this.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Fixes: a2965f12fde6 ("r8169: remove rtl8169_set_speed_xmii")
Reported-by: Neil MacLeod <neil@nmacleod.com>
Tested-by: Neil MacLeod <neil@nmacleod.com>
---
 drivers/net/ethernet/realtek/r8169.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 1d8631303..7f4647c58 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4069,6 +4069,15 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
 	phy_speed_up(dev->phydev);
 
 	genphy_soft_reset(dev->phydev);
+
+	/* It was reported that chip version 33 ends up with 10MBit/Half on a
+	 * 1GBit link after resuming from S3. For whatever reason the PHY on
+	 * this chip doesn't properly start a renegotiation when soft-reset.
+	 * Explicitly requesting a renegotiation fixes this.
+	 */
+	if (tp->mac_version == RTL_GIGA_MAC_VER_33 &&
+	    dev->phydev->autoneg == AUTONEG_ENABLE)
+		phy_restart_aneg(dev->phydev);
 }
 
 static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
-- 
2.19.0

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

* Re: [PATCH net] r8169: fix autoneg issue on resume with RTL8168E
  2018-09-20 20:47 [PATCH net] r8169: fix autoneg issue on resume with RTL8168E Heiner Kallweit
@ 2018-09-21  2:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-09-21  2:59 UTC (permalink / raw)
  To: hkallweit1; +Cc: nic_swsd, netdev, neil

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Thu, 20 Sep 2018 22:47:09 +0200

> It was reported that chip version 33 (RTL8168E) ends up with
> 10MBit/Half on a 1GBit link after resuming from S3 (with different
> link partners). For whatever reason the PHY on this chip doesn't
> properly start a renegotiation when soft-reset.
> Explicitly requesting a renegotiation fixes this.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> Fixes: a2965f12fde6 ("r8169: remove rtl8169_set_speed_xmii")
> Reported-by: Neil MacLeod <neil@nmacleod.com>
> Tested-by: Neil MacLeod <neil@nmacleod.com>

Applied, thank you.

Please always make "Fixes: " the first tag in a set of tags.

I fixed it up for you this time.

Thanks.

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

end of thread, other threads:[~2018-09-21  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 20:47 [PATCH net] r8169: fix autoneg issue on resume with RTL8168E Heiner Kallweit
2018-09-21  2:59 ` David Miller

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