]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
r8169: fix network lost after resume on DASH systems
authorChunHao Lin <hau@realtek.com>
Thu, 9 Nov 2023 17:34:00 +0000 (01:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:35 +0000 (16:56 +0000)
commit 868c3b95afef4883bfb66c9397482da6840b5baf upstream.

Device that support DASH may be reseted or powered off during suspend.
So driver needs to handle DASH during system suspend and resume. Or
DASH firmware will influence device behavior and causes network lost.

Fixes: b646d90053f8 ("r8169: magic.")
Cc: stable@vger.kernel.org
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: ChunHao Lin <hau@realtek.com>
Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/realtek/r8169_main.c

index 4cb2510f6fac6e011b92d7ff3b850168ad56b024..666394c0f7ec5bc9d9b446cf4e03e0f35714fcc6 100644 (file)
@@ -4714,10 +4714,16 @@ static void rtl8169_down(struct rtl8169_private *tp)
        rtl8169_cleanup(tp, true);
 
        rtl_prepare_power_down(tp);
+
+       if (tp->dash_type != RTL_DASH_NONE)
+               rtl8168_driver_stop(tp);
 }
 
 static void rtl8169_up(struct rtl8169_private *tp)
 {
+       if (tp->dash_type != RTL_DASH_NONE)
+               rtl8168_driver_start(tp);
+
        pci_set_master(tp->pci_dev);
        phy_init_hw(tp->phydev);
        phy_resume(tp->phydev);