From: Chris Babroski <cbabroski@nvidia.com>
To: <woojung.huh@microchip.com>
Cc: <Bryan.Whitehead@microchip.com>, <Raju.Lakkaraju@microchip.com>,
<UNGLinuxDriver@microchip.com>, <andrew+netdev@lunn.ch>,
<cbabroski@nvidia.com>, <davem@davemloft.net>,
<davthompson@nvidia.com>, <edumazet@kernel.org>,
<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
<linux@armlinux.org.uk>, <maxime.chevallier@bootlin.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>,
<richardcochran@gmail.com>
Subject: Re: [PATCH net-next v1 3/5] net: lan743x: quiesce TX before freeing the rings
Date: Tue, 27 Oct 2026 13:44:14 -0400 [thread overview]
Message-ID: <20261027174414.578524-1-cbabroski@nvidia.com> (raw)
In-Reply-To: <BN7PR11MB2836EB5375FADA5AAB831982E7662@BN7PR11MB2836.namprd11.prod.outlook.com>
Hi Woojung,
> > @@ -3336,6 +3337,9 @@ static int lan743x_netdev_close(struct net_device
> > *netdev)
> >
> > lan743x_phylink_disconnect(adapter);
> >
> > + synchronize_net();
> > + netif_tx_disable(netdev);
>
> synchronize_net() is called inside of lan743x_tx_close() and lan743x_rx_close()
> via netif_napi_del(). Do you see current order of calling is an issue?
>
> > +
> > for (index = 0; index < adapter->used_tx_channels; index++)
> > lan743x_tx_close(&adapter->tx[index]);
This was a change introduced after AI review flagged a potential race
condition:
1. On CPU A, the TX NAPI poll now checks netif_device_present() and gets
true.
2. On CPU B, netif_device_detach() runs, then lan743x_netdev_close()
calls netif_tx_disable() and the queue is stopped.
3. CPU A calls netif_tx_wake_queue() and the queue is running again.
4. The qdisc is still attached in the suspend and reset paths, so the
stack transmits into the ring while lan743x_tx_close() frees it.
So the synchronize_net() called via lan743x_tx_close() can't prevent
NAPI poll from waking the queue again.
The fix is to wait for NAPI poll to complete with synchronize_net()
first to prevent unexpected queue wake before netif_tx_disable() stops
the queue and waits for transmits to complete.
This is unlikely to happen as part of the TX hang scenario because the
reset in that case comes after TX has stopped. The pre-existing
conditions that could see this would be suspend, reboot, or kexec on a
multi-core system under TX load.
Given that this is not directly related to TX hang recovery I could
drop it from this patch series if you prefer.
Thanks,
Chris
next prev parent reply other threads:[~2026-10-27 17:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 15:00 [PATCH net-next v1 0/5] net: lan743x: automatically recover from TX hang Chris Babroski
2026-10-15 15:00 ` [PATCH net-next v1 1/5] net: lan743x: reset DMA channels that fail to stop Chris Babroski
2026-10-19 10:18 ` Nicolai Buchwitz
2026-10-22 20:16 ` Woojung.Huh
2026-10-27 14:14 ` Chris Babroski
2026-10-21 19:53 ` Nicolai Buchwitz
2026-10-22 19:59 ` Woojung.Huh
2026-10-23 18:56 ` Woojung.Huh
2026-10-27 15:02 ` Chris Babroski
2026-10-15 15:00 ` [PATCH net-next v1 2/5] net: lan743x: start phylink last and stop it first Chris Babroski
2026-10-19 10:13 ` Nicolai Buchwitz
2026-10-15 15:00 ` [PATCH net-next v1 3/5] net: lan743x: quiesce TX before freeing the rings Chris Babroski
2026-10-19 10:14 ` Nicolai Buchwitz
2026-10-21 18:20 ` Woojung.Huh
2026-10-27 17:44 ` Chris Babroski [this message]
2026-10-15 15:00 ` [PATCH net-next v1 4/5] net: lan743x: reset the device on TX timeout Chris Babroski
2026-10-19 10:23 ` Nicolai Buchwitz
2026-10-27 20:14 ` Chris Babroski
2026-10-15 15:00 ` [PATCH net-next v1 5/5] net: lan743x: add byte queue limits support Chris Babroski
2026-10-19 10:14 ` Nicolai Buchwitz
2026-10-19 9:47 ` [PATCH net-next v1 0/5] net: lan743x: automatically recover from TX hang Nicolai Buchwitz
2026-10-20 20:36 ` Chris Babroski
2026-10-21 8:06 ` Nicolai Buchwitz
2026-10-21 19:23 ` Chris Babroski
2026-10-21 19:48 ` Nicolai Buchwitz
2026-10-26 19:21 ` Chris Babroski
2026-10-19 19:49 ` Woojung.Huh
2026-10-26 20:31 ` Woojung.Huh
2026-10-21 1:07 ` Jakub Kicinski
2026-10-21 14:03 ` Chris Babroski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027174414.578524-1-cbabroski@nvidia.com \
--to=cbabroski@nvidia.com \
--cc=Bryan.Whitehead@microchip.com \
--cc=Raju.Lakkaraju@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=davthompson@nvidia.com \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®