Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0D7BD522EF0; Thu, 17 Sep 2026 17:25:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789665930; cv=none; b=qseVfabnzmo+endWdqKOd8j/HxNGuDR5cylqW7edI7C6rGJgpSnlzNnSBU8N1ALMYxTmRkRWtaKpPtxjveran/4rDdhP52c27VdcOpE54SMpojgoJlM/ewFGnT/EfAL9Xc+mlDS/wvG4teT3hsAYr3zEHkZDoiNzTiCPFFExXH8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789665930; c=relaxed/simple; bh=O3qaCqXxUD/dGnJt+sAKD++dh3Jmf+uvheXJ0eSbrFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GkRUDN+D1+Tg0h9zFiYe0Ua0ChhkSFZEcz9fxzosvNw7DMC42uKnbpeWC/hGmGxDjOh0MB/KSepz4JQ35JZnkc4Y7gx0hgATFkfzFuFM9IZv0RerLBvHLa3JMdYsaMhKUm1zUT0KDUeNH/u6bNLpfn7b5Bb0nV0+Vf3uikAX7OI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eJi8xn3/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="eJi8xn3/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51BAC1F000FF; Thu, 17 Sep 2026 17:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789665928; bh=mllp4ZOtK4Yw/b1DIFXZYi64upIMKTIQ1wFQ286/fiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eJi8xn3/IG+aIesVQXjd/DNwzTnBtVsUnY2Sjtn3ttnUpULfw1aBvsQdt7zFRwAOa KxiRXlFUZXvGUaElkfV8AoI+R60K661xwUrmVxE6kunmCKTYF7JWJw8PWT+7muiJAB vNOaqv+ekr31T6T1fJ1bRYuYnvDg9XeU7js7nTjQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Joe Damato , Linus Walleij , Paolo Abeni , Sasha Levin Subject: [PATCH 6.18 0868/1250] net: ethernet: cortina: Finish RX updates before NAPI completion Date: Thu, 17 Sep 2026 16:11:03 +0100 Message-ID: <20260917151615.500622707@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit baa26841cb9a2cdc7e0e99d6854a4e3359bf7393 ] napi_complete_done() releases ownership of the NAPI instance, but the Gemini poll keeps the RX statistics writer section open and updates the free queue after calling it. A new poll can therefore start while the old writer is still active. Finish the statistics and free queue updates before releasing ownership. Only re-enable RX interrupts when napi_complete_done() reports successful completion. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Suggested-by: Joe Damato Assisted-by: LLM Signed-off-by: Linus Walleij Link: https://patch.msgid.link/20260903-gemini-ethernet-fixes-v2-2-2bbbd598ca6e@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/cortina/gemini.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index aee5cdbf62afb..b2e1c9db1279f 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -1582,12 +1582,10 @@ static int gmac_napi_poll(struct napi_struct *napi, int budget) u64_stats_update_begin(&port->rx_stats_syncp); received = gmac_rx(napi->dev, budget); - if (received < budget) { - napi_gro_flush(napi, false); - napi_complete_done(napi, received); - gmac_enable_rx_irq(napi->dev, 1); + if (received < budget) ++port->rx_napi_exits; - } + + u64_stats_update_end(&port->rx_stats_syncp); port->freeq_refill += received; if (port->freeq_refill > freeq_threshold) { @@ -1595,7 +1593,9 @@ static int gmac_napi_poll(struct napi_struct *napi, int budget) geth_fill_freeq(geth, true); } - u64_stats_update_end(&port->rx_stats_syncp); + if (received < budget && napi_complete_done(napi, received)) + gmac_enable_rx_irq(napi->dev, 1); + return received; } -- 2.53.0