Netdev List
 help / color / mirror / Atom feed
From: Chris Babroski <cbabroski@nvidia.com>
To: <netdev-bot+sashiko@kernel.org>
Cc: <Raju.Lakkaraju@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<andrew+netdev@lunn.ch>, <bryan.whitehead@microchip.com>,
	<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 2/5] net: lan743x: start phylink last and stop it first
Date: Tue, 27 Oct 2026 13:07:02 -0400	[thread overview]
Message-ID: <20261027170702.576476-1-cbabroski@nvidia.com> (raw)
In-Reply-To: <179242764576.3135.4479437969199107753@kernel.org>

> > @@ -3334,6 +3334,8 @@ static int lan743x_netdev_close(struct net_device *netdev)
> >  	struct lan743x_adapter *adapter = netdev_priv(netdev);
> >  	int index;
> >  
> > +	lan743x_phylink_disconnect(adapter);
> > +
> >  	for (index = 0; index < adapter->used_tx_channels; index++)
> >  		lan743x_tx_close(&adapter->tx[index]);
>
> [Severity: High]
> Can a TX queue get woken again after this point and stay awake while the
> rings are freed?
> ...
> This looks to be fixed later in the series by "net: lan743x: quiesce TX
> before freeing the rings". That commit adds a netif_device_present() check
> before the NAPI wake, and adds synchronize_net() plus netif_tx_disable()
> after lan743x_phylink_disconnect() in lan743x_netdev_close().

As mentioned by Sashiko, this issue is resolved in patch 3/5. For v2 I
will rearrange the commit order so that patch 3/5 comes before this one.

> [Severity: High]
> Can a transmit that is already in flight also race with the ring
> teardown here?
> ...
> This also appears to be fixed later in the series by "net: lan743x:
> quiesce TX before freeing the rings", which adds synchronize_net() and
> netif_tx_disable() right after lan743x_phylink_disconnect().
> netif_tx_disable() takes each txq lock, so it waits for in-flight
> transmits.

Same as above.

> > @@ -3387,6 +3383,10 @@ static int lan743x_netdev_open(struct net_device *netdev)
> >  			goto close_tx;
> >  	}
> >  
> > +	ret = lan743x_phylink_connect(adapter);
> > +	if (ret)
> > +		goto close_tx;
> > +
>
> [Severity: High]
> This is a pre-existing issue, but does every open after the first one
> fail on LAN7431/PCI11x1x boards that have no DT node and no PHY on the
> MDIO bus?

This is a pre-existing issue and doesn't occur on the HW I have
available to test with so I'm hesitant to change as part of this patch
series. It feels out of scope, but if the maintainers can provide an
appropriate fix and want it included in this patch series I can make the
change as part of a later revision.

> [Severity: High]
> This isn't a bug introduced by this patch, but what happens on resume
> when this goto close_tx is taken?
> ...
> A transmit path that bypasses the qdisc and does not check carrier, such
> as netpoll, could also reach lan743x_tx_xmit_frame() while ring_cpu_ptr
> and buffer_info are NULL.
> 
> Together with the fixed-link -EINVAL above, every resume on fixed-link
> boards without a DT node would hit this. It still seems to be present at
> the end of the series. The lan743x_netdev_stop() wrapper added later only
> skips close when !netif_device_present(), and resume has already
> re-attached the device by then.

Same as above.

Thanks,
Chris

  reply	other threads:[~2026-10-27 17:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 16:34 [PATCH net-next v1 2/5] net: lan743x: start phylink last and stop it first netdev-bot+sashiko
2026-10-27 17:07 ` Chris Babroski [this message]
  -- strict thread matches above, loose matches on Subject: below --
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 2/5] net: lan743x: start phylink last and stop it first Chris Babroski
2026-10-19 10:13   ` Nicolai Buchwitz

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=20261027170702.576476-1-cbabroski@nvidia.com \
    --to=cbabroski@nvidia.com \
    --cc=Raju.Lakkaraju@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --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-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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