From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385313; b=2muT92LIbHz68QTJWsLrAYcULn8tIeGd79+m4QiYMLXr2VrAjzC2s5GQrS0asfpbjs1Q TtQXbOcrYi3RGZXa27HuLb5brkijm7dnm43eKRZtQhDc6+poREOFvEGBkmHUl/vvBgEJ5 cvcM4uiOLI5JLCZl/T6s+HCSOK64C7SWHfiLNPR8NlObOtgfANS5ZCyrhotQkB9TM2MVG OSV2c9/+iVP/tA8hRCOiGEt0RH+eTDnwLWisMF19sHrHy+L/NgrApCN4K7l5lxwCvgkia EUf9Z5a36s/8SdLhf1pPMcJvGgq+8jXWZkdCf0RiDrZ7WSHXXE0rzLegrednL+aFJeg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385313; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Iu5C3ooRaWKjY7somX4iTbM3ydgKzvZrW86nV/Ycor0=; b=SqEA02K+/v5eTEsI9K0TfQ6uOYy48V9LPZukoW0owrMB1EzmaupeAO1IJbq/WOVEui7h pljZ+lu38fG9sKsln5HEdvuq4kGB9EFOUDTOw6jomwQGWkL+Gsotz+YUDB+HtMSwQLqop BdJRAyTgV34NP1MrAEknSkz7axWTTyxuOU9Ih++vFIvqkPINnlL4Doj3CENvJrnpEJAlp AqvFtBCOag22YQeG+rDVSliDCZXZ183S+litrrANrgObonX0d5g+zHoQ+LmzGZdWEGAcv kCZU4vYmonTgJhi6ajgjKeZYwHRJJAZdBseQZ2KtxoM41Y+ynj8uB82Sqs/O9K6URyg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tj79JawY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E889A606A322; Fri, 4 Dec 2026 11:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tj79JawY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 652E41F000C2; Fri, 4 Dec 2026 11:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385312; bh=Iu5C3ooRaWKjY7somX4iTbM3ydgKzvZrW86nV/Ycor0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tj79JawYjc0ZinBWA1tUguVaHtLqaM6C7fAGJ3gE3dbtErpPegxA2gMFM4od7E83+ HCcqrZ85vXLI1ZgI/8f5nH5MOeSDdEPc+7AH1IzY7BuK2EYWgBhj7tJFvVJmXW/Jw/ BMNkSr7LFEKwfparH1w9Hw6hxTzQ+88bubSOE4ig= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Daniel Machon , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 0464/1167] net: lan966x: dont disable hardirqs in fdma tx clear path Date: Fri, 4 Dec 2026 18:58:11 +0900 Message-ID: <20261204100714.103666870@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daniel Machon [ Upstream commit b2e17432e7ee75997657f99862eb83be0c78a6c1 ] lan966x_fdma_tx_clear_buf() runs from the NAPI poll and frees the buffers of completed tx DCBs with napi_consume_skb(), page_pool_recycle_direct() and xdp_return_frame_bulk(), under lan966x->tx_lock. Before this patch, the lock is taken with spin_lock_irqsave(), so the buffers are freed with hardirqs disabled. RX skbs are marked for page_pool recycling, so when such an skb is forwarded back out and its tx completion frees it here, the free path reaches __page_pool_put_page(), which warns via lockdep_assert_no_hardirq(). Take tx_lock with a plain spin_lock(), as the other tx_lock users, lan966x_port_xmit() and lan966x_fdma_xmit_xdpf(), already do. tx_clear_buf() runs from the NAPI poll, so disabling hardirqs there is not needed. Found with lockdep enabled (CONFIG_PROVE_LOCKING), which the assert depends on. Reproduced on a lan9668 board by redirecting received frames out of another port with tc mirred. Fixes: 11871aba1974 ("net: lan96x: Use page_pool API") Signed-off-by: Daniel Machon Link: https://patch.msgid.link/20261026-lan966x-fdma-tx-clear-hardirq-v1-1-5f70f026a2e4@microchip.com Signed-off-by: Jakub Kicinski [ sashal: Replaced spin_lock_irqsave()/spin_unlock_irqrestore() with plain spin_lock()/spin_unlock() in lan966x_fdma_tx_clear_buf(), keeping this tree's older struct lan966x_db declaration and FDMA_DCB_MAX loop bound. ] Signed-off-by: Sasha Levin --- drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c index 4bebf0c91f30b..3590b99a794ed 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c @@ -399,13 +399,12 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight) struct lan966x_tx_dcb_buf *dcb_buf; struct xdp_frame_bulk bq; struct lan966x_db *db; - unsigned long flags; bool clear = false; int i; xdp_frame_bulk_init(&bq); - spin_lock_irqsave(&lan966x->tx_lock, flags); + spin_lock(&lan966x->tx_lock); for (i = 0; i < FDMA_DCB_MAX; ++i) { dcb_buf = &tx->dcbs_buf[i]; @@ -456,7 +455,7 @@ static void lan966x_fdma_tx_clear_buf(struct lan966x *lan966x, int weight) if (clear) lan966x_fdma_wakeup_netdev(lan966x); - spin_unlock_irqrestore(&lan966x->tx_lock, flags); + spin_unlock(&lan966x->tx_lock); } static bool lan966x_fdma_rx_more_frames(struct lan966x_rx *rx) -- 2.53.0