[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<DM4P220MB0843AC6F4426191B50320B01D2BEA@DM4P220MB0843.NAMP220.PROD.OUTLOOK.COM>
Date: Mon, 27 Nov 2023 00:58:40 +0800
From: Ian Chen <free122448@...mail.com>
To: Heiner Kallweit <hkallweit1@...il.com>, netdev@...r.kernel.org
Subject: Re: [BUG] r8169: deadlock when NetworkManager brings link up
On Sat, 2023-11-25 at 18:36 +0100, Heiner Kallweit wrote:
> Could you please test whether the following fixes the issue for you?
>
> ---
> drivers/net/ethernet/realtek/r8169_main.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c
> b/drivers/net/ethernet/realtek/r8169_main.c
> index 0aed99a20..e32cc3279 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -575,6 +575,7 @@ struct rtl8169_tc_offsets {
> enum rtl_flag {
> RTL_FLAG_TASK_ENABLED = 0,
> RTL_FLAG_TASK_RESET_PENDING,
> + RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE,
> RTL_FLAG_TASK_TX_TIMEOUT,
> RTL_FLAG_MAX
> };
> @@ -4494,6 +4495,8 @@ static void rtl_task(struct work_struct *work)
> reset:
> rtl_reset_work(tp);
> netif_wake_queue(tp->dev);
> + } else if
> (test_and_clear_bit(RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE, tp->wk.flags))
> {
> + rtl_reset_work(tp);
> }
> out_unlock:
> rtnl_unlock();
> @@ -4527,7 +4530,7 @@ static void r8169_phylink_handler(struct
> net_device *ndev)
> } else {
> /* In few cases rx is broken after link-down
> otherwise */
> if (rtl_is_8125(tp))
> - rtl_reset_work(tp);
> + rtl_schedule_task(tp,
> RTL_FLAG_TASK_RESET_NO_QUEUE_WAKE);
> pm_runtime_idle(d);
> }
>
> @@ -4603,7 +4606,7 @@ static int rtl8169_close(struct net_device
> *dev)
> rtl8169_down(tp);
> rtl8169_rx_clear(tp);
>
> - cancel_work_sync(&tp->wk.work);
> + cancel_work(&tp->wk.work);
>
> free_irq(tp->irq, tp);
>
I can confirm that this patch fixes the issue for me, thanks!
> Are you using a jumbo mtu?
Yes, I configured the network interface to use 9000 as the MTU.
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists