Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

r8169: fix RTL8127 hang on suspend/shutdown

There have been reports that RTL8127 hangs on suspend and shutdown,
partially disappearing from lspci until power-cycling.
According to Realtek disabling PLL's when switching to D3 should be
avoided on that chip version. Fix this by aligning disabling PLL's
with the vendor drivers, what in addition results in PLL's not being
disabled when switching to D3hot on other chip versions.

Fixes: f24f7b2f3af9 ("r8169: add support for RTL8127A")
Tested-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/d7faae7e-66bc-404a-a432-3a496600575f@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
ae1737e7 f5bce28f

+14 -5
+14 -5
drivers/net/ethernet/realtek/r8169_main.c
··· 1514 1514 1515 1515 static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable) 1516 1516 { 1517 - if (tp->mac_version >= RTL_GIGA_MAC_VER_25 && 1518 - tp->mac_version != RTL_GIGA_MAC_VER_28 && 1519 - tp->mac_version != RTL_GIGA_MAC_VER_31 && 1520 - tp->mac_version != RTL_GIGA_MAC_VER_38) 1521 - r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, !enable); 1517 + switch (tp->mac_version) { 1518 + case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_24: 1519 + case RTL_GIGA_MAC_VER_28: 1520 + case RTL_GIGA_MAC_VER_31: 1521 + case RTL_GIGA_MAC_VER_38: 1522 + break; 1523 + case RTL_GIGA_MAC_VER_80: 1524 + r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, true); 1525 + break; 1526 + default: 1527 + r8169_mod_reg8_cond(tp, PMCH, D3HOT_NO_PLL_DOWN, true); 1528 + r8169_mod_reg8_cond(tp, PMCH, D3COLD_NO_PLL_DOWN, !enable); 1529 + break; 1530 + } 1522 1531 } 1523 1532 1524 1533 static void rtl_reset_packet_filter(struct rtl8169_private *tp)