r8169: fix data corruption issue on RTL8402
Heiner Kallweit
maintainerPATCH 1/1 r8169: fix data corruption issue on RTL8402
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.
---
Hard to provide a Fixes tag because it seems the issue has been always there. Due to frequent changes in function rtl8169_resume() we would need a number of different fixes for the stable kernel versions. That the issue was reported only now indicates that chip version RTL8402 is rare. Therefore treat this change mainly as an improvement. This fix version applies from 5.9 after just submitted fix "r8169: fix handling ether_clk".
--- drivers/net/ethernet/realtek/r8169_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +4 -0
@@ -4848,6 +4848,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); }
Signature · 1 line
2.28.0
David Miller
maintainerFrom: Heiner Kallweit <[email protected]>
Date: Thu, 1 Oct 2020 09:23:02 +0200
Quoted 9 lines
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 <[email protected]>Proposed-by Petr Tesarik <[email protected]>Tested-by Petr Tesarik <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>
Quoted 8 lines
---
Hard to provide a Fixes tag because it seems the issue has been always there. Due to frequent changes in functionrtl8169_resume()we would need a number of different fixes for the stable kernel versions. That the issue was reported only now indicates that chip version RTL8402 is rare. Therefore treat this change mainly as an improvement. This fix version applies from 5.9 after just submitted fix "r8169: fix handlingether_clk".
Applied and queued up for -stable.
In the future you can use a Fixes: tag using the root commit of the entire Linux git tree in situations like this.
Thanks.