linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [net-next PATCH v3 2/5] net: ethernet: stmicro: stmmac: first disable all queues in release
Date: Mon, 18 Jul 2022 10:19:29 +0100	[thread overview]
Message-ID: <YtUloYvDtTxX1MQA@shell.armlinux.org.uk> (raw)
In-Reply-To: <20220716230802.20788-3-ansuelsmth@gmail.com>

On Sun, Jul 17, 2022 at 01:07:59AM +0200, Christian Marangi wrote:
> Disable all queues before tx_disable in stmmac_release to prevent a
> corner case where packet may be still queued at the same time tx_disable
> is called resulting in kernel panic if some packet still has to be
> processed.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 5578abb14949..1854dcdd6095 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3758,6 +3758,11 @@ static int stmmac_release(struct net_device *dev)
>  	struct stmmac_priv *priv = netdev_priv(dev);
>  	u32 chan;
>  
> +	stmmac_disable_all_queues(priv);
> +
> +	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
> +		hrtimer_cancel(&priv->tx_queue[chan].txtimer);
> +
>  	netif_tx_disable(dev);

Is there a reason not to call phylink_stop() as the very first thing in
this function? That will bring the link (and therefore carrier) down
before phylink_stop() returns which should also prevent packets being
queued into the driver for transmission.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-07-18  9:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-16 23:07 [net-next PATCH v3 0/5] Add MTU change with stmmac interface running Christian Marangi
2022-07-16 23:07 ` [net-next PATCH v3 1/5] net: ethernet: stmicro: stmmac: move queue reset to dedicated functions Christian Marangi
2022-07-16 23:07 ` [net-next PATCH v3 2/5] net: ethernet: stmicro: stmmac: first disable all queues in release Christian Marangi
2022-07-18  9:19   ` Russell King (Oracle) [this message]
2022-07-16 23:08 ` [net-next PATCH v3 3/5] net: ethernet: stmicro: stmmac: move dma conf to dedicated struct Christian Marangi
2022-07-16 23:08 ` [net-next PATCH v3 4/5] net: ethernet: stmicro: stmmac: generate stmmac dma conf before open Christian Marangi
2022-07-16 23:08 ` [net-next PATCH v3 5/5] net: ethernet: stmicro: stmmac: permit MTU change with interface up Christian Marangi

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=YtUloYvDtTxX1MQA@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=alexandre.torgue@foss.st.com \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.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;
as well as URLs for NNTP newsgroup(s).