]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
r8169: fix data corruption issue on RTL8402
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 1 Oct 2020 07:23:02 +0000 (09:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:03 +0000 (10:07 +0100)
[ Upstream commit ef9da46ddef071e1bbb943afbbe9b38771855554 ]

Petr reported that after resume from suspend RTL8402 partially
truncates incoming packets, and re-initializing register RxConfig
before the actual chip re-initialization sequence is needed to avoid
the issue.

Reported-by: Petr Tesarik <ptesarik@suse.cz>
Proposed-by: Petr Tesarik <ptesarik@suse.cz>
Tested-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/realtek/r8169_main.c

index fe173ea894e2c7f2e4143f0bd60ed08270fcf22f..eba609bf4f1b967457e2bf4f506f5c1c6f410e2c 100644 (file)
@@ -4871,6 +4871,10 @@ static int __maybe_unused rtl8169_resume(struct device *device)
        if (netif_running(tp->dev))
                __rtl8169_resume(tp);
 
+       /* Reportedly at least Asus X453MA truncates packets otherwise */
+       if (tp->mac_version == RTL_GIGA_MAC_VER_37)
+               rtl_init_rxcfg(tp);
+
        return 0;
 }