OSDN Git Service

r8169: fix data corruption issue on RTL8402
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 1 Oct 2020 07:23:02 +0000 (09:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Oct 2020 19:37:21 +0000 (12:37 -0700)
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: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169_main.c

index 4ae1a6f..256bc48 100644 (file)
@@ -4854,6 +4854,10 @@ static int __maybe_unused rtl8169_resume(struct device *device)
        if (!device_may_wakeup(tp_to_dev(tp)))
                clk_prepare_enable(tp->clk);
 
+       /* Reportedly at least Asus X453MA truncates packets otherwise */
+       if (tp->mac_version == RTL_GIGA_MAC_VER_37)
+               rtl_init_rxcfg(tp);
+
        return rtl8169_net_resume(tp);
 }