All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] r8169: fix data corruption issue on RTL8402
@ 2020-10-01  7:23 Heiner Kallweit
  2020-10-01 19:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2020-10-01  7:23 UTC (permalink / raw)
  To: Jakub Kicinski, David Miller, Realtek linux nic maintainers
  Cc: netdev, Petr Tesarik

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>
---
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(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 72351c5b0..0fa99298a 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -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);
 }
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] r8169: fix data corruption issue on RTL8402
  2020-10-01  7:23 [PATCH net] r8169: fix data corruption issue on RTL8402 Heiner Kallweit
@ 2020-10-01 19:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-10-01 19:38 UTC (permalink / raw)
  To: hkallweit1; +Cc: kuba, nic_swsd, netdev, ptesarik

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Thu, 1 Oct 2020 09:23:02 +0200

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-01 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01  7:23 [PATCH net] r8169: fix data corruption issue on RTL8402 Heiner Kallweit
2020-10-01 19:38 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.