Netdev List
 help / color / mirror / Atom feed
From: Chris Babroski <cbabroski@nvidia.com>
To: <woojung.huh@microchip.com>
Cc: <Bryan.Whitehead@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>, <nb@tipi-net.de>,
	<netdev@vger.kernel.org>, <pabeni@redhat.com>,
	<richardcochran@gmail.com>
Subject: RE: [PATCH net-next v1 1/5] net: lan743x: reset DMA channels that fail to stop
Date: Tue, 27 Oct 2026 10:14:54 -0400	[thread overview]
Message-ID: <20261027141454.561978-1-cbabroski@nvidia.com> (raw)
In-Reply-To: <BN7PR11MB2836B99696C08DFEA516C8F6E7652@BN7PR11MB2836.namprd11.prod.outlook.com>

Hi Woojung and Nicolai,

> > > @@ -2271,11 +2300,11 @@ static int lan743x_tx_open(struct lan743x_tx
> > > *tx)
> > >                         FCT_TX_CTL_EN_(tx->channel_number));
> > >
> > >       /* reset tx channel */
> > > -     lan743x_csr_write(adapter, DMAC_CMD,
> > > -                       DMAC_CMD_TX_SWR_(tx->channel_number));
> > > -     lan743x_csr_wait_for_bit(adapter, DMAC_CMD,
> > > -                              DMAC_CMD_TX_SWR_(tx->channel_number),
> > > -                              0, 1000, 20000, 100);
> > > +     ret = lan743x_dmac_tx_reset(adapter, tx->channel_number);
> > > +     if (ret)
> > > +             netdev_err(adapter->netdev,
> > > +                        "TX channel %d reset timed out\n",
> > > +                        tx->channel_number);
> > 
> > Not a bug, but what's the benefit of keeping going here?
> > 
> > If the channel never came out of reset, lan743x_tx_open() and
> > lan743x_rx_open() could return the error instead of starting it anyway.
> > 
> > With the reset work from 4/5 a failed reopen then ends in dev_close(),
> > which seems like the better place to end up. It would also settle the
> > open question from the cover letter.
> > 
> Agree with Nicolai's comment that returning error at lan743x_tx/rx_open() to
> make lan743x_netdev_open() returns with error.

Sounds good. I'll update V2 to handle the timeout error by cleaning up
previously initialized steps and then return the error.

One thing worth noting is that every call to lan743x_csr_wait_for_bit()
could technically time out and most cases are unhandled by the driver
today. My goal was to avoid making too many unrelated changes as part of
this patch series, but more error handling could potentially be added as
part of a future series.

Thanks,
Chris

  reply	other threads:[~2026-10-27 14:15 UTC|newest]

Thread overview: 33+ 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 [this message]
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
2026-10-28 15:22       ` Woojung.Huh
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
  -- strict thread matches above, loose matches on Subject: below --
2026-10-19 16:34 [PATCH net-next v1 1/5] net: lan743x: reset DMA channels that fail to stop netdev-bot+sashiko
2026-10-27 15:19 ` 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=20261027141454.561978-1-cbabroski@nvidia.com \
    --to=cbabroski@nvidia.com \
    --cc=Bryan.Whitehead@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=nb@tipi-net.de \
    --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