🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4486

[PATCH] net: ns83820: drain RX tasklet when stopping the device

#4486
From: Jiale Yao
Date: Sun, 18 Oct 2026 04:07
29 lines
6625 bytes
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
Technical Details
Message-ID: <20261018040708.534335-1-yaojiale02@163.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347938-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-347938-linux-kernel-netdev=dewy.ru
From: yaojiale02@163.com (Jiale Yao)
Newsgroups: linux.kernel.netdev
Subject: [PATCH] net: ns83820: drain RX tasklet when stopping the device
Date: Sun, 18 Oct 2026 12:07:07 +0800
Organization: Usenet Network
Message-ID: <20261018040708.534335-1-yaojiale02@163.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3223867"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Aczt4XhsOqKTrxWnpEyTmVTR0ck= sha256:EogN/FR6QRWWSHz1qDbqZBSW3+CmSxCHb73ToNKhzzE=
	sha1:FwWRaVcHBro9xnMTYBG23rI+Fzw= sha256:exVsfUn5HihGvlcat91hLBZnINKR+0+fWtNXzAy9u60=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id DB3F611076C; Sun, 18 Oct 2026 07:08:17 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=163.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id WEk3Np_3IyiA;
	Sun, 18 Oct 2026 07:08:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-347938-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 55A7B10F981; Sun, 18 Oct 2026 07:08:07 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id C7AA5371D7; Sun, 18 Oct 2026 04:07:35 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id B55973CBE66;
	Sun, 18 Oct 2026 04:07:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="GhsH+GYe"
X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C53361E9919;
	Sun, 18 Oct 2026 04:07:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.3
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792296454; cv=none; b=PS9W3kBo36cueYPSZ+edULNrdZzNRDng0v69Nnl84WIXf+J5q3sNWV3cyI4ApAPy2hFFtGlD4N8l5LvN1qxO3/2z5ywNVrfTNEZ6d7MwDFBTYTgVJFM3d16ucWLPTM4L7s6VlPOdhSQNFvilgsYj6f+hbrGbHcfXbhKHLOOnvrI=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792296454; c=relaxed/simple;
	bh=wZlx5MJONKTUFgsNo5CDSgSqQTh95YMTQ8TLOEUI/V0=;
	h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=W7ZVoNf3RgZwtp3cIX2P+hhDCG9jHcEV8QUgKdQ3rY+jVRjp9UoHvIFk5ITd7AF7APPoz8E4rXLeHHcuMDV95XfTG7sik9mybi6LLp4fEsFKIqAW9xfXkixZveFT2uZXrLlS9qMV+U9prVEjia/vqFkTysjDNvBFJ7gQHvGoORU=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=GhsH+GYe; arc=none smtp.client-ip=220.197.31.3
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;
	s=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=z0
	PGUK16GCy4F9K3jHBuozWKl9+jrqvzut+dg8bfz3E=; b=GhsH+GYetX2QaUz8e+
	FqTi0wvkhOXx0D5mD8g6C3Gs2YKJwkh5sH2XAHOphdUKhBCDCosKh7RhBgu9T98g
	t2KU83Xd0j79E7EIOZIgC3WzOUhW3esO5Ee+gqqjgLMlq40xPufsV0KNAKehiurQ
	B81+/fcVLWoo8QVHJhjY6iE90=
X-Received: from pc.localdomain (unknown [])
	by gzga-smtp-mtada-g0-2 (Coremail) with SMTP id _____wD3PyjuRdRqZzyGAw--.56687S2;
	Sun, 18 Oct 2026 12:07:11 +0800 (CST)
X-Cc: Jiale Yao <yaojiale02@163.com>
X-Mailer: git-send-email 2.34.1
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-CM-TRANSID: _____wD3PyjuRdRqZzyGAw--.56687S2
X-Coremail-Antispam: 1Uf129KBjvdXoWrKFWfKFW8Zw4furWkAFyrZwb_yoWkZFg_uw
	1v9a45Ww45Grs3Kw15KrsxXrZ0ya4q9rn5uayqgrZYqwnrJrs3GFZ7uF1UKr1DWa1ayFWD
	Xr13KFWfA340gjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT
	9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRZR6wUUUUUU==
X-CM-SenderInfo: x1dryxhdohiji6rwjhhfrp/xtbC8A9clmrURe-JbQAA3F