From mboxrd@z Thu Jan 1 00:00:00 1970 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 BC6842BEFEF; Wed, 30 Sep 2026 19:09:47 +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=1790795388; cv=none; b=sfXsQLMW6nJ/p77/80po1i0T0DZUS9Tu+uzHRuNFFkSGjP9nid/LD2vYuGLm1Oukw+7TJvay2nIRD1/DN5FCFUFNkAaXsqesK2QXS5ljqO4clvd4BRC+2R1j/6cAvFq/FL4+kNhNohkz8qx54p5uURKulNtF9zWkXw9N5xOR7lY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790795388; c=relaxed/simple; bh=2MoeMhwf00r2zaJFS5iTuWa6LwI8BisbByLj1jKGU4s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o/27bOxh8jXSq+eiqMWVH+oVh0Os8snjCmcH/kSTkUrC3PYCc7hX6CmgzoqJAANX1oVewQf4YziLnNlGUEBDV45/r+wrVLpmUUB+8Er6UWDAxNF6GvV+I35OL789yB9X8ueeZJKVVJwv6VgyLJnourB6527Ny3j4aOJc2RF2cLE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TDFYoYJi; 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="TDFYoYJi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E6EE1F000FF; Wed, 30 Sep 2026 19:09:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790795387; bh=UWxrlqA97jl0po3oxjsFgkt7DIH1p++/7AzDvfB8dxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TDFYoYJinaez2EojuIf0Wi7dkYOkJR24dNiTPRXHkzek8+52dGZqLUTdFiIazbaZh swsA4XkezJvBp1VpJCM8Yksb+gqPGHJ0BeKIE5o91OO3Nqp/eijtiWh7orbyWNNvea deX78oAxgAKr0mFt6GEiUVdXa6St6e1vXT/pSmf8= 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.6 0544/1193] net: ethernet: cortina: Finish RX updates before NAPI completion Date: Wed, 30 Sep 2026 17:20:28 +0200 Message-ID: <20260930152446.314125017@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@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.6-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 02f63c479df08..6f8a230f7f47f 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -1586,12 +1586,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) { @@ -1599,7 +1597,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