Netdev List
 help / color / mirror / Atom feed
From: Jiale Yao <yaojiale02@163.com>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>
Subject: [PATCH] net: ns83820: drain RX tasklet when stopping the device
Date: Sun, 18 Oct 2026 12:07:07 +0800	[thread overview]
Message-ID: <20261018040708.534335-1-yaojiale02@163.com> (raw)

The receive interrupt handler schedules rx_tasklet after masking RX
completion interrupts. synchronize_irq() waits for the hard IRQ, but it
does not drain a tasklet that was already queued.

The stop path then cleans the RX descriptors, and device removal later
frees the rings and netdev. Kill the tasklet after resetting the device
and synchronizing the IRQ, before cleaning the descriptor state.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/net/ethernet/natsemi/ns83820.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/natsemi/ns83820.c b/drivers/net/ethernet/natsemi/ns83820.c
index cdbf82affa7b..f31c15cb2f51 100644
--- a/drivers/net/ethernet/natsemi/ns83820.c
+++ b/drivers/net/ethernet/natsemi/ns83820.c
@@ -1536,6 +1536,7 @@ static int ns83820_stop(struct net_device *ndev)
 	ns83820_do_reset(dev, CR_RST);
 
 	synchronize_irq(dev->pci_dev->irq);
+	tasklet_kill(&dev->rx_tasklet);
 
 	spin_lock_irq(&dev->misc_lock);
 	dev->IMR_cache &= ~(ISR_TXURN | ISR_TXIDLE | ISR_TXERR | ISR_TXDESC | ISR_TXOK);
-- 
2.34.1


             reply	other threads:[~2026-10-18  4:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18  4:07 Jiale Yao [this message]
2026-10-18  4:13 ` [PATCH] net: ns83820: drain RX tasklet when stopping the device netdev-bot+sinfo

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=20261018040708.534335-1-yaojiale02@163.com \
    --to=yaojiale02@163.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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