Skip to contentSkip to conversation

r8169: fix data corruption issue on RTL8402

PATCH In review Heiner Kallweit 2 participants 2 messages Oct 1, 2020

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 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
index 72351c5b0..0fa99298a 100644
@@ -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
maintainer
#1 lore raw

From: 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.

Quoted 8 lines

---
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".

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.