netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] r8169: fix rare issue with broken rx after link-down on RTL8125
@ 2023-10-12  6:51 Heiner Kallweit
  2023-10-14  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2023-10-12  6:51 UTC (permalink / raw)
  To: David Miller, Paolo Abeni, Jakub Kicinski, Eric Dumazet,
	Realtek linux nic maintainers
  Cc: netdev@vger.kernel.org, Martin Kjær Jørgensen

In very rare cases (I've seen two reports so far about different
RTL8125 chip versions) it seems the MAC locks up when link goes down
and requires a software reset to get revived.
Realtek doesn't publish hw errata information, therefore the root cause
is unknown. Realtek vendor drivers do a full hw re-initialization on
each link-up event, the slimmed-down variant here was reported to fix
the issue for the reporting user.
It's not fully clear which parts of the NIC are reset as part of the
software reset, therefore I can't rule out side effects.
Therefore apply the fix to net-next only. If no side effects are
reported, it can be submitted for stable later.

Fixes: f1bce4ad2f1c ("r8169: add support for RTL8125")
Reported-by: Martin Kjær Jørgensen <me@lagy.org>
Link: https://lore.kernel.org/netdev/97ec2232-3257-316c-c3e7-a08192ce16a6@gmail.com/T/
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 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 6351a2dc1..df0df4d09 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4596,7 +4596,11 @@ static void r8169_phylink_handler(struct net_device *ndev)
 	if (netif_carrier_ok(ndev)) {
 		rtl_link_chg_patch(tp);
 		pm_request_resume(d);
+		netif_wake_queue(tp->dev);
 	} else {
+		/* In few cases rx is broken after link-down otherwise */
+		if (rtl_is_8125(tp))
+			rtl_reset_work(tp);
 		pm_runtime_idle(d);
 	}
 
-- 
2.42.0


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

* Re: [PATCH net-next] r8169: fix rare issue with broken rx after link-down on RTL8125
  2023-10-12  6:51 [PATCH net-next] r8169: fix rare issue with broken rx after link-down on RTL8125 Heiner Kallweit
@ 2023-10-14  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-14  0:50 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: davem, pabeni, kuba, edumazet, nic_swsd, netdev, me

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 12 Oct 2023 08:51:13 +0200 you wrote:
> In very rare cases (I've seen two reports so far about different
> RTL8125 chip versions) it seems the MAC locks up when link goes down
> and requires a software reset to get revived.
> Realtek doesn't publish hw errata information, therefore the root cause
> is unknown. Realtek vendor drivers do a full hw re-initialization on
> each link-up event, the slimmed-down variant here was reported to fix
> the issue for the reporting user.
> It's not fully clear which parts of the NIC are reset as part of the
> software reset, therefore I can't rule out side effects.
> Therefore apply the fix to net-next only. If no side effects are
> reported, it can be submitted for stable later.
> 
> [...]

Here is the summary with links:
  - [net-next] r8169: fix rare issue with broken rx after link-down on RTL8125
    https://git.kernel.org/netdev/net-next/c/621735f59064

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-10-14  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12  6:51 [PATCH net-next] r8169: fix rare issue with broken rx after link-down on RTL8125 Heiner Kallweit
2023-10-14  0:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).